/**
 * unit_main.css
 * ユニットメインで使用する標準スタイル
 */

/* ========================================
   メッセージ表示
   ======================================== */

.message-success {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    color: #155724;
}

.message-error {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
}

/* ========================================
   データ一覧
   ======================================== */

.data-list-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.data-list-section h3 {
    margin: 0 0 20px 0;
}

/* セクションヘッダー（ボタン付き） */
.section-header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.section-header-with-button h2,
.section-header-with-button h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

/* ボタングループ */
.button-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.button-group .btn {
    white-space: nowrap;
}

.section-header-with-bulk-delete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header-with-bulk-delete h3 {
    margin: 0;
}

.bulk-delete-hidden {
    display: none;
}

.table-scroll-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

/* 操作列を中央揃え（標準リストタイプ） */
.data-table th:last-child,
.data-table td:last-child {
    text-align: center;
}

.data-table tr:hover {
    background-color: #f5f5f5;
}

.btn-edit {
    background-color: var(--unit-color);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    display: inline-block;
}

.btn-edit:hover {
    opacity: 0.9;
}

/* モーダル関連のボタンスタイルは modal.css に移行 */

@media screen and (max-width: 768px) {
    .section-header-with-button {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .section-header-with-button h2,
    .section-header-with-button h3 {
        font-size: 18px;
    }
    
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .button-group .btn {
        width: 100%;
    }
    
    .section-header-with-bulk-delete {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .data-list-section #bulk-delete-btn {
        width: 100%;
    }
}

/* ========================================
   統計セクション
   ======================================== */

/* 統計セクション全体 */
.stats-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.stats-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* 統計カードグリッド */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* 個別統計カード */
.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 25px 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid var(--unit-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

/* 統計数値 */
.stat-number {
    font-size: 2.2em;
    font-weight: bold;
    color: var(--unit-color);
    margin-bottom: 8px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* 統計ラベル */
.stat-label {
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* 統計セクション レスポンシブ対応 */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-section {
        padding: 20px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 1.8em;
    }
    
    .stat-label {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 1.6em;
    }
}

