/* ===== MSB Activity Panel - Professional Redesign ===== */
/* Design System: Exaggerated Minimalism for SaaS Dashboard */
/* Typography: Poppins (headings) + Inter (body) */
/* Color: Professional Blue + Emerald Accent */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700;800&display=swap');

/* ===== CSS Custom Properties (Design Tokens) ===== */
:root {
    /* Colors - Light Mode */
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #3B82F6;
    --primary-ghost: rgba(37, 99, 235, 0.08);
    --primary-ring: rgba(37, 99, 235, 0.2);

    --accent: #059669;
    --accent-dark: #047857;
    --accent-light: #10B981;
    --accent-ghost: rgba(5, 150, 105, 0.08);

    --warning: #F59E0B;
    --warning-dark: #D97706;
    --warning-ghost: rgba(245, 158, 11, 0.08);

    --danger: #DC2626;
    --danger-dark: #B91C1C;
    --danger-light: #EF4444;
    --danger-ghost: rgba(220, 38, 38, 0.08);

    --info: #0EA5E9;
    --info-ghost: rgba(14, 165, 233, 0.08);

    /* Surfaces */
    --bg: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-sidebar: #0F172A;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: rgba(37, 99, 235, 0.15);

    /* Text */
    --text: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;
    --text-sidebar: rgba(255, 255, 255, 0.7);
    --text-sidebar-active: #FFFFFF;

    /* Borders */
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --border-focus: var(--primary);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Poppins', var(--font-sans);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar */
    --sidebar-width: 260px;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
    --primary: #3B82F6;
    --primary-dark: #60A5FA;
    --primary-light: #2563EB;
    --primary-ghost: rgba(59, 130, 246, 0.12);
    --primary-ring: rgba(59, 130, 246, 0.25);

    --accent: #34D399;
    --accent-dark: #6EE7B7;
    --accent-light: #059669;
    --accent-ghost: rgba(52, 211, 153, 0.12);

    --warning: #FBBF24;
    --warning-dark: #FCD34D;
    --warning-ghost: rgba(251, 191, 36, 0.12);

    --danger: #F87171;
    --danger-dark: #FCA5A5;
    --danger-light: #EF4444;
    --danger-ghost: rgba(248, 113, 113, 0.12);

    --info: #38BDF8;
    --info-ghost: rgba(56, 189, 248, 0.12);

    --bg: #0F172A;
    --bg-card: #1E293B;
    --bg-elevated: #1E293B;
    --bg-sidebar: #0B1120;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.04);
    --bg-sidebar-active: rgba(59, 130, 246, 0.15);

    --text: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #0F172A;

    --border: #334155;
    --border-light: #1E293B;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
}

/* ===== Base Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Layout ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: var(--space-6) var(--space-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text-inverse);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.sidebar-logo-text {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-inverse);
}

.sidebar-logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4) var(--space-3);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-6);
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 var(--space-3);
    margin-bottom: var(--space-2);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px var(--space-3);
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}

.nav-item.active .nav-item-icon {
    color: var(--primary);
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.nav-item-icon svg {
    width: 18px;
    height: 18px;
}

.sidebar-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-inverse);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Top Bar ===== */
.top-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) var(--space-8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.top-bar-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.top-bar-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* ===== Content Area ===== */
.content-area {
    padding: var(--space-8);
    flex: 1;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-title svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ===== Stat Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xs);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-ring);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue { background: var(--primary-ghost); color: var(--primary); }
.stat-icon.green { background: var(--accent-ghost); color: var(--accent); }
.stat-icon.orange { background: var(--warning-ghost); color: var(--warning); }
.stat-icon.red { background: var(--danger-ghost); color: var(--danger); }
.stat-icon.cyan { background: var(--info-ghost); color: var(--info); }

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: var(--space-1);
    font-weight: 500;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    font-family: var(--font-sans);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.98);
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-accent {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-warning {
    background: var(--warning);
    color: #1a1a1a;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: var(--warning-dark);
    border-color: var(--warning-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--primary-ghost);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 15px;
}

.btn-xl {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-clock-in {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    font-size: 15px;
    padding: 14px 28px;
    border: none;
    font-weight: 600;
}

.btn-clock-in:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-clock-out {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    font-size: 15px;
    padding: 14px 28px;
    border: none;
    font-weight: 600;
}

.btn-clock-out:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}

.btn-lunch {
    background: linear-gradient(135deg, #0EA5E9, #0284C7);
    color: white;
    font-size: 15px;
    padding: 14px 28px;
    border: none;
    font-weight: 600;
}

.btn-lunch:hover {
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
    transform: translateY(-2px);
}

/* ===== Bonuses ===== */
.bonus-hero {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
    padding: 22px 26px;
    color: #78350F;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 55%, #FCD34D 100%);
    border: 1px solid #F59E0B;
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.2);
}

.bonus-hero-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    font-size: 32px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 50%;
}

