/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
.header {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.header h1 {
    color: #667eea;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-date {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 16px;
}

/* メインコンテンツ */
.main-content {
    padding: 40px 0;
}

/* セクション共通 */
section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: #667eea;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ダッシュボードカード */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.card-content {
    flex: 1;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.card-label {
    font-size: 14px;
    color: #777;
    margin-top: 5px;
}

/* 従業員グリッド */
.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.employee-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.employee-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

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

.employee-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-not-checked-in {
    background: #e9ecef;
    color: #6c757d;
}

.status-checked-in {
    background: #d4edda;
    color: #155724;
}

.status-out {
    background: #f8d7da;
    color: #721c24;
}

.status-checked-out {
    background: #d1ecf1;
    color: #0c5460;
}

.employee-times {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 13px;
}

.time-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.time-row:last-child {
    border-bottom: none;
}

.time-label {
    color: #666;
}

.time-value {
    font-weight: 600;
    color: #333;
}

.employee-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ボタンスタイル */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
}

/* テーブル */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.attendance-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.attendance-table th,
.attendance-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.attendance-table th {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.attendance-table tbody tr:hover {
    background: #f8f9fa;
}

.attendance-table tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center !important;
    color: #999;
    padding: 40px !important;
    font-style: italic;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header i {
    color: #667eea;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 編集フォーム */
.edit-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.edit-info p {
    margin: 5px 0;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input[type="time"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input[type="time"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-clear {
    margin-top: 8px;
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* ボタンアイコン（テーブル用） */
.btn-icon {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-edit {
    background: #ffc107;
    color: #333;
}

.btn-edit:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}
/* 入力フィールド */
.date-input,
.month-select {
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: border-color 0.3s ease;
}

.date-input:focus,
.month-select:focus {
    outline: none;
    border-color: #667eea;
}

.summary-controls {
    margin-bottom: 20px;
}

.month-select {
    width: 200px;
}

/* レスポンシブ: モーダル */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* フッター */
.footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 0;
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 40px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }

    .header-date {
        font-size: 14px;
        padding: 8px 12px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        justify-content: center;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .employee-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .employee-actions {
        grid-template-columns: 1fr;
    }

    .attendance-table {
        font-size: 12px;
    }

    .attendance-table th,
    .attendance-table td {
        padding: 10px 8px;
    }

    section {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .card {
        flex-direction: column;
        text-align: center;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .card-value {
        font-size: 28px;
    }
}