/* ===== CSS 變數 ===== */
:root {
    --primary: #c81e1e;
    --primary-dark: #8f1010;
    --primary-light: #fde8e8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #2563eb;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --border: #dde3ee;
    --text: #18212f;
    --text-muted: #667085;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 64px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    background:
        radial-gradient(circle at top right, rgba(200,30,30,0.08), transparent 28%),
        linear-gradient(180deg, #f9fbff 0%, #eef3fa 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}
.app-shell { display: contents; }
body.auth-locked {
    overflow: hidden;
}
body.auth-locked .app-shell {
    display: none;
}
.auth-screen {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top, rgba(200,30,30,0.28) 0%, transparent 24%),
        linear-gradient(145deg, #18212f 0%, #2b3447 100%);
    z-index: 3000;
}
.auth-screen.active { display: flex; }
.auth-card {
    width: min(100%, 420px);
    background: rgba(255,255,255,0.98);
    border-radius: 24px;
    box-shadow: 0 28px 70px rgba(15,23,42,0.35);
    padding: 32px;
    border: 1px solid rgba(255,255,255,0.7);
}
.auth-brand {
    text-align: center;
    margin-bottom: 20px;
}
.auth-logo {
    width: 140px;
    max-width: 100%;
    display: block;
    margin: 0 auto 12px;
}
.brand-kicker {
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff5f5;
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
}
.auth-brand h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}
.auth-brand p {
    color: var(--text-muted);
    line-height: 1.6;
}
.auth-form { display: grid; gap: 14px; }
.auth-error {
    min-height: 20px;
    color: var(--danger);
    font-size: 0.85rem;
}
.btn-block {
    width: 100%;
    justify-content: center;
}
a { text-decoration: none; color: inherit; }
.sidebar {
    width: var(--sidebar-width);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0)),
        linear-gradient(180deg, #161c27 0%, #253147 58%, #1d2433 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 4px 0 15px rgba(0,0,0,0.15);
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: var(--topbar-height);
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
}
.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    padding: 4px;
    flex-shrink: 0;
}
.logo-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.logo-text strong {
    font-size: 1rem;
    letter-spacing: 0.02em;
}
.logo-text small {
    color: rgba(255,255,255,0.62);
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-toggle {
    background: none; border: none; color: rgba(255,255,255,0.7);
    cursor: pointer; padding: 6px; border-radius: 6px;
    transition: var(--transition); flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    border-left: 3px solid transparent;
    margin: 2px 0;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; border-left-color: rgba(255,255,255,0.45); }
.nav-item.active { background: linear-gradient(90deg, rgba(200,30,30,0.32), rgba(255,255,255,0.08)); color: white; border-left-color: #ff8a8a; font-weight: 600; }
.nav-item i { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item { padding: 12px; justify-content: center; }
.sidebar.collapsed .logo { justify-content: center; }
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}
.main-content.expanded { margin-left: var(--sidebar-collapsed); }
.topbar {
    height: var(--topbar-height);
    background: rgba(255,255,255,0.9);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(15,23,42,0.06);
    backdrop-filter: blur(12px);
}
.menu-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 1.1rem; padding: 8px;
    border-radius: 8px; transition: var(--transition);
    display: none;
}
.menu-btn:hover { background: var(--bg); color: var(--text); }
.topbar-title { font-size: 1.2rem; font-weight: 700; color: var(--text); flex: 1; }
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff6f6, #fff);
    border: 1px solid #fde2e2;
}
.topbar-brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}
.topbar-brand strong {
    display: block;
    font-size: 0.82rem;
    color: var(--text);
}
.topbar-brand span {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
}
.current-time { color: var(--text-muted); font-size: 0.85rem; }
.page-content { padding: 24px; flex: 1; }
.page { display: none; }
.page.active { display: block; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-header h1 i { color: var(--primary); }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid transparent;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.blue { border-left-color: #3b82f6; }
.stat-card.green { border-left-color: #10b981; }
.stat-card.orange { border-left-color: #f59e0b; }
.stat-card.purple { border-left-color: #8b5cf6; }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.stat-card.blue .stat-icon { background: #eff6ff; color: #3b82f6; }
.stat-card.green .stat-icon { background: #f0fdf4; color: #10b981; }
.stat-card.orange .stat-icon { background: #fffbeb; color: #f59e0b; }
.stat-card.purple .stat-icon { background: #f5f3ff; color: #8b5cf6; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.chart-container { min-height: 200px; }
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px rgba(15,23,42,0.06);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(221,227,238,0.9);
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h3 i { color: var(--primary); }
.card-body { padding: 20px; }
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
}
.search-box i { color: var(--text-muted); }
.search-box input {
    border: none; background: none; outline: none;
    color: var(--text); font-size: 0.85rem; width: 200px;
}
.table-responsive { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table th {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.member-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.member-name-cell:hover strong { color: var(--primary); }
.member-name-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.member-name-meta small {
    color: var(--text-muted);
    font-size: 0.75rem;
}
.text-center { text-align: center; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-xs { padding: 3px 8px; font-size: 0.75rem; }
.btn-icon { padding: 6px 8px; }
.action-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-blue { background: #eff6ff; color: #3b82f6; }
.badge-green { background: #f0fdf4; color: #10b981; }
.badge-orange { background: #fffbeb; color: #f59e0b; }
.badge-purple { background: #f5f3ff; color: #8b5cf6; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.member-detail-card {
    display: grid;
    gap: 18px;
}
.member-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff5f5, #fff);
    border: 1px solid #fde2e2;
}
.member-detail-title h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}
.member-detail-title p {
    color: var(--text-muted);
}
.member-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.member-detail-item {
    padding: 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
}
.member-detail-item label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 6px;
}
.member-detail-item strong {
    font-size: 1rem;
}
.member-detail-notes {
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px dashed #d7deea;
    line-height: 1.7;
    white-space: pre-wrap;
}
.member-detail-section {
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
}
.member-detail-section h5 {
    font-size: 0.95rem;
    margin-bottom: 12px;
}
.member-log-list {
    display: grid;
    gap: 10px;
}
.member-log-item {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fafafa;
    padding: 14px;
}
.member-log-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.member-log-project {
    font-weight: 700;
    color: var(--text);
}
.member-log-task {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 2px;
}
.member-log-date {
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}
.member-log-content {
    line-height: 1.7;
    margin-bottom: 8px;
    white-space: pre-wrap;
}
.member-log-notes {
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: pre-wrap;
}
.chart-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.chart-bar-label { width: 120px; font-size: 0.82rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-bar-track { flex: 1; height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 5px; transition: width 0.8s ease; }
.chart-bar-value { width: 60px; font-size: 0.82rem; color: var(--text-muted); text-align: right; }
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}
.modal.show { display: flex; }
.modal-dialog {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}
.modal-dialog-xl { max-width: 900px; }
.modal-sm .modal-dialog { max-width: 380px; }
.modal-xl .modal-dialog { max-width: 900px; }
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-header-actions { display: flex; align-items: center; gap: 8px; }
.modal-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 1rem; padding: 4px;
    border-radius: 6px; transition: var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.required { color: var(--danger); }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--surface);
    transition: var(--transition);
    outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.task-block {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    overflow: hidden;
}
.task-header {
    background: #f8fafc;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
    flex-wrap: wrap;
    gap: 8px;
}
.task-header:hover { background: #f1f5f9; }
.task-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}
.task-title i { color: var(--primary); }
.task-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.task-export-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 700;
}
.task-export-toggle input {
    width: 15px;
    height: 15px;
    accent-color: #dc2626;
}
.task-body { padding: 16px; border-top: 1px solid var(--border); }
.task-actions { display: flex; gap: 6px; }
.hours-breakdown {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.hours-breakdown.compact {
    justify-content: flex-end;
}
.hours-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.hours-chip.total { background: #dbeafe; color: #1d4ed8; }
.hours-chip.regular { background: #dcfce7; color: #15803d; }
.hours-chip.overtime { background: #fef3c7; color: #b45309; }
.hours-chip.holiday { background: #fce7f3; color: #be185d; }
.worklog-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.worklog-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.worklog-info { flex: 1; min-width: 0; }
.worklog-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.worklog-member { font-weight: 600; font-size: 0.85rem; }
.worklog-role { font-size: 0.75rem; color: var(--text-muted); }
.worklog-date { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }
.worklog-content { font-size: 0.85rem; color: var(--text); margin-bottom: 4px; }
.worklog-notes { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.worklog-hours {
    display: none;
}
.worklog-actions { display: flex; gap: 4px; flex-shrink: 0; }
.assignment-list { display: grid; gap: 16px; }
.assignment-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    padding: 16px;
}
.assignment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.assignment-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.assignment-meta {
    margin: 2px 0 12px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.assignment-meta strong {
    color: var(--primary);
    font-size: 0.95rem;
}
.project-info-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}
.project-info-item { display: flex; align-items: center; gap: 6px; }
.project-hours-block { align-items: flex-start; }
.project-info-item i { color: var(--primary); }
.project-info-item strong { color: var(--text); }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.section-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.section-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-header h4 i { color: var(--primary); }
.toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--surface);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 380px;
    animation: toastIn 0.3s ease;
    border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }
.toast i { font-size: 1.1rem; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }
.toast span { font-size: 0.85rem; flex: 1; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 0.9rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
.sidebar-overlay.show { display: block; }
.loading-spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hours-display {
    font-weight: 700;
    color: var(--primary);
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary); }
@media (max-width: 1024px) {
    .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
    .menu-btn { display: flex !important; }
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .assignment-grid { grid-template-columns: 1fr; }
    .search-box input { width: 140px; }
    .data-table { font-size: 0.78rem; }
    .data-table th, .data-table td { padding: 8px 10px; }
    .modal-dialog { margin: 0; border-radius: var(--radius) var(--radius) 0 0; max-height: 95vh; }
    .modal { align-items: flex-end; }
    .topbar { padding: 0 16px; }
    .topbar-brand { display: none; }
    .task-header { padding: 10px 12px; }
    .worklog-item { flex-wrap: wrap; }
    .worklog-date { margin-left: 0; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .action-buttons { flex-wrap: wrap; }
}