.bonus-hero-content { flex: 1; min-width: 0; }
.bonus-hero-label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bonus-hero-amount { margin: 2px 0 4px; font-family: var(--font-display); font-size: 30px; font-weight: 800; }
.bonus-hero-reason { font-size: 15px; font-weight: 600; white-space: pre-wrap; }
.bonus-hero-date { margin-top: 7px; font-size: 12px; color: #92400E; }
.bonus-amount { color: #B45309; font-weight: 800; white-space: nowrap; }

.bonus-history { min-width: 210px; max-width: 340px; align-self: stretch; padding: 12px 14px; background: rgba(255,255,255,.45); border-radius: var(--radius-lg); }
.bonus-history summary { cursor: pointer; font-weight: 700; }
.bonus-history-list { margin-top: 10px; display: grid; gap: 8px; }
.bonus-history-item { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid rgba(146,64,14,.2); font-size: 13px; }
.bonus-history-item small { color: #92400E; }

.input-with-suffix { display: flex; align-items: stretch; }
.input-with-suffix .form-input { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-with-suffix > span { display: flex; align-items: center; padding: 0 14px; color: var(--text-secondary); background: var(--bg); border: 1px solid var(--border); border-left: 0; border-radius: 0 var(--radius-md) var(--radius-md) 0; font-weight: 700; }

@media (max-width: 768px) {
    .bonus-hero { align-items: flex-start; flex-wrap: wrap; padding: 18px; }
    .bonus-hero-icon { width: 48px; height: 48px; flex-basis: 48px; font-size: 24px; }
    .bonus-history { min-width: 100%; max-width: none; }
}

/* ===== Saved Employee Reports ===== */
.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.report-kpi {
    display: grid;
    gap: 3px;
    padding: 16px;
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}
.report-kpi > span { font-size: 20px; }
.report-kpi > strong { font-family: var(--font-display); font-size: 22px; color: var(--primary); }
.report-kpi > small { color: var(--text-secondary); }

.report-chart-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.report-chart { padding: 18px; border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--surface); }
.report-chart-title { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; font-weight: 700; }
.report-chart-title strong { color: var(--primary); }
.report-progress { height: 14px; overflow: hidden; margin-bottom: 8px; background: var(--border-light); border-radius: 999px; }
.report-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #818CF8); border-radius: inherit; }
.report-progress.green i { background: linear-gradient(90deg, #10B981, #34D399); }
.report-chart small { color: var(--text-secondary); }

.report-bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 80px 1fr 28px; align-items: center; gap: 8px; font-size: 12px; }
.bar-row > i { height: 9px; overflow: hidden; background: var(--border-light); border-radius: 999px; }
.bar-row > i > b { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.bar-row.warning > i > b { background: var(--warning); }
.bar-row.danger > i > b { background: var(--danger); }
.bar-row > strong { text-align: right; }
.ai-analysis-text { white-space: pre-wrap; line-height: 1.7; font-size: 14px; }

@media (max-width: 1100px) {
    .report-kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .report-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .report-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== AI field controls ===== */
.ai-field-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 7px;
}

.voice-input-button {
    color: #0369A1;
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(14, 165, 233, 0.07);
    font-size: 11px;
    padding: 5px 10px;
}

.voice-input-button:hover {
    color: white;
    border-color: #0284C7;
    background: linear-gradient(135deg, #0EA5E9, #0284C7);
}

.voice-input-button.is-listening {
    color: white;
    border-color: #DC2626;
    background: #EF4444;
    animation: voicePulse 1.2s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
    50% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
}

.ai-enhance-button {
    color: #6D28D9;
    border-color: rgba(109, 40, 217, 0.28);
    background: rgba(139, 92, 246, 0.07);
    font-size: 11px;
    padding: 5px 10px;
}

.ai-enhance-button:hover {
    color: white;
    border-color: #7C3AED;
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.22);
}

.ai-enhance-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.voice-input-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Date & time inputs ===== */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    min-height: 44px;
    color-scheme: light;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    width: 20px;
    height: 20px;
    padding: 5px;
    cursor: pointer;
    border-radius: 6px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    background: var(--primary-ghost);
}

.temporal-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.temporal-action {
    padding: 4px 8px;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font: 500 11px/1.3 var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.temporal-action:hover,
.temporal-action:focus-visible {
    color: var(--primary);
    border-color: var(--primary-ring);
    background: var(--primary-ghost);
}

.temporal-action.temporal-picker {
    color: var(--primary);
    font-weight: 700;
}

.temporal-action.temporal-clear:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-ghost);
}

/* ===== Sortable tables ===== */
.sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
}

.sortable-header:hover,
.sortable-header:focus-visible {
    color: var(--primary);
    background: var(--primary-ghost);
}

.sort-indicator {
    display: inline-block;
    min-width: 14px;
    margin-left: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.sortable-header[aria-sort="ascending"] .sort-indicator,
.sortable-header[aria-sort="descending"] .sort-indicator {
    color: var(--primary);
}

.reports-data-table {
    min-width: 1200px;
}

.report-text-cell {
    min-width: 190px;
    max-width: 320px;
    white-space: pre-wrap;
    vertical-align: top;
    line-height: 1.5;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px var(--space-5);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 14px var(--space-5);
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text);
}

tr {
    transition: background var(--transition-fast);
}

tr:hover {
    background: var(--primary-ghost);
}

tr:last-child td {
    border-bottom: none;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1.4;
    white-space: nowrap;
}

.badge-new { background: var(--primary-ghost); color: var(--primary); }
.badge-in_progress { background: var(--warning-ghost); color: var(--warning-dark); }
.badge-pending_review { background: var(--info-ghost); color: var(--info); }
.badge-completed { background: var(--accent-ghost); color: var(--accent); }
.badge-on_hold { background: rgba(100, 116, 139, 0.1); color: #64748B; }

.badge-low { background: var(--accent-ghost); color: var(--accent); }
.badge-medium { background: var(--warning-ghost); color: var(--warning-dark); }
.badge-high { background: rgba(239, 68, 68, 0.08); color: #EF4444; }
.badge-urgent { background: var(--danger-ghost); color: var(--danger); }

.badge-active { background: var(--accent-ghost); color: var(--accent); }
.badge-inactive { background: var(--danger-ghost); color: var(--danger); }

/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text);
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.form-input:hover:not(:focus),
.form-select:hover:not(:focus),
.form-textarea:hover:not(:focus) {
    border-color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    padding: var(--space-5);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ===== Grid Layout ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

/* ===== Time Tracker ===== */
.time-tracker {
    text-align: center;
    padding: var(--space-8) var(--space-6);
}

.time-display {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-2);
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

.time-label {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    font-weight: 500;
}

.time-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.lunch-countdown {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    padding: 10px 18px;
    color: #0369A1;
    background: #E0F2FE;
    border: 1px solid #7DD3FC;
    border-radius: var(--radius-lg);
}

.lunch-countdown strong {
    font-family: var(--font-display);
    font-size: 25px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.lunch-countdown small {
    color: #075985;
}

.lunch-countdown.lunch-warning {
    color: #92400E;
    background: #FEF3C7;
    border-color: #FCD34D;
}

.lunch-completed {
    padding: 12px 18px;
    color: #047857;
    background: #D1FAE5;
    border: 1px solid #6EE7B7;
    border-radius: var(--radius-lg);
    font-weight: 600;
}

.time-status {
    margin-top: var(--space-6);
    padding: var(--space-5);
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.time-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) 0;
}

.time-status-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.time-status-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* ===== Report Template ===== */
.report-template {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    border-left: 4px solid var(--primary);
}

.report-template-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--primary);
}

.report-template-item {
    margin-bottom: var(--space-4);
}

.report-template-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-1);
}

.report-template-hint {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Alerts ===== */
.alert {
    padding: 14px var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert > svg,
.alert > span:first-child {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-success {
    background: var(--accent-ghost);
    border-color: rgba(5, 150, 105, 0.15);
    color: var(--accent-dark);
}

.alert-danger {
    background: var(--danger-ghost);
    border-color: rgba(220, 38, 38, 0.15);
    color: var(--danger-dark);
}

.alert-warning {
    background: var(--warning-ghost);
    border-color: rgba(245, 158, 11, 0.15);
    color: var(--warning-dark);
}

.alert-info {
    background: var(--info-ghost);
    border-color: rgba(14, 165, 233, 0.15);
    color: #0369A1;
}

[data-theme="dark"] .alert-info {
    color: var(--info);
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    padding: var(--space-5);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(5, 150, 105, 0.06) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, 2%) rotate(1deg); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-12) var(--space-10);
    width: 100%;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.login-logo svg {
    width: 32px;
    height: 32px;
    color: white;
}

.login-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-2);
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-5);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
}

.empty-icon svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

.empty-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.empty-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== File List ===== */
.file-list {
    list-style: none;
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-light);
}

.file-item:last-child {
    border-bottom: none;
}

.file-icon {
    color: var(--primary);
}

.file-icon svg {
    width: 18px;
    height: 18px;
}

.file-name {
    flex: 1;
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.file-name:hover {
    text-decoration: underline;
}

/* ===== Task Card ===== */
.task-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    transition: all var(--transition-base);
}

.task-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-ring);
}

.task-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    gap: var(--space-3);
}

.task-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.task-card-body {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    line-height: 1.6;
}

.task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.task-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: 13px;
    color: var(--text-muted);
}

.task-card-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* ===== Quick Action Banner ===== */
.quick-action-banner {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: white;
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.quick-action-banner h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.quick-action-banner p {
    margin: var(--space-1) 0 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Language Switcher ===== */
.lang-switcher {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--border);
}

.lang-switcher a {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
    color: var(--text-muted);
}

.lang-switcher a.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-xs);
}

.lang-switcher a:hover:not(.active) {
    color: var(--text);
    background: var(--primary-ghost);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--text-muted);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* ===== Responsive: tablets and phones ===== */
/* Desktop styles above remain unchanged. These breakpoints progressively
   simplify the same server-rendered UI for Android WebView and mobile web. */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: inline-flex !important;
    }

    .sidebar {
        width: min(320px, 86vw);
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .main-content {
        min-width: 0;
        margin-left: 0;
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-area {
        min-width: 0;
        padding: var(--space-5);
    }

    .top-bar {
        padding: var(--space-4) var(--space-5);
    }

    .top-bar-left,
    .top-bar-right,
    .card-title,
    .stat-content {
        min-width: 0;
    }

    .top-bar-right {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .card-header {
        flex-wrap: wrap;
        gap: var(--space-3);
    }

    .table-container {
        width: 100%;
        max-width: 100%;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    .responsive-auto-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Filters with inline widths become fluid tablet columns. */
    .card-body > form[method="GET"] {
        flex-wrap: wrap !important;
    }

    .card-body > form[method="GET"] > .form-group {
        flex: 1 1 180px;
    }

    .modal {
        max-width: min(680px, calc(100vw - 40px)) !important;
    }
}

@media (max-width: 767px) {
    .grid-2,
    .grid-3,
    .report-chart-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .top-bar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .top-bar-left {
        flex: 1 1 100%;
        width: 100%;
    }

    .top-bar-right {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: var(--space-2);
        padding: 1px 0 3px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .top-bar-right::-webkit-scrollbar {
        display: none;
    }

    .top-bar-right > * {
        flex: 0 0 auto;
    }

    .top-bar-right > div {
        display: flex;
        flex-wrap: nowrap !important;
    }

    .top-bar-subtitle {
        display: none;
    }

    .quick-action-banner,
    .task-card-header,
    .task-card-footer,
    .bonus-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .task-card-meta {
        width: 100%;
        flex-wrap: wrap;
        gap: var(--space-2) var(--space-4);
    }

    .report-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .responsive-auto-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .card-body > form[method="GET"] > .form-group {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0 !important;
    }

    .time-buttons,
    .time-buttons form,
    .time-buttons .btn,
    .lunch-countdown,
    .lunch-completed {
        width: 100%;
    }

    .time-buttons .alert {
        width: 100%;
        margin-bottom: 0;
    }

    .btn:not(.btn-sm),
    .nav-item,
    .form-input,
    .form-select,
    .form-textarea {
        min-height: 44px;
    }

    .btn-sm,
    .theme-toggle,
    .mobile-menu-toggle {
        min-height: 40px;
    }

    input[type="checkbox"],
    input[type="radio"] {
        min-width: 20px;
        min-height: 20px;
    }

    .form-input,
    .form-select,
    .form-textarea,
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"] {
        max-width: 100%;
        font-size: 16px; /* Prevents Android/iOS zooming focused fields. */
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        width: 100%;
        max-width: none !important;
        max-height: min(92dvh, 92vh);
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--bg-card);
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;
        flex-wrap: wrap;
        background: var(--bg-card);
    }

    .modal-footer .btn {
        flex: 1 1 140px;
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 15px;
        overflow-x: hidden;
    }

    body,
    .app-container,
    .main-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .content-area {
        padding: 12px;
    }

    .top-bar {
        padding: 10px 12px;
    }

    .top-bar-title {
        overflow: hidden;
        font-size: 17px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .top-bar-right .btn,
    .lang-switcher a {
        min-height: 36px;
        padding: 8px 10px;
    }

    .top-bar-right a[href="/logout"] {
        width: 38px;
        padding: 0;
        font-size: 0;
    }

    .top-bar-right a[href="/logout"] svg {
        width: 18px;
        height: 18px;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    .card-header,
    .card-body,
    .card-footer,
    .report-template {
        padding: 16px;
    }

    .card-header > .flex {
        max-width: 100%;
        flex-wrap: wrap;
    }

    .time-tracker {
        padding: 18px 0;
    }

    .time-display {
        font-size: clamp(32px, 12vw, 44px);
    }

    .login-page {
        min-height: 100dvh;
        padding: 14px;
    }

    .login-container {
        max-width: 100%;
    }

    .login-card {
        padding: 28px 20px;
    }

    .login-header {
        margin-bottom: 24px;
    }

    .login-logo {
        width: 54px;
        height: 54px;
    }

    .bonus-hero {
        padding: 16px;
    }

    .bonus-history {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .quick-action-banner {
        padding: 16px;
    }

    .quick-action-banner > div,
    .quick-action-banner .btn {
        width: 100%;
    }

    .quick-action-banner > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .task-card {
        padding: 16px;
    }

    .task-card-body,
    .report-text-cell,
    td,
    .alert,
    .bonus-hero-reason {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .toast-notification,
    #toastContainer > * {
        width: auto;
        min-width: 0;
        max-width: none;
    }

    #toastContainer {
        top: 12px !important;
        right: 12px !important;
        left: 12px !important;
    }

    .empty-state {
        padding: 32px 12px;
    }

    /* Tables become readable cards instead of forcing a page-wide zoom. The
       labels are copied from headers by initializeResponsiveTables(). */
    .table-container.responsive-cards {
        overflow: visible;
    }

    table.responsive-table,
    table.responsive-table tbody,
    table.responsive-table tr,
    table.responsive-table td {
        display: block;
        width: 100%;
        min-width: 0 !important;
    }

    table.responsive-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    table.responsive-table tbody {
        display: grid;
        gap: 12px;
    }

    table.responsive-table tr {
        overflow: hidden;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-xs);
    }

    table.responsive-table td {
        display: grid;
        grid-template-columns: minmax(88px, 36%) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 11px 14px;
        text-align: right;
        border-bottom: 1px solid var(--border-light);
    }

    table.responsive-table td:last-child {
        border-bottom: 0;
    }

    table.responsive-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 700;
        line-height: 1.5;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    table.responsive-table td[data-label=""] {
        grid-template-columns: 1fr;
    }

    table.responsive-table td[data-label=""]::before {
        display: none;
    }

    table.responsive-table td > .flex,
    table.responsive-table td > div,
    table.responsive-table td > form {
        min-width: 0;
        justify-content: flex-end;
    }

    table.responsive-table td[colspan] {
        display: block;
        text-align: left;
    }

    .reports-data-table {
        min-width: 0;
    }
}

@media (max-width: 380px) {
    .content-area {
        padding: 8px;
    }

    .card-header,
    .card-body,
    .card-footer,
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-right: 12px;
        padding-left: 12px;
    }

    .report-kpi-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    table.responsive-table td {
        grid-template-columns: minmax(76px, 34%) minmax(0, 1fr);
        gap: 8px;
        padding: 10px 12px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .modal {
        max-height: 96vh;
    }

    .sidebar-header,
    .sidebar-footer {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg) 25%, var(--border-light) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ===== Toast Notifications ===== */
.toast-notification {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    animation: slideInRight 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.toast-notification::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    width: 100%;
    animation: shrink 5s linear forwards;
}

@keyframes shrink {
    from { width: 100%; }
    to { width: 0%; }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }

.mt-1 { margin-top: var(--space-2); }
.mt-2 { margin-top: var(--space-4); }
.mt-3 { margin-top: var(--space-6); }
.mt-4 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-2); }
.mb-2 { margin-bottom: var(--space-4); }
.mb-3 { margin-bottom: var(--space-6); }
.mb-4 { margin-bottom: var(--space-8); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: var(--space-2); }
.gap-2 { gap: var(--space-4); }
.gap-3 { gap: var(--space-6); }

.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ===== Focus Styles ===== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Print Styles ===== */
@media print {
    .sidebar, .top-bar, .modal-overlay, .toast-notification {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
}
