/* ===================================
   AH Werkschema Manager - Styles
   Nordic Utility Design System
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

/* ═══════════════════════════════════════════════
   Design Tokens — Refined Nordic Utility System
   ═══════════════════════════════════════════════ */
:root {
    /* Brand */
    --primary: #E50000;
    --primary-light: #FF2D2D;
    --primary-dark: #B80000;
    --primary-content: #FFFFFF;
    --primary-ghost: rgba(229, 0, 0, 0.06);
    --primary-muted: rgba(229, 0, 0, 0.12);
    --secondary: #E50000;
    --success: #16A34A;
    --success-light: #22C55E;
    --success-ghost: rgba(22, 163, 74, 0.08);
    --warning: #EA8C00;
    --warning-light: #F59E0B;
    --warning-ghost: rgba(234, 140, 0, 0.08);
    --error: #DC2626;
    --error-light: #EF4444;
    --info: #0EA5E9;
    --danger: #DC2626;

    /* Surface palette */
    --bg-main: #F1F4F9;
    --bg-card: #FFFFFF;
    --bg-header: #FFFFFF;
    --bg-hover: rgba(0, 0, 0, 0.025);
    --bg-active: var(--primary-ghost);
    --bg-subtle: #F8FAFC;

    /* Typography */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-light: #94A3B8;
    --text-inverse: #FFFFFF;

    /* Neutrals */
    --neutral-50: #F8FAFC;
    --neutral-100: #F1F5F9;
    --neutral-200: #E2E8F0;
    --neutral-300: #CBD5E1;
    --neutral-400: #94A3B8;
    --neutral-500: #64748B;

    /* Borders */
    --border-color: #E2E8F0;
    --border-subtle: rgba(0, 0, 0, 0.06);

    /* Spacing scale (8px base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 48px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --border-radius: 10px;

    /* Elevation (layered, natural) */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.1), 0 4px 8px -4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.12), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
    --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.25);

    /* Focus Ring — blue, not red (red reads as error) */
    --focus-color: #3b82f6;
    --ring-color: rgba(59, 130, 246, 0.3);
    --ring-offset: 2px;

    /* Layout */
    --sidebar-width: 240px;
    --header-height: 56px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 0.15s;
    --duration-base: 0.25s;
    --duration-slow: 0.4s;
    --transition: all var(--duration-base) var(--ease-smooth);
    --transition-fast: all var(--duration-fast) var(--ease-smooth);
    --transition-spring: all var(--duration-base) var(--ease-spring);

    /* Backward compat */
    --bg: var(--bg-card);
    --bg-secondary: var(--bg-main);
    --border: var(--border-color);
    --text: var(--text-primary);
}

/* Dark Mode — Deep Command UI */
[data-theme="dark"] {
    --primary: #FF2D2D;
    --primary-light: #FF5252;
    --primary-dark: #CC0000;
    --primary-ghost: rgba(255, 45, 45, 0.08);
    --primary-muted: rgba(255, 45, 45, 0.15);
    --secondary: #FF2D2D;

    --bg-main: #0C1220;
    --bg-card: #141E30;
    --bg-header: #101828;
    --bg-hover: rgba(255, 255, 255, 0.04);
    --bg-active: rgba(255, 45, 45, 0.10);
    --bg-subtle: #182236;

    --text-primary: #E2E8F0;
    --text-secondary: #7E8FA6;
    --text-light: #475569;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);

    --neutral-50: #1A2538;
    --neutral-100: #1E2A3E;
    --neutral-200: #263244;
    --neutral-300: #334155;
    --neutral-400: #475569;
    --neutral-500: #64748B;

    --shadow-xs: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.35), 0 0 1px rgba(255,45,45,0.05);
    --shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 2px rgba(255,45,45,0.06);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.45), 0 0 3px rgba(255,45,45,0.08);
    --shadow-lg: 0 20px 48px rgba(0,0,0,0.5), 0 0 6px rgba(255,45,45,0.10);

    --focus-color: #60a5fa;
    --shadow-focus: 0 0 0 3px rgba(96, 165, 250, 0.3);
    --ring-color: rgba(96, 165, 250, 0.35);

    --bg: var(--bg-card);
    --bg-secondary: var(--bg-main);
    --border: var(--border-color);
    --text: var(--text-primary);
}

/* Hide ziekmelding tab for admin/manager */
body[data-role="admin"] [data-employee-only="true"],
body[data-role="manager"] [data-employee-only="true"],
body[data-role="admin"] #page-ziekmelding,
body[data-role="manager"] #page-ziekmelding {
    display: none !important;
}

/* Hide manager/admin tabs for employees — bulletproof CSS layer */
body[data-role="employee"] .nav-item[data-page]:not([data-page="planning"]):not([data-page="vakantie"]):not([data-page="ziekmelding"]) {
    display: none !important;
}
/* Hide manager/admin nav categories for employees */
body[data-role="employee"] .nav-category[data-role="manager"],
body[data-role="employee"] .nav-category[data-role="admin"] {
    display: none !important;
}
/* Hide admin-only nav categories for manager/employee */
body[data-role="manager"] .nav-category[data-role="admin"],
body[data-role="manager-operatie"] .nav-category[data-role="admin"],
body[data-role="manager-vers"] .nav-category[data-role="admin"],
body[data-role="manager-service"] .nav-category[data-role="admin"] {
    display: none !important;
}
/* Hide Roosteren category label for employees (they see Planning under Personeel context) */
body[data-role="employee"] .nav-category:not([data-role="manager"]):not([data-role="admin"]) {
    display: block !important;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-primary);
    background: var(--bg-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.006em;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===================================
   Accessibility - Skip Link & Focus
   =================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0 0 4px 0;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible styles for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ===================================
   Login Page Styles
   =================================== */

.login-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0C1220;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(229, 0, 0, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 95, 138, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(229, 0, 0, 0.08) 0%, transparent 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 400px;
    margin: var(--space-5);
    overflow: hidden;
    position: relative;
    animation: loginCardIn 0.5s var(--ease-out) both;
}

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

[data-theme="dark"] .login-card {
    background: rgba(20, 30, 48, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-header {
    text-align: center;
    padding: 32px 24px 24px;
    border-bottom: 1px solid var(--border-color);
}

.login-header .logo {
    margin-bottom: 16px;
}

.login-header .logo-ah {
    display: none;
}

.login-header .logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    margin-bottom: 4px;
}

.login-header .logo-text {
    display: none;
    font-size: 18px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.login-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.login-body {
    padding: 24px;
}

.login-demo {
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.login-demo code {
    background: var(--bg-main);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* ===================================
   Header Styles
   =================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-5);
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}

[data-theme="dark"] .header {
    background: rgba(22,26,34,0.92);
    border-bottom-color: rgba(255,255,255,0.06);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
}

.menu-toggle:hover {
    background: rgba(0,0,0,0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-ah {
    display: none;
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logo-text {
    display: none;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.store-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-main);
    border-radius: var(--border-radius);
}

.store-selector select {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 28px 8px 12px;
    border-radius: var(--border-radius);
}

.store-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.store-name .material-icons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-name span:last-child {
    line-height: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.undo-redo-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 16px;
    padding-right: 16px;
    border-right: 1px solid var(--border-color);
}

.undo-redo-buttons .btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.week-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════
   Calendar Picker Popup
   ═══════════════════════════════════════════════ */
.calendar-picker-popup {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
    padding: 16px;
    width: 320px;
    animation: calFadeIn 0.15s ease-out;
    user-select: none;
}

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

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

.cal-month-label {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.cal-nav {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
}

.cal-nav .material-icons {
    font-size: 20px;
}

.cal-today-btn {
    text-align: center;
    margin-bottom: 10px;
}

.cal-today-btn .btn {
    font-size: 12px;
    padding: 4px 16px;
}

.cal-grid {
    display: grid;
    grid-template-columns: 36px repeat(7, 1fr);
    gap: 1px;
}

.cal-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 4px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cal-wk {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    padding: 4px 0;
}

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

.cal-wk-current {
    background: var(--primary);
    color: #fff !important;
    border-radius: var(--radius-sm);
}

.cal-day {
    text-align: center;
    font-size: 13px;
    padding: 6px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.1s;
    color: var(--text-primary);
    font-weight: 500;
}

.cal-day:hover {
    background: var(--bg-hover);
}

.cal-day.cal-out {
    color: var(--text-light);
    opacity: 0.5;
}

.cal-day.cal-today {
    font-weight: 800;
    color: var(--primary);
    position: relative;
}

.cal-day.cal-today::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

.cal-day.cal-active-week {
    background: var(--primary-ghost);
}

.cal-day.cal-active-week.cal-today {
    background: var(--primary-muted);
}

#weekDisplay {
    position: relative;
}

#weekDisplay:hover {
    color: var(--primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.user-menu:hover {
    background: var(--bg-main);
}

/* ===================================
   Sidebar Styles
   =================================== */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: var(--space-4) 0 0;
    overflow-y: auto;
    transition: transform var(--duration-base) var(--ease-out);
    z-index: 900;
    display: flex;
    flex-direction: column;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 var(--space-3);
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 9px var(--space-4);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    letter-spacing: -0.006em;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(1px);
}

.nav-item.active {
    background: var(--primary-ghost);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item .material-icons,
.nav-item i[class^="ph"] {
    font-size: 20px;
    opacity: 1;
    color: inherit;
}

/* Nav category dividers */
.nav-category {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9CA3AF;
    padding: 14px 14px 4px;
    margin-top: 4px;
}

.nav-category:first-child {
    margin-top: 0;
    padding-top: 6px;
}

/* Sidebar clock widget */
.sidebar-clock {
    padding: var(--space-4) var(--space-5) var(--space-5);
    margin-top: var(--space-2);
    border-top: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
}

.sidebar-clock-time {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
}

.sidebar-clock-date {
    font-size: 10.5px;
    color: var(--text-light);
    margin-top: 6px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
}

/* Dark mode clock */
[data-theme="dark"] .sidebar-clock {
    border-top: 1px solid rgba(255,255,255,0.08);
}

[data-theme="dark"] .sidebar-clock-time {
    color: #FFFFFF;
}

[data-theme="dark"] .sidebar-clock-date {
    color: rgba(255,255,255,0.50);
}

/* Phosphor icon base sizing */
.btn-icon i[class^="ph"],
.header-right i[class^="ph"],
.header-center i[class^="ph"],
.header-left i[class^="ph"],
.menu-toggle i[class^="ph"] {
    font-size: 20px;
    line-height: 1;
}

.card-header i[class^="ph"] {
    font-size: 16px;
    flex-shrink: 0;
    color: var(--primary);
    opacity: 0.8;
}

.stat-icon i[class^="ph"],
.stat-icon .material-icons {
    font-size: 22px;
}

.user-menu i[class^="ph"] {
    font-size: 20px;
    color: var(--text-secondary);
}

.tip-callout i[class^="ph"] {
    font-size: 18px;
}

/* Departments list */
.dept-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

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

.dept-row:hover {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

.dept-code-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-family: inherit;
}

[data-theme="dark"] .dept-code-badge {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}

/* Function rows in settings */
.func-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.func-row:last-child { border-bottom: none; }
.func-row:hover { background: var(--bg-hover); border-radius: var(--radius-sm); }

.func-code-badge {
    min-width: 44px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    background: var(--primary-ghost);
    border: 1px solid var(--primary-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--primary);
    flex-shrink: 0;
}

.func-meta {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.func-actions {
    flex-shrink: 0;
}

.dept-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dept-info strong {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.dept-tasks {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dept-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.dept-type {
    font-size: 11px;
    color: var(--text-light);
    padding: 0 8px;
    letter-spacing: 0.02em;
}

.dept-delete-btn {
    opacity: 0;
    transition: opacity 0.15s;
}

.dept-row:hover .dept-delete-btn {
    opacity: 1;
}

/* ===================================
   Main Content
   =================================== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: var(--space-7);
    padding-bottom: var(--space-9);
    min-height: calc(100vh - var(--header-height));
    box-sizing: border-box;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: pageReveal 0.35s var(--ease-out) both;
}

@keyframes pageReveal {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Keep fadeIn as alias for backward compat */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
}

.page-header .subtitle {
    color: var(--text-secondary);
    margin-top: var(--space-1);
    font-size: 13px;
}

.page-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: center;
}

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

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    transition: background var(--duration-base) var(--ease-smooth);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.stat-card:hover::before {
    background: var(--primary);
}

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

.stat-icon.blue { background: var(--primary); }
.stat-icon.orange { background: var(--warning); }
.stat-icon.green { background: var(--success); }
.stat-icon.yellow { background: #D97706; }

.stat-content h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-5);
    transition: box-shadow var(--duration-base) var(--ease-smooth);
}

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

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

.card-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.card-body, .card-content {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-color);
    background: var(--bg-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Card Variants */
.card-bordered {
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.card-compact .card-header,
.card-compact .card-body,
.card-compact .card-content {
    padding: var(--space-3) var(--space-4);
}

/* ===================================
   Dashboard Grid
   =================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 5fr 3fr;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

/* Budget Bars */
.budget-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.budget-bar-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.budget-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
}

.budget-bar {
    height: 6px;
    background: var(--neutral-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.budget-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s var(--ease-out);
}

/* Afdeling Budget Grid */
.afdeling-budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-4);
}

.afdeling-budget-card {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    border: 1px solid var(--border-color);
    transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-smooth);
}

.afdeling-budget-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.afdeling-budget-card.under {
    border-left: 3px solid var(--warning);
}

.afdeling-budget-card.ok {
    border-left: 3px solid var(--success);
}

.afdeling-budget-card.over {
    border-left: 3px solid var(--error);
}

.afdeling-header {
    padding-left: 12px;
    margin-bottom: 16px;
}

.afdeling-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.afdeling-stats {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg);
    border-radius: 6px;
}

.afdeling-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.afdeling-stats .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.afdeling-stats .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.afdeling-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.afdeling-progress .progress-bar {
    height: 12px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.afdeling-progress .progress-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 6px;
}

.afdeling-progress .progress-text {
    font-size: 12px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
}

/* Dark mode */
[data-theme="dark"] .afdeling-budget-card {
    background: var(--bg-main);
    border-color: var(--border);
}

[data-theme="dark"] .afdeling-stats {
    background: var(--bg);
}

[data-theme="dark"] .afdeling-progress .progress-bar {
    background: var(--bg);
    border-color: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .afdeling-budget-grid {
        grid-template-columns: 1fr;
    }

    .afdeling-stats {
        flex-direction: column;
        gap: 12px;
    }

    .afdeling-stats .stat {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
}

/* Week Mini Grid */
.week-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    padding: 20px;
}

.day-mini-card {
    text-align: center;
    padding: 12px;
    background: var(--bg-main);
    border-radius: var(--border-radius);
}

.day-mini-card.today {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.3);
    transform: scale(1.05);
}

/* Today badge */
.today-badge {
    display: inline-block;
    background: var(--secondary);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    animation: pulse-badge 2.5s infinite;
    text-transform: uppercase;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Schedule day today indicator */
.schedule-day.is-today {
    border: 2px solid #FF0000;
    box-shadow: 0 4px 18px rgba(255, 0, 0, 0.2);
}

.schedule-day.is-today .schedule-day-header {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
}

[data-theme="dark"] .schedule-day.is-today {
    border-color: #FF3333;
    box-shadow: 0 4px 18px rgba(255, 0, 0, 0.3);
}

.day-mini-card .day-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.day-mini-card .day-date {
    font-size: 12px;
    opacity: 0.7;
}

.day-mini-card .day-hours {
    font-size: 18px;
    font-weight: 700;
    margin-top: 8px;
}

.day-mini-card .day-shifts {
    font-size: 11px;
    opacity: 0.7;
}

/* ===================================
   Schedule Grid
   =================================== */
.schedule-container {
    overflow-x: auto;
}

.schedule-grid {
    display: block;
    overflow-x: auto;
}

.shift-card.dragging {
    opacity: 0.6;
    transform: scale(0.98);
}

.schedule-day-content.drag-over {
    outline: 2px dashed var(--primary);
    outline-offset: -6px;
    background: rgba(255, 0, 0, 0.05);
}

.schedule-day {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.schedule-day-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 11px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-day-header h3 {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.schedule-day-header .day-date {
    font-size: 11px;
    opacity: 0.75;
    font-weight: 400;
}

.schedule-day-header .hours-badge {
    background: rgba(255,255,255,0.18);
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.schedule-day-content {
    padding: 12px;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

/* Shift Cards */
.shift-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary);
    cursor: pointer;
    transition: var(--transition);
}

.shift-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    border-color: rgba(255, 0, 0, 0.3);
}

.shift-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.shift-employee {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.shift-function {
    font-size: 10px;
    font-weight: 700;
    color: white;
    background: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.03em;
}

.shift-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* Status Code Styles */
.shift-card.status-card {
    background: var(--bg-card);
    opacity: 0.95;
}

.status-code-badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    color: white;
    margin-right: 6px;
}

.shift-break {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.shift-notes {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shift-tasks {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.task-chip {
    font-size: 10px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.task-chip.houdbaar { background: #E3F2FD; color: #1565C0; }
.task-chip.vers { background: #E8F5E9; color: #2E7D32; }
.task-chip.diepvries { background: #F3E5F5; color: #7B1FA2; }
.task-chip.service { background: #FFF3E0; color: #E65100; }

/* Priority indicators on task chips */
.task-chip.priority-1 { border-left: 3px solid #F44336; }
.task-chip.priority-2 { border-left: 3px solid #FF9800; }
.task-chip.priority-3 { border-left: 3px solid #FFC107; }
.task-chip.priority-4 { border-left: 3px solid #4CAF50; }
.task-chip.priority-5 { border-left: 3px solid #9E9E9E; }

/* Priority Badge */
.priority-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    margin-left: 6px;
}

.priority-badge.priority-1 { background: #F44336; color: white; }
.priority-badge.priority-2 { background: #FF9800; color: white; }
.priority-badge.priority-3 { background: #FFC107; color: #333; }
.priority-badge.priority-4 { background: #4CAF50; color: white; }
.priority-badge.priority-5 { background: #9E9E9E; color: white; }

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

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-main);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    min-width: 250px;
}

.search-box .material-icons {
    color: var(--text-secondary);
    font-size: 20px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    width: 100%;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-light);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group select {
    min-width: 150px;
}

/* Toolbar select styling for planning/timeline pages */
.toolbar-select {
    margin-right: 8px;
    min-width: 120px;
}

.toolbar-select-wide {
    margin-right: 8px;
    min-width: 150px;
}

.toolbar-select-narrow {
    margin-right: 8px;
    min-width: 100px;
}

.filter-count {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-secondary);
}

.filter-count strong {
    color: var(--primary);
}

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

.data-table th,
.data-table td {
    padding: 11px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-main);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr:nth-child(even) {
    background: var(--neutral-50);
}

.data-table tbody tr:hover {
    background: rgba(255, 0, 0, 0.04);
}

/* ===================================
   Tasks Grid
   =================================== */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-main);
    border-radius: 6px;
    margin-bottom: 8px;
}

.task-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-abbr {
    font-weight: 700;
    font-size: 14px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: white;
}

.task-abbr.houdbaar { background: #1565C0; }
.task-abbr.vers { background: #2E7D32; }
.task-abbr.diepvries { background: #7B1FA2; }
.task-abbr.service { background: #E65100; }

.task-name {
    font-weight: 500;
}

.task-hours {
    font-size: 13px;
    color: var(--text-secondary);
}

.category-badge {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.category-badge.houdbaar { background: #E3F2FD; color: #1565C0; }
.category-badge.vers { background: #E8F5E9; color: #2E7D32; }
.category-badge.diepvries { background: #F3E5F5; color: #7B1FA2; }
.category-badge.service { background: #FFF3E0; color: #E65100; }

/* ===================================
   Budget Page
   =================================== */
.budget-calculator .form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.day-distribution {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 16px;
    padding: 20px;
}

.day-dist-card {
    text-align: center;
    padding: 16px;
    background: var(--bg-main);
    border-radius: var(--border-radius);
}

.day-dist-card .day-name {
    font-weight: 500;
    margin-bottom: 8px;
}

.day-dist-card .percentage {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.day-dist-card .hours {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===================================
   Reports Page
   =================================== */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-container {
    height: 300px;
    padding: 20px;
}

/* Simple Bar Chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    gap: 8px;
    padding: 20px 0;
}

.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 60px;
}

.bar {
    width: 100%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.bar-label {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}

.bar-value {
    font-size: 10px;
    font-weight: 500;
    margin-top: 4px;
}

/* Category Chart */
.category-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow-y: auto;
}

.category-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-name {
    width: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.category-bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
}

.category-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-value {
    width: 60px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Contract Chart */
.contract-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    overflow-y: auto;
}

.contract-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.contract-name {
    width: 120px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contract-bar-container {
    flex: 1;
    height: 20px;
    background: var(--bg-card);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.contract-bar-planned {
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary);
    border-radius: 4px;
    opacity: 0.7;
}

.contract-bar-contract {
    height: 4px;
    position: absolute;
    left: 0;
    bottom: 0;
    background: var(--secondary);
    border-radius: 2px;
}

.contract-values {
    width: 80px;
    font-size: 10px;
    text-align: right;
    color: var(--text-secondary);
}

.contract-values strong {
    color: var(--text-primary);
}

/* ===================================
   Settings Page
   =================================== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-full-width {
    grid-column: 1 / -1;
}

.settings-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}

.settings-divider {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.kpi-thresholds {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kpi-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
}

.kpi-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kpi-dot-green { background: var(--success); }
.kpi-dot-orange { background: var(--warning); }
.kpi-dot-red { background: var(--error); }

.kpi-row label {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

.kpi-row input {
    width: 68px !important;
    text-align: center;
    padding: 5px 8px !important;
}

.kpi-unit {
    font-size: 12px;
    color: var(--text-light);
    width: 14px;
}

/* Tip callout — replaces clunky tips-banner in settings */
.tip-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    background: rgba(255, 167, 38, 0.07);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--warning);
    margin-bottom: 16px;
}

[data-theme="dark"] .tip-callout {
    background: rgba(255, 167, 38, 0.05);
}

.tip-callout .material-icons {
    color: var(--warning);
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.tip-callout p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Day distribution + opening hours compact rows */
.dist-row, .hours-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.dist-row:last-of-type, .hours-row:last-of-type {
    border-bottom: none;
}

.dist-day, .hours-day {
    width: 100px;
    color: var(--text-primary);
    font-weight: 500;
    flex-shrink: 0;
}

.dist-row input[type="number"] {
    width: 64px !important;
    text-align: center;
    padding: 5px 8px !important;
}

.hours-row input[type="time"] {
    width: 88px !important;
    padding: 5px 8px !important;
    font-size: 13px;
}

.dist-unit, .hours-sep {
    color: var(--text-light);
    font-size: 12px;
}

.dist-total {
    display: flex;
    justify-content: space-between;
    padding: 8px 0 2px;
    margin-top: 4px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Card header icon */
.card-header .material-icons {
    font-size: 18px;
    flex-shrink: 0;
}

/* ===================================
   Buttons - FlyonUI Style
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 8px var(--space-4);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 550;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.005em;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.btn:active {
    transform: scale(0.97);
    transition-duration: 0.06s;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary Button */
.btn-primary {
    background: var(--primary);
    color: var(--primary-content);
    box-shadow: 0 1px 3px rgba(229, 0, 0, 0.25);
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 2px 8px rgba(229, 0, 0, 0.3);
}

/* Secondary/Outline Button */
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
}

/* Soft Buttons */
.btn-soft {
    background: var(--primary-ghost);
    color: var(--primary);
    border: none;
}

.btn-soft:hover {
    background: var(--primary-muted);
}

/* Success Button */
.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.25);
}

.btn-success:hover {
    background: var(--success-light);
    box-shadow: var(--shadow);
}

/* Danger Button */
.btn-danger {
    background: var(--error);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: var(--error-light);
    box-shadow: var(--shadow);
}

/* Warning Button */
.btn-warning {
    background: var(--warning);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
    background: var(--warning-light);
}

/* Ghost/Text Button */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    box-shadow: none;
}

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

/* Icon Button */
.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--ring-color);
}

/* Button Sizes */
.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-small, .btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

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

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

/* Block Button */
.btn-block {
    width: 100%;
}

/* Button with loading */
.btn.loading {
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================
   Badges
   =================================== */
.badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.badge.success { background: var(--success); }
.badge.warning { background: var(--warning); }
.badge.error { background: var(--error); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-badge.inactive {
    background: #FFEBEE;
    color: #C62828;
}

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

.form-group label {
    display: block;
    font-weight: 550;
    font-size: 12.5px;
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

/* Form hint text (help text below inputs) */
.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
    line-height: 1.4;
}

.form-hint.warning {
    color: var(--warning);
}

.form-hint.info {
    color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px var(--space-3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.5;
    transition: border-color var(--duration-fast) var(--ease-smooth), box-shadow var(--duration-fast) var(--ease-smooth);
    font-family: inherit;
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* Rounded for single-line inputs */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="time"],
.form-group input[type="date"] {
    border-radius: var(--radius-md);
}

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

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--neutral-400);
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--focus-color);
    box-shadow: var(--shadow-focus);
}

/* Input with icon */
.input-group {
    position: relative;
}

.input-group input {
    padding-left: 40px;
}

.input-group .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* Readonly/Disabled */
.readonly-input,
.form-group input:disabled,
.form-group select:disabled {
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Input sizes */
.input-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.input-lg {
    padding: 14px 18px;
    font-size: 16px;
}

/* ===================================
   Standard Select/Dropdown Styling
   =================================== */
select,
.form-select {
    padding: 9px 34px 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: inherit;
}

select:hover,
.form-select:hover {
    border-color: var(--primary);
    background-color: var(--bg-main);
}

select:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.12);
}

select:disabled,
.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--bg-main);
}

/* Dark mode dropdown styling - improved */
[data-theme="dark"] select,
[data-theme="dark"] .form-select {
    background-color: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e0e0e0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
}

[data-theme="dark"] select:hover,
[data-theme="dark"] .form-select:hover {
    background-color: #333;
    border-color: var(--primary);
}

[data-theme="dark"] select:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #333;
    border-color: var(--primary);
}

[data-theme="dark"] option {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.task-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-main);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.task-checkbox input {
    width: auto;
}

.task-checkbox:hover {
    background: var(--border-color);
}

/* Availability checkboxes */
.availability-checkboxes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.availability-day {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-main);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.availability-day:has(input:checked),
.availability-day.is-checked {
    background: rgba(255, 0, 0, 0.08);
    border-color: var(--primary);
}

/* Preferred Times */
.preferred-times {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preferred-time-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.preferred-time-row .day-label {
    width: 30px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.time-input-small {
    flex: 1;
    min-width: 0;
    max-width: 120px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.time-input-small:focus {
    outline: none;
    border-color: var(--focus-color);
}

/* Department checkboxes */
.department-checkboxes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.department-check {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--bg-main);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.department-check:has(input:checked),
.department-check.is-checked {
    background: rgba(255, 0, 0, 0.08);
    border-color: var(--primary);
}

/* Shift preference radios */
.shift-preference-radios {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.shift-pref-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-main);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.shift-pref-radio:has(input:checked),
.shift-pref-radio.is-checked {
    background: rgba(255, 0, 0, 0.08);
    border-color: var(--primary);
}

/* Status toggles */
.status-toggles {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.status-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-main);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.status-toggle:has(input:checked),
.status-toggle.is-checked {
    background: rgba(244, 67, 54, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.status-toggle .material-icons {
    font-size: 18px;
}

/* Leave requests container */
.leave-requests-container {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    background: var(--bg-main);
}

.leave-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--bg-card);
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 12px;
}

.leave-request-item:last-child {
    margin-bottom: 0;
}

.leave-request-type {
    font-weight: 600;
    color: var(--primary);
    min-width: 70px;
}

.leave-request-dates {
    color: var(--text-secondary);
    flex: 1;
    text-align: center;
}

.leave-request-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.leave-request-status.pending {
    background: rgba(255, 167, 38, 0.2);
    color: var(--warning);
}

.leave-request-status.approved {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
}

.leave-request-status.rejected {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
}

.leave-request-delete {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    padding: 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.leave-request-delete:hover {
    opacity: 1;
}

.leave-warning {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Sick badge for employee list */
.employee-sick-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(244, 67, 54, 0.15);
    color: var(--error);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.employee-sick-badge .material-icons {
    font-size: 14px;
}

/* Sick employee row styling */
tr.employee-sick {
    background: rgba(244, 67, 54, 0.05);
}

tr.employee-sick td {
    opacity: 0.8;
}

.availability-day input {
    width: auto;
    margin: 0;
}

.availability-day:hover {
    background: var(--border-color);
}

.availability-display {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-main);
    padding: 4px 8px;
    border-radius: 4px;
}

/* ===================================
   Modal
   =================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 41, 0.45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: modalBgIn 0.2s var(--ease-smooth);
}

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

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: modalContentIn 0.3s var(--ease-out);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

@keyframes modalContentIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.015em;
}

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

/* Standalone form-groups that are direct children of modal-body must always span full width */
.modal-body > .form-group {
    display: block;
    width: 100%;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-main);
}

/* ===================================
   Loading Overlay & Spinner
   =================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.loading-spinner {
    background: var(--bg-card);
    padding: 32px 48px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* ===================================
   Empty States
   =================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state .material-icons {
    font-size: 56px;
    color: var(--neutral-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.empty-state p {
    font-size: 14px;
    max-width: 300px;
    margin-bottom: 16px;
}

.empty-state .btn {
    margin-top: 8px;
}

/* ===================================
   Toast
   =================================== */
.toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    background: var(--text-primary);
    color: var(--text-inverse);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    box-shadow: var(--shadow-lg);
    transform: translateY(16px);
    opacity: 0;
    transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-fast) var(--ease-smooth);
    z-index: 3000;
    font-size: 13.5px;
    font-weight: 500;
    max-width: 380px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--success-light);
    flex-shrink: 0;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .week-mini-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .budget-calculator .form-row {
        grid-template-columns: 1fr;
    }
    
    .day-distribution {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    
    .header-center {
        display: none;
    }
    
    .logo-text {
        display: none;
    }
    
    .week-selector {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .week-mini-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .schedule-grid {
        min-width: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
    
    .day-distribution {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tasks-grid {
        grid-template-columns: 1fr;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Today Schedule List
   =================================== */
.today-shift-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-main);
    border-radius: 6px;
    margin-bottom: 8px;
}

.today-shift-time {
    font-weight: 500;
    width: 100px;
    color: var(--primary);
}

.today-shift-employee {
    flex: 1;
    font-weight: 500;
}

.today-shift-tasks {
    display: flex;
    gap: 4px;
}

/* ===================================
   Budget Warnings
   =================================== */
.holiday-banner {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 1px solid #FFB74D;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #E65100;
}

.holiday-banner .material-icons {
    color: #FF9800;
}

.warning-under {
    background: rgba(244, 67, 54, 0.08) !important;
}

.warning-over {
    background: rgba(255, 152, 0, 0.08) !important;
}

/* ===================================
   Planning Overview Styles
   =================================== */
/* ===================================
   SCHEDULE TABLE (Weekrooster) - st-* classes
   Spreadsheet-clean. Data speaks, design whispers.
   =================================== */

.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.schedule-table thead th {
    background: #C62828;
    color: white;
    font-weight: 600;
    font-size: 11px;
    padding: 10px 6px 8px;
    text-align: center;
    white-space: nowrap;
    border: none;
    border-right: 1px solid rgba(255,255,255,0.1);
    border-bottom: 2px solid #B71C1C;
    position: sticky;
    top: 0;
    z-index: 5;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.schedule-table thead th:first-child {
    text-align: left;
    padding-left: 12px;
}

.schedule-table tbody td {
    padding: 6px 6px;
    border: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
    font-size: 12px;
    transition: background 0.1s;
}

/* Column sizing */
.st-name-col { text-align: left; min-width: 130px; }
.st-func-col { text-align: center; width: 44px; }
.st-day-col  { min-width: 95px; }
.st-total-col { width: 54px; min-width: 54px; }
.st-diff-col  { width: 54px; min-width: 54px; }

/* Day header */
.st-day-name {
    display: block;
    font-weight: 700;
    font-size: 12px;
}

.st-day-date {
    display: block;
    font-size: 10px;
    color: rgba(255,255,255,0.7);
}

.st-day-hours {
    display: inline-block;
    font-size: 10px;
    margin-top: 3px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.st-day-hours.st-ok    { background: rgba(76,175,80,0.35); color: #fff; }
.st-day-hours.st-over  { background: rgba(255,183,0,0.4); color: #fff; }
.st-day-hours.st-under { background: rgba(0,0,0,0.3); color: rgba(255,255,255,0.8); }

/* Today column — strong visual indicator */
.st-today {
    background: rgba(255, 0, 0, 0.08) !important;
    border-left: 3px solid var(--primary) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 0, 0, 0.10);
}

.schedule-table thead th.st-today {
    background: #B71C1C !important;
    color: white;
    position: relative;
    box-shadow: inset 0 -2px 0 rgba(255,255,255,0.2);
}

.schedule-table thead th.st-today .st-day-name {
    font-size: 13px;
    font-weight: 800;
}

.schedule-table thead th.st-today::after {
    content: 'VANDAAG';
    display: block;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    padding: 1px 6px;
    margin-top: 3px;
    color: rgba(255,255,255,0.95);
}

.st-totals-row td.st-today {
    background: rgba(255, 0, 0, 0.12) !important;
}

/* Group separator */
.st-group-row {
    background: var(--neutral-50) !important;
}

.schedule-table .st-group-row td {
    padding: 8px 16px !important;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-top: 1px solid var(--border-color) !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--neutral-50) !important;
}

.st-group-row td:first-child {
    border-left: 3px solid var(--primary) !important;
}

.st-group-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    background: var(--primary);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    margin-right: 6px;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

/* Employee rows */
.st-row:hover {
    background: var(--bg-hover) !important;
}

.st-row:nth-child(even) {
    background: var(--neutral-50);
}

.st-empty-row {
    opacity: 0.5;
}

.st-empty-row:hover {
    opacity: 0.8;
}

/* Employee name */
.st-name {
    text-align: left !important;
    padding-left: 12px !important;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-primary);
    font-size: 12px;
    vertical-align: middle !important;
}

.st-lastname {
    color: var(--text-light);
    font-weight: 400;
}

/* Function badge */
.st-func {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 4px 2px !important;
}

.st-func-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 5px;
    border-radius: var(--radius-full);
    background: rgba(255, 0, 0, 0.10);
    color: var(--primary-dark);
    letter-spacing: 0.02em;
    text-align: center;
}

/* Shift cells */
.st-cell {
    vertical-align: middle !important;
    padding: 5px 4px !important;
    text-align: center !important;
}

.st-cell > div,
.st-cell > .st-shift,
.st-cell > .st-status {
    margin-left: auto;
    margin-right: auto;
}

.st-filled {
    background: rgba(255, 0, 0, 0.04);
}

/* Shift entry — centered, clear contrast */
.st-shift {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 4px 10px;
    margin: 1px auto;
    background: rgba(255, 0, 0, 0.09);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.12s, box-shadow 0.12s, transform 0.1s;
    white-space: nowrap;
    border: 1px solid rgba(255, 0, 0, 0.25);
    border-left: 2px solid var(--primary);
}

.st-shift:hover {
    background: rgba(255, 0, 0, 0.16);
    border-color: rgba(255, 0, 0, 0.4);
    border-left-color: var(--primary);
    box-shadow: var(--shadow-xs);
    transform: translateY(-1px);
}

.st-shift.st-sel {
    background: rgba(255, 0, 0, 0.22);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255,0,0,0.3);
}

.st-shift.st-cut {
    opacity: 0.35;
    border: 1px dashed var(--neutral-400);
    background: var(--neutral-100);
}

.st-shift.st-detailed {
    border-left: 3px solid var(--primary);
}

/* Read-only shifts (employee view) — no hover effects, no pointer cursor */
.st-shift.st-readonly {
    cursor: default;
    pointer-events: none;
}

/* Times — bold, clear, aligned */
.st-shift-time {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.st-shift-sep {
    color: var(--text-light);
    margin: 0 2px;
    font-size: 11px;
    font-weight: 300;
}

.st-task-abbr {
    font-size: 9px;
    color: var(--primary-dark);
    margin-left: 4px;
    font-weight: 700;
    opacity: 0.75;
}

.st-detail-icon {
    color: var(--primary);
    margin-left: 2px;
    font-size: 9px;
}

/* Status code */
.st-status {
    display: inline-block;
    padding: 2px 7px;
    margin: 1px 0;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    letter-spacing: 0.03em;
    transition: transform 0.1s, box-shadow 0.1s;
}

.st-status:hover {
    transform: scale(1.06);
    box-shadow: var(--shadow-xs);
}

/* Add shift button — minimal */
.st-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 400;
    border: 1px dashed transparent;
    background: transparent;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}

.st-cell:hover .st-add { opacity: 1; }
.st-cell:not(.st-filled) .st-add {
    opacity: 0.4;
    border-color: var(--neutral-300);
}

.st-add:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    opacity: 1;
    transform: scale(1.1);
}

/* Hours & diff — aligned numbers */
.st-hours {
    text-align: center !important;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    background: var(--bg-main);
    vertical-align: middle !important;
    padding: 6px 4px !important;
    white-space: nowrap;
    border-left: 2px solid var(--border-color) !important;
}

.st-diff {
    text-align: center !important;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--bg-main);
    vertical-align: middle !important;
    padding: 6px 4px !important;
    white-space: nowrap;
}

.st-pos { color: #15803d; }
.st-neg { color: #dc2626; }

/* Totals row */
.st-totals-row {
    background: var(--bg-main) !important;
    border-top: 2px solid var(--primary) !important;
}

.st-totals-row td {
    padding: 9px 6px !important;
    font-weight: 700;
    border-top: 2px solid var(--primary) !important;
    font-size: 12px;
    vertical-align: middle !important;
    color: var(--text-primary);
}

.st-total-cell {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.st-total-cell.st-over  { color: #d97706; }
.st-total-cell.st-under { color: #dc2626; }

.st-budget-label {
    font-size: 10px;
    font-weight: 400;
    color: #aaa;
    margin-left: 1px;
}

/* Dark mode */
[data-theme="dark"] .schedule-table {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .schedule-table thead th {
    background: var(--bg-main);
    color: var(--text-primary);
    border-color: var(--border-color);
    border-bottom-color: var(--primary);
}

[data-theme="dark"] .schedule-table tbody td {
    border-color: var(--border-color);
}

[data-theme="dark"] .st-row:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

[data-theme="dark"] .st-group-row {
    background: rgba(255,255,255,0.03) !important;
}

[data-theme="dark"] .st-group-row td {
    color: var(--text-light);
}

[data-theme="dark"] .st-group-row td:first-child {
    border-left-color: var(--primary) !important;
}

[data-theme="dark"] .st-shift {
    background: rgba(255, 0, 0, 0.10);
    border-color: rgba(255, 0, 0, 0.2);
    border-left-color: var(--primary);
}

[data-theme="dark"] .st-shift:hover {
    background: rgba(255, 0, 0, 0.18);
    border-color: rgba(255, 0, 0, 0.35);
}

[data-theme="dark"] .st-func-badge {
    background: rgba(255,0,0,0.12);
    color: var(--primary-light);
}

[data-theme="dark"] .st-today {
    background: rgba(255, 0, 0, 0.10) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 0, 0, 0.08);
}

[data-theme="dark"] .schedule-table thead th.st-today {
    background: rgba(200, 0, 0, 0.6) !important;
    color: #fff;
    border-bottom-color: var(--primary);
    box-shadow: 0 3px 8px rgba(200, 0, 0, 0.3);
}

[data-theme="dark"] .st-totals-row td.st-today {
    background: rgba(255, 0, 0, 0.14) !important;
}

[data-theme="dark"] .st-hours,
[data-theme="dark"] .st-diff {
    background: rgba(255,255,255,0.03);
    border-left-color: var(--border-color) !important;
}

[data-theme="dark"] .st-pos { color: #4ade80; }
[data-theme="dark"] .st-neg { color: #f87171; }

[data-theme="dark"] .st-totals-row {
    background: var(--bg-main) !important;
}

[data-theme="dark"] .st-totals-row td {
    border-top-color: var(--primary) !important;
}

[data-theme="dark"] .st-filled {
    background: rgba(255, 0, 0, 0.04);
}

[data-theme="dark"] .st-day-hours.st-ok    { background: rgba(76,175,80,0.2);  color: #4ade80; }
[data-theme="dark"] .st-day-hours.st-over  { background: rgba(255,152,0,0.2);  color: #fbbf24; }
[data-theme="dark"] .st-day-hours.st-under { background: rgba(244,67,54,0.2);  color: #f87171; }

[data-theme="dark"] .shift-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* ═══════════════════════════════════════════════
   Right-Click Context Menu
   ═══════════════════════════════════════════════ */
.shift-context-menu {
    position: fixed;
    z-index: 10000;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.08);
    padding: 4px 0;
    animation: ctxFadeIn 0.12s ease-out;
}

@keyframes ctxFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.ctx-header {
    padding: 8px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 2px;
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.1s;
    text-align: left;
}

.ctx-item:hover {
    background: var(--bg-hover);
}

.ctx-item .material-icons {
    font-size: 18px;
    color: var(--text-secondary);
}

.ctx-item.ctx-danger { color: var(--error); }
.ctx-item.ctx-danger .material-icons { color: var(--error); }
.ctx-item.ctx-danger:hover { background: rgba(220, 38, 38, 0.08); }

.ctx-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════
   Planning Budget Display
   ═══════════════════════════════════════════════ */
.planning-budget-divider {
    color: var(--text-light);
    font-weight: 400;
    font-size: 11px;
    margin: 0 1px;
}

.planning-budget-norm {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
}

.planning-budget-pct {
    font-weight: 700;
    font-size: 11px;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
}

.planning-budget-pct.on-budget { color: var(--success); }
.planning-budget-pct.under-budget { color: var(--error); }
.planning-budget-pct.over-budget { color: var(--warning); }

/* Responsive */
@media (max-width: 1024px) {
    .schedule-table { font-size: 11px; }
    .st-day-col { min-width: 80px; }
    .st-name-col { min-width: 100px; }
    .st-func-col { width: 36px; }
    .st-shift-time { font-size: 11px; }
}

@media (max-width: 768px) {
    .schedule-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .schedule-table {
        min-width: 800px;
        font-size: 10px;
    }
    .st-name {
        position: sticky;
        left: 0;
        z-index: 3;
        background: #fff;
        box-shadow: 2px 0 4px rgba(0,0,0,0.06);
    }
    [data-theme="dark"] .st-name {
        background: var(--bg-card);
    }
}

/* Planning Table - Full Styling */
.planning-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.planning-table th {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    color: white;
    font-weight: 600;
    font-size: 12px;
    padding: 10px 12px;
    text-align: center;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.15);
    letter-spacing: 0.02em;
}

.planning-table th:first-child {
    text-align: left;
    min-width: 140px;
}

.planning-table td {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
    font-size: 12px;
}

.planning-table td:first-child {
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
    background: var(--bg-main);
}

.planning-table tbody tr:nth-child(even) {
    background: var(--neutral-50);
}

.planning-table tbody tr:hover {
    background: rgba(255, 0, 0, 0.04);
}

.planning-table td.has-shift {
    background: rgba(255, 0, 0, 0.06);
    font-weight: 500;
}

.planning-table .totals-row {
    background: var(--bg-main);
    font-weight: bold;
}

.planning-table .totals-row td {
    border-top: 2px solid var(--primary);
    font-weight: 700;
    padding: 10px 12px;
}

.planning-table .under-budget {
    background: rgba(244, 67, 54, 0.08);
}

.planning-table .over-budget {
    background: rgba(255, 152, 0, 0.08);
}

/* Today column indicator in planning table */
.is-today-col {
    background: rgba(255, 0, 0, 0.08) !important;
    border-left: 3px solid var(--primary) !important;
}

.planning-table th.is-today-col {
    background: var(--primary) !important;
    color: white !important;
}

.today-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--secondary);
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

[data-theme="dark"] .is-today-col {
    background: rgba(255, 0, 0, 0.15) !important;
}

.function-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--error);
}

/* Day Summary Grid */
.day-summary-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.day-summary-card {
    background: #F8F9FA;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    border: 2px solid transparent;
}

.day-summary-card.ok {
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.05);
}

.day-summary-card.under {
    border-color: var(--error);
    background: rgba(244, 67, 54, 0.05);
}

.day-summary-card.over {
    border-color: var(--warning);
    background: rgba(255, 167, 38, 0.05);
}

.day-summary-card .day-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.day-summary-card .day-hours {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.day-summary-card .day-budget {
    font-size: 12px;
    color: var(--text-secondary);
}

.day-summary-card .day-pct {
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0;
}

.day-summary-card.ok .day-pct {
    color: var(--success);
}

.day-summary-card.under .day-pct {
    color: var(--error);
}

.day-summary-card.over .day-pct {
    color: var(--warning);
}

.day-summary-card .day-status {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.day-summary-card .day-shifts {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Today indicator for day summary cards */
.day-summary-card.is-today {
    border: 3px solid #FF0000;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.2);
    z-index: 2;
    position: relative;
}

.day-summary-card.is-today .today-badge {
    font-size: 8px;
    padding: 1px 4px;
    margin-left: 4px;
}

@media (max-width: 900px) {
    .day-summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .day-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   Print Styles (base - overridden by BETTER PRINT STYLES at bottom)
   =================================== */
/* Main print styles are at the bottom of the file */

/* ===================================
   Dark Mode Additional Styles
   =================================== */
[data-theme="dark"] .modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #2a2a2a;
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--focus-color);
    background: #333333;
}

[data-theme="dark"] .shift-card {
    background: #252525;
    border-color: var(--border-color);
}

[data-theme="dark"] .task-tag {
    background: #333333;
}

[data-theme="dark"] .stat-card {
    background: var(--bg-card);
}

[data-theme="dark"] .warning-card {
    background: rgba(255, 152, 0, 0.15);
}

[data-theme="dark"] .planning-table th {
    background: linear-gradient(135deg, #CC0000 0%, #005F8A 100%);
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .planning-table td {
    border-color: var(--border-color);
}

[data-theme="dark"] .planning-table td:first-child {
    background: var(--bg-card);
}

[data-theme="dark"] .planning-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

[data-theme="dark"] .day-column-header {
    background: linear-gradient(135deg, #005F8A 0%, #CC0000 100%);
}

[data-theme="dark"] .budget-calculator {
    background: var(--bg-card);
}

[data-theme="dark"] .toast {
    background: #1A2028;
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.06);
}

[data-theme="dark"] .logo-ah {
    display: none;
}

/* ===================================
   Shift Templates Styles
   =================================== */
.templates-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.templates-grid {
    display: grid;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.template-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    background: var(--bg-main);
    transition: var(--transition);
}

.template-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.1);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.template-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
}

.template-actions {
    display: flex;
    gap: 4px;
}

.template-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 8px 0;
}

.template-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.save-template-form {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}

.save-template-form h4 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.template-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

[data-theme="dark"] .template-card {
    background: var(--bg-main);
    border-color: var(--border-color);
}

[data-theme="dark"] .template-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.15);
}
/* ===================================
   MULTI-WEEK VIEW STYLES
   =================================== */

.multiweek-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px 0;
}

@media (max-width: 1400px) {
    .multiweek-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1100px) {
    .multiweek-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.week-summary-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.week-summary-card.current {
    border-color: #FF0000;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.05) 0%, rgba(255, 0, 0, 0.02) 100%);
}

.week-summary-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.week-summary-card.current h3 {
    color: #DD0000;
}

.week-summary-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.stat-row span {
    color: var(--text-secondary);
    font-size: 14px;
}

.stat-row strong {
    color: var(--text-primary);
    font-size: 16px;
}

.week-summary-card .badge {
    font-size: 11px;
    padding: 4px 8px;
    margin-top: 8px;
}

[data-theme="dark"] .week-summary-card {
    background: var(--bg-main);
}

[data-theme="dark"] .week-summary-card:hover {
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .multiweek-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Multi-Week Cards (mw-*) */
.mw-week-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.mw-week-card:hover {
    box-shadow: var(--shadow);
    border-color: #ccc;
}

.mw-week-card.mw-current {
    border-color: var(--primary);
    border-width: 2px;
    background: #f8fcff;
}

.mw-week-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.mw-week-num {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.mw-week-budget {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}

.mw-week-pct {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
}

.mw-week-pct.mw-ok    { background: #d4edda; color: #155724; }
.mw-week-pct.mw-over  { background: #fff3cd; color: #856404; }
.mw-week-pct.mw-under { background: #f8d7da; color: #721c24; }

.mw-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.mw-day {
    text-align: center;
    padding: 6px 2px;
    border-radius: 4px;
    background: #fafafa;
}

.mw-day-other {
    opacity: 0.4;
}

.mw-day-name {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.mw-day-date {
    display: block;
    font-size: 10px;
    color: var(--text-light);
    margin-bottom: 3px;
}

.mw-day-hours {
    display: block;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.mw-day-hours.mw-ok    { color: #15803d; }
.mw-day-hours.mw-over  { color: #d97706; }
.mw-day-hours.mw-under { color: #dc2626; }

.mw-day-budget {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
}

.mw-current-label {
    margin-top: 8px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Dark mode */
[data-theme="dark"] .mw-week-card {
    background: var(--bg-card);
}

[data-theme="dark"] .mw-week-card.mw-current {
    background: rgba(255,0,0,0.05);
}

[data-theme="dark"] .mw-day {
    background: rgba(255,255,255,0.03);
}

/* ==========================================
   COPY/PASTE & SELECTION STYLES
   ========================================== */

/* Selected shift state */
.shift-card.selected {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    background: rgba(255, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.shift-card.selected::before {
    content: 'check_circle';
    font-family: 'Material Icons';
    position: absolute;
    top: 4px;
    right: 4px;
    color: var(--primary);
    background: white;
    border-radius: 50%;
    font-size: 20px;
    z-index: 10;
}

[data-theme="dark"] .shift-card.selected::before {
    background: var(--bg-card);
}

/* Make shift cards clickable for selection */
.shift-card {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
}

.shift-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Toolbar indicators */
.toolbar-indicators {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.selection-indicator,
.clipboard-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 2px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.selection-indicator {
    border-color: var(--primary);
    background: var(--primary-light);
}

.clipboard-indicator {
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.selection-indicator .material-icons,
.clipboard-indicator .material-icons {
    font-size: 20px;
    color: var(--primary);
}

.clipboard-indicator .material-icons {
    color: var(--success);
}

.selection-indicator .btn-icon,
.clipboard-indicator .btn-icon {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: background 0.2s;
}

.selection-indicator .btn-icon:hover,
.clipboard-indicator .btn-icon:hover {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .selection-indicator .btn-icon:hover,
[data-theme="dark"] .clipboard-indicator .btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Copy/Paste Toolbar */
.copy-paste-toolbar {
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.copy-paste-toolbar .material-icons {
    font-size: 18px;
    margin-right: 4px;
}

/* Paste target indicator */
.schedule-day.paste-target {
    outline: 3px dashed var(--success);
    outline-offset: 4px;
    background: rgba(76, 175, 80, 0.05);
}

.schedule-day.paste-target::after {
    content: 'Klik om te plakken';
    display: block;
    text-align: center;
    padding: 8px;
    background: var(--success);
    color: white;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 13px;
    font-weight: 500;
}

/* Dark mode adjustments */
[data-theme="dark"] .selection-indicator {
    background: rgba(255, 0, 0, 0.12);
}

[data-theme="dark"] .clipboard-indicator {
    background: rgba(76, 175, 80, 0.15);
}

[data-theme="dark"] .copy-paste-toolbar {
    background: var(--bg-secondary);
}

[data-theme="dark"] .shift-card.selected {
    background: rgba(255, 0, 0, 0.15);
}

/* Animations */
@keyframes pulse-select {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.shift-card.just-selected {
    animation: pulse-select 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .copy-paste-toolbar {
        flex-direction: column;
    }

    .copy-paste-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .toolbar-indicators {
        flex-direction: column;
    }
}

/* ==========================================
   TIMELINE VIEW (30-MINUTE INTERVALS)
   ========================================== */

.timeline-container {
    overflow-x: auto;
    padding: 16px 0;
}

.timeline-day-section {
    margin-bottom: 32px;
}

.timeline-day-header {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    letter-spacing: -0.02em;
}

.timeline-grid {
    min-width: 900px;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
}

.timeline-header {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.timeline-employee-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    padding: 8px;
}

.timeline-hours {
    display: grid;
    grid-template-columns: repeat(28, 1fr); /* 14 hours * 2 (30-min intervals) */
    gap: 1px;
    position: relative;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.timeline-hour-marker {
    background: var(--bg-secondary);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    border-right: 1px solid var(--border);
    grid-column: span 2; /* Each hour spans 2 intervals */
}

.timeline-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px;
    margin-bottom: 4px;
    min-height: 48px;
}

.timeline-employee-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.timeline-function {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

.timeline-shift {
    background: var(--primary);
    border-radius: 4px;
    padding: 4px 8px;
    color: white;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.timeline-shift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.timeline-shift-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-time {
    font-weight: 600;
    font-size: 12px;
}

.timeline-tasks {
    font-size: 10px;
    opacity: 0.9;
}

/* Legend */
.timeline-legend .legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Dark mode */
[data-theme="dark"] .timeline-grid {
    background: var(--bg-secondary);
}

[data-theme="dark"] .timeline-hour-marker {
    background: var(--bg);
}

[data-theme="dark"] .timeline-employee-name {
    background: var(--bg);
}

/* Responsive */
@media (max-width: 768px) {
    .timeline-grid {
        min-width: 100%;
    }

    .timeline-row {
        grid-template-columns: 120px 1fr;
    }

    .timeline-header {
        grid-template-columns: 120px 1fr;
    }

    .timeline-employee-label {
        font-size: 12px;
    }

    .timeline-employee-name {
        font-size: 12px;
    }

    .timeline-hour-marker {
        font-size: 9px;
        padding: 2px 4px;
    }

    .timeline-shift {
        font-size: 9px;
        padding: 2px 4px;
    }

    .timeline-time {
        font-size: 10px;
    }

    .timeline-tasks {
        font-size: 8px;
    }
}

@media print {
    .timeline-container {
        overflow-x: visible;
    }

    .timeline-grid {
        min-width: 100%;
        break-inside: avoid;
    }

    .timeline-day-section {
        break-inside: avoid;
    }
}

/* Excel View Styles */
.excel-view-container {
    overflow-x: auto;
    margin-top: 20px;
}

.excel-grid {
    display: table;
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.excel-grid-header {
    display: table-row;
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    color: white;
    font-weight: 600;
}

.excel-grid-body {
    display: table-row-group;
}

.excel-row {
    display: table-row;
}

.excel-row:nth-child(odd) {
    background: var(--bg-card);
}

.excel-row:nth-child(even) {
    background: var(--bg-main);
}

.excel-row:hover {
    background: rgba(255, 0, 0, 0.06);
}

.excel-cell {
    display: table-cell;
    padding: 8px 4px;
    border: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
    font-size: 11px;
    min-width: 35px;
}

.excel-employee-cell {
    position: sticky;
    left: 0;
    background: var(--bg-main);
    font-weight: 600;
    text-align: left;
    padding: 8px 12px;
    min-width: 150px;
    max-width: 150px;
    z-index: 2;
    border-right: 2px solid var(--border-color);
}

.excel-grid-header .excel-employee-cell {
    background: var(--primary);
    color: white;
    z-index: 3;
}

.excel-time-cell {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 2px;
    min-width: 35px;
    max-width: 35px;
}

.excel-shift-cell {
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.excel-shift-cell:hover {
    opacity: 0.8;
}

.excel-overlap-row {
    background: var(--bg-main) !important;
    border-top: 2px solid var(--primary);
    font-weight: 600;
}

.excel-overlap-cell {
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.excel-legend {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
}

.excel-legend h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Dark mode support */
[data-theme="dark"] .excel-grid {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .excel-employee-cell {
    background: var(--bg-main);
}

[data-theme="dark"] .excel-grid-header .excel-employee-cell {
    background: var(--primary);
}

[data-theme="dark"] .excel-row:nth-child(odd) {
    background: var(--bg-card);
}

[data-theme="dark"] .excel-row:nth-child(even) {
    background: var(--bg-main);
}

[data-theme="dark"] .excel-legend {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* Excel Week View (compact table) */
.excel-week-grid {
    overflow-x: auto;
}

.excel-week-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: 'DM Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.excel-week-table th,
.excel-week-table td {
    border: 1px solid var(--border);
    padding: 8px 6px;
    text-align: center;
    vertical-align: middle;
}

.excel-week-table th {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

.excel-week-table .employee-col {
    text-align: left;
    min-width: 120px;
    white-space: nowrap;
}

.excel-week-table .shift-cell {
    font-weight: 600;
    font-size: 11px;
    min-width: 90px;
    line-height: 1.3;
}

.excel-week-table .shift-cell small {
    font-size: 9px;
    opacity: 0.9;
}

.excel-week-table .empty-cell {
    background: #fafafa;
    color: #999;
}

.excel-week-table .total-cell {
    background: #e8f5e9;
    font-weight: 700;
}

.excel-week-table .totals-row td {
    background: #f5f5f5;
    font-weight: 600;
}

.excel-week-table .totals-row .total-cell {
    background: #c8e6c9;
}

[data-theme="dark"] .excel-week-table th {
    background: var(--primary-dark);
}

[data-theme="dark"] .excel-week-table td {
    border-color: var(--border);
}

[data-theme="dark"] .excel-week-table .empty-cell {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

[data-theme="dark"] .excel-week-table .total-cell {
    background: rgba(76, 175, 80, 0.2);
}

[data-theme="dark"] .excel-week-table .totals-row td {
    background: var(--bg-secondary);
}

/* Print styles for Excel view */
@media print {
    .excel-view-container {
        overflow-x: visible;
    }

    .excel-grid {
        min-width: 100%;
        page-break-inside: avoid;
    }

    .excel-employee-cell {
        position: static;
    }

    .excel-shift-cell {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .excel-legend {
        page-break-before: avoid;
    }

    /* Hide controls in print */
    #planningViewMode,
    #planningDaySelect,
    #planningIntervalSelect {
        display: none;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .excel-cell {
        min-width: 30px;
        padding: 6px 2px;
        font-size: 10px;
    }

    .excel-time-cell {
        font-size: 9px;
    }

    .excel-employee-cell {
        min-width: 120px;
        max-width: 120px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .excel-grid {
        min-width: 100%;
        font-size: 9px;
    }

    .excel-cell {
        min-width: 25px;
        padding: 4px 2px;
    }

    .excel-employee-cell {
        min-width: 100px;
        max-width: 100px;
        font-size: 10px;
    }

    .excel-time-cell {
        font-size: 8px;
    }
}

/* ===================================
   LEAVE REQUEST STYLES
   =================================== */

.leave-requests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

.leave-request-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.leave-request-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.leave-request-card.pending {
    border-left: 4px solid var(--warning);
}

.leave-request-card.success {
    border-left: 4px solid var(--success);
}

.leave-request-card.danger {
    border-left: 4px solid var(--danger);
}

/* Decision banner shown to employees after manager approval/rejection */
.leave-decision-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 14px;
}

.leave-decision-banner .material-icons {
    font-size: 22px;
    flex-shrink: 0;
}

.leave-decision-banner small {
    font-size: 12px;
    opacity: 0.85;
}

.leave-decision-approved {
    background: rgba(76, 175, 80, 0.12);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.35);
}

.leave-decision-rejected {
    background: rgba(244, 67, 54, 0.10);
    color: #c62828;
    border: 1px solid rgba(244, 67, 54, 0.30);
}

.leave-request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.leave-request-header strong {
    font-size: 14px;
    color: var(--text);
}

.leave-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
    text-transform: capitalize;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.status-success {
    background: var(--success);
    color: white;
}

.status-badge.status-danger {
    background: var(--danger);
    color: white;
}

.status-badge.status-warning {
    background: var(--warning);
    color: white;
}

.leave-request-body {
    margin-bottom: 12px;
}

.leave-request-body p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text);
}

.leave-request-body em {
    color: var(--text-muted);
    font-style: italic;
}

.leave-request-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.leave-calendar-item {
    display: grid;
    grid-template-columns: 200px 1fr 120px;
    gap: 16px;
    align-items: center;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
}

.leave-calendar-employee {
    font-weight: 600;
    color: var(--text);
}

.leave-calendar-dates {
    color: var(--text-muted);
    font-size: 14px;
}

.leave-calendar-type {
    text-align: right;
    text-transform: capitalize;
    color: var(--primary);
    font-weight: 500;
}

/* Dark mode */
[data-theme="dark"] .leave-request-card {
    background: var(--bg);
    border-color: var(--border);
}

[data-theme="dark"] .leave-type-badge {
    background: var(--bg-secondary);
}

[data-theme="dark"] .leave-calendar-item {
    background: var(--bg);
    border-color: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .leave-requests-grid {
        grid-template-columns: 1fr;
    }

    .leave-calendar-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .leave-calendar-type {
        text-align: left;
    }

    .leave-request-actions {
        flex-direction: column;
    }

    .leave-request-actions .btn {
        width: 100%;
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100000;
}

.skip-link:focus {
    top: 0;
}

/* Enhanced focus states for keyboard navigation */
*:focus {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* Focus visible (only keyboard, not mouse) */
*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border: #000;
        --text: #000;
        --bg: #fff;
    }

    [data-theme="dark"] {
        --border: #fff;
        --text: #fff;
        --bg: #000;
    }

    button,
    .btn {
        border: 2px solid currentColor;
    }
}

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

/* ===================================
   INPUT VALIDATION STYLES
   =================================== */

.input-error {
    border-color: var(--danger) !important;
    background-color: #ffebee;
}

[data-theme="dark"] .input-error {
    background-color: rgba(244, 67, 54, 0.1);
}

.input-valid {
    border-color: var(--success) !important;
}

.input-error:focus {
    outline-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2);
}

.input-valid:focus {
    outline-color: var(--success);
}

/* Error message styling */
.error-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.error-message .material-icons {
    font-size: 16px;
}

/* Required field indicator */
.form-group label.required::after {
    content: " *";
    color: var(--danger);
}
span.required {
    color: var(--danger);
    font-weight: 600;
}

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */

/* GPU acceleration for animations */
.toast,
.modal,
.nav-item {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Sidebar uses position:fixed — no extra transform needed (already a compositing layer).
   Adding transform:translateZ(0) on a fixed element breaks fixed positioning in Chrome/Safari. */
.sidebar {
    backface-visibility: hidden;
}

/* Smooth scrolling with performance */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Optimize repaints */
.card,
.shift-card,
.stat-card {
    contain: layout style paint;
}

/* ===================================
   LOADING STATES
   =================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

/* ===================================
   IMPROVED TOOLTIPS
   =================================== */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10000;
}

[data-tooltip]::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

[data-tooltip]:hover::before {
    transform: translateX(-50%) translateY(-4px);
}

/* ===================================
   BETTER PRINT STYLES - LANDSCAPE 1 PAGE
   =================================== */

@media print {
    /* Force landscape A4 - fits schedule on 1 page */
    @page {
        size: A4 landscape;
        margin: 5mm;
    }

    /* Reset everything */
    html, body {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: white !important;
    }

    /* Hide EVERYTHING except the schedule table */
    .sidebar,
    .header,
    .page-actions,
    .btn,
    button,
    .nav-menu,
    .toast,
    .modal,
    .week-selector,
    .user-menu,
    .undo-redo-buttons,
    #darkModeToggle,
    .skip-link,
    .page-header,
    .page-header .btn,
    .card-header,
    .card-header .btn,
    #planningViewMode,
    #planningDaySelect,
    #planningIntervalSelect,
    .view-toggle,
    .filter-section,
    .stats-grid,
    .stat-card,
    .tips-banner,
    .budget-calculator,
    .login-container,
    .copy-paste-toolbar,
    .action-bar,
    #loginPage,
    .subtitle,
    .quick-actions,
    .filter-btn,
    .search-container,
    h1,
    h2:not(.print-title) {
        display: none !important;
    }

    /* Main content full width */
    .main-content {
        margin: 0 !important;
        padding: 2mm !important;
        width: 100% !important;
        max-width: none !important;
    }

    .page {
        display: block !important;
        padding: 0 !important;
    }

    /* Cards minimal */
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        margin: 0 !important;
        padding: 2mm !important;
        break-inside: avoid;
    }

    /* Schedule table - COMPACT to fit 1 page */
    .planning-table,
    .schedule-table,
    table {
        width: 100% !important;
        font-size: 7px !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }

    .planning-table th,
    .planning-table td,
    .schedule-table th,
    .schedule-table td,
    table th,
    table td {
        padding: 1px 2px !important;
        font-size: 7px !important;
        line-height: 1.1 !important;
        vertical-align: top !important;
        border: 1px solid #ccc !important;
    }

    .planning-table th,
    .schedule-table th {
        background: #459BD7 !important;
        color: white !important;
        font-weight: bold !important;
    }

    /* Shift cards ultra compact */
    .shift-card {
        padding: 1px !important;
        margin: 1px 0 !important;
        font-size: 6px !important;
        min-height: auto !important;
        line-height: 1 !important;
        border-radius: 2px !important;
    }

    .shift-card .shift-time,
    .shift-time {
        font-size: 6px !important;
        font-weight: bold !important;
    }

    .shift-card .task-tag,
    .task-tag {
        font-size: 5px !important;
        padding: 0 1px !important;
        margin: 0 !important;
    }

    .shift-card .shift-actions,
    .shift-actions {
        display: none !important;
    }

    /* Page header compact */
    .page-header {
        margin: 0 0 2mm 0 !important;
        padding: 0 !important;
    }

    .page-header h1 {
        font-size: 12px !important;
        margin: 0 !important;
    }

    /* Employee column */
    .employee-cell,
    td:first-child,
    th:first-child {
        font-size: 7px !important;
        white-space: nowrap !important;
    }

    /* Ensure colors print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* No page breaks inside schedule */
    .planning-table,
    .schedule-table,
    .card,
    table {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Excel view compact - CRITICAL FOR 1 PAGE */
    .excel-view-container {
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .excel-grid {
        font-size: 5px !important;
        min-width: 100% !important;
        width: 100% !important;
        table-layout: fixed !important;
        display: table !important;
    }

    .excel-grid-header,
    .excel-grid-body,
    .excel-row {
        display: table-row !important;
    }

    .excel-cell {
        padding: 1px !important;
        font-size: 5px !important;
        min-width: 8px !important;
        max-width: 20px !important;
        display: table-cell !important;
        overflow: hidden !important;
        text-overflow: clip !important;
        white-space: nowrap !important;
    }

    .excel-employee-cell {
        min-width: 50px !important;
        max-width: 70px !important;
        font-size: 6px !important;
        position: static !important;
    }

    .excel-time-cell {
        font-size: 4px !important;
        padding: 0 !important;
    }

    .excel-shift-cell {
        font-size: 4px !important;
    }

    .excel-legend {
        display: none !important;
    }

    /* Schedule grid - fit on 1 page */
    .schedule-grid {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 2px !important;
        min-width: unset !important;
        width: 100% !important;
    }

    .schedule-day {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        min-width: 0 !important;
    }

    .schedule-day-header {
        padding: 2px 4px !important;
        font-size: 8px !important;
    }

    .schedule-day-header h3 {
        font-size: 8px !important;
        margin: 0 !important;
    }

    .schedule-day-content {
        padding: 2px !important;
        min-height: 0 !important;
    }

    .shift-employee {
        font-size: 7px !important;
    }

    /* Hide ALL pages except active one */
    .page {
        display: none !important;
    }

    .page.active {
        display: block !important;
    }

    /* Hide non-essential cards */
    .dashboard-grid,
    .multiweek-grid,
    .employees-grid,
    .settings-grid {
        display: none !important;
    }

    /* Week overview in planning page - hide it for Excel print */
    #weekOverviewContainer {
        display: none !important;
    }

    /* Show only Excel container */
    #excelContainer {
        display: block !important;
    }

    /* Timeline hide */
    #timelineContainer {
        display: none !important;
    }
}

/* ===================================
   EMPLOYEE READONLY STYLES
   =================================== */

.shift-card.readonly {
    cursor: default;
}

.shift-card.readonly:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empty-day.no-click {
    cursor: default;
    opacity: 0.6;
}

.empty-day.no-click:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* ===================================
   TIPS BANNER STYLES
   =================================== */

.tips-banner {
    background: linear-gradient(135deg, #E6F7FD 0%, #CCF0FB 100%);
    border: 1px solid #99E1F7;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

[data-theme="dark"] .tips-banner {
    background: linear-gradient(135deg, #0A1925 0%, #0F2535 100%);
    border-color: #164060;
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.tips-header:hover {
    background: rgba(255,255,255,0.3);
}

.tips-header .material-icons:first-child {
    color: #FFC107;
    font-size: 24px;
}

.tips-header strong {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
}

.tips-toggle {
    transition: transform 0.3s;
    color: var(--text-secondary);
}

.tips-banner.collapsed .tips-toggle {
    transform: rotate(-90deg);
}

.tips-banner.collapsed .tips-content {
    display: none;
}

.tips-content {
    padding: 0 20px 20px 20px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

[data-theme="dark"] .tips-content {
    border-top-color: rgba(255,255,255,0.1);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.tip-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
}

[data-theme="dark"] .tip-item {
    background: rgba(0,0,0,0.2);
}

.tip-item .material-icons {
    color: var(--primary);
    font-size: 28px;
    flex-shrink: 0;
}

.tip-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.tip-item p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.tips-workflow {
    margin-top: 20px;
    padding: 16px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

[data-theme="dark"] .tips-workflow {
    background: rgba(0,0,0,0.3);
}

.tips-workflow strong {
    display: block;
    margin-bottom: 10px;
    color: var(--primary);
}

.tips-workflow ol {
    margin: 0;
    padding-left: 20px;
}

.tips-workflow li {
    margin-bottom: 6px;
    color: var(--text-primary);
}

.tips-workflow em {
    color: var(--primary);
    font-style: normal;
    font-weight: 500;
}

@media print {
    .tips-banner {
        display: none !important;
    }
}

/* ===================================
   RESPONSIVE IMPROVEMENTS
   =================================== */

/* Better mobile menu */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Make tables scrollable */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Stack form groups on narrow screens */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group {
        width: 100% !important;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

/* ===================================
   DARK MODE IMPROVEMENTS
   =================================== */

[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] .input-error {
    background-color: rgba(244, 67, 54, 0.15);
}

[data-theme="dark"] [data-tooltip]::before {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
}

[data-theme="dark"] [data-tooltip]::after {
    border-top-color: rgba(255, 255, 255, 0.95);
}

/* ===================================
   UTILITY CLASSES
   =================================== */

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

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ===================================
   NOTIFICATION BADGE
   =================================== */

.notification-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    background: #F44336;
    border-radius: 10px;
    margin-left: 8px;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.nav-item {
    position: relative;
}

.nav-item .notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* ===================================
   MOBILE OPTIMIZATIONS - PRODUCTION READY
   =================================== */

@media (max-width: 768px) {
    /* HEADER - Compact and functional */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        padding: 8px 12px;
        height: auto;
        min-height: 56px;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
    }

    .header-left {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }

    .header-center {
        display: none !important; /* Hide store name on mobile */
    }

    .header-right {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
    }

    .logo-text { display: none; }
    .logo-img { height: 26px; }

    .week-selector {
        padding: 4px 6px;
        background: var(--bg-hover);
        border-radius: 6px;
    }

    #weekDisplay {
        font-size: 11px;
        white-space: nowrap;
    }

    .user-menu {
        padding: 4px 8px;
    }

    .user-menu span:not(.material-icons) { display: none; }

    .undo-redo-buttons { display: none; } /* Hide on mobile */

    .btn-icon {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
    }

    .btn-icon .material-icons {
        font-size: 20px;
    }

    /* SIDEBAR - Full screen overlay */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 300px;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        padding-top: 20px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0,0,0,0.4);
    }

    /* Sidebar overlay backdrop */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
        animation: fadeIn 0.3s ease;
    }

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

    .nav-item {
        padding: 18px 24px;
        min-height: 56px;
        font-size: 16px;
    }

    .nav-item .material-icons,
    .nav-item i[class^="ph"] {
        font-size: 24px;
        margin-right: 16px;
    }

    /* MAIN CONTENT - Account for fixed header */
    .main-content {
        margin-left: 0 !important;
        margin-top: 56px !important;
        padding: 12px;
        min-height: calc(100vh - 56px);
    }

    /* PAGE HEADER */
    .page-header {
        margin-bottom: 16px;
        padding: 0;
    }

    .page-header h1 {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .subtitle {
        font-size: 12px;
    }

    /* STATS GRID */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
        border-radius: 8px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon .material-icons {
        font-size: 18px;
    }

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

    .stat-label {
        font-size: 10px;
    }

    /* CARDS */
    .card {
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .card-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-header h2 {
        font-size: 16px;
        flex: 1 0 100%;
    }

    .card-content {
        padding: 12px 16px;
    }

    /* EXCEL/PLANNING TABLE - CRITICAL */
    .excel-view-container,
    .table-container {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px 12px;
        scrollbar-width: thin;
        scrollbar-color: var(--border-color) transparent;
    }

    .excel-view-container::-webkit-scrollbar,
    .planning-table-container::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    .excel-view-container::-webkit-scrollbar-track,
    .planning-table-container::-webkit-scrollbar-track {
        background: transparent;
    }
    .excel-view-container::-webkit-scrollbar-thumb,
    .planning-table-container::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }

    /* SCHEDULE CONTAINER - COMPACT VERTICAL STACK */
    .schedule-container {
        overflow-x: visible;
        overflow-y: visible;
        margin: 0;
        padding: 0;
    }

    /* Scroll indicator shadow */
    .excel-view-container::after,
    .table-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, var(--bg-main) 0%, transparent 100%);
        pointer-events: none;
        opacity: 0.8;
    }

    .excel-grid {
        min-width: 900px;
        font-size: 11px;
    }

    .excel-row {
        min-height: 40px;
    }

    .excel-cell {
        min-width: 40px;
        padding: 6px 4px;
        font-size: 10px;
    }

    .excel-header-cell {
        font-size: 9px;
        font-weight: 600;
        padding: 8px 4px;
    }

    .excel-employee-cell {
        min-width: 100px;
        max-width: 100px;
        font-size: 11px;
        font-weight: 500;
        position: sticky;
        left: 0;
        z-index: 20;
        background: var(--bg-card);
        box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    }

    .planning-table {
        min-width: 800px;
    }

    .planning-table th,
    .planning-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    /* First column sticky */
    .planning-table th:first-child,
    .planning-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
        background: var(--bg-card);
        box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    }

    /* SHIFT CARDS */
    .shift-card {
        padding: 8px 10px;
        font-size: 12px;
        margin-bottom: 6px;
        border-radius: 6px;
    }

    .shift-time {
        font-size: 11px;
    }

    .task-tag, .task-chip {
        font-size: 9px;
        padding: 2px 6px;
    }

    /* =============================================
       MOBILE SCHEDULE - ULTRA COMPACT
       ============================================= */

    /* Schedule grid stacked on mobile */
    .schedule-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        min-width: unset !important;
    }

    /* Each day = tiny card */
    .schedule-day {
        min-width: 100%;
        margin-bottom: 0;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-xs);
        overflow: hidden;
    }

    /* Day header - SUPER COMPACT */
    .schedule-day-header {
        padding: 6px 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
    }

    .schedule-day-header h3 {
        font-size: 11px;
        font-weight: 600;
        margin: 0;
    }

    .schedule-day-header .day-date {
        font-size: 9px;
        opacity: 0.85;
    }

    .schedule-day-header .hours-badge {
        padding: 2px 6px;
        font-size: 9px;
        border-radius: var(--radius-full);
        background: rgba(255,255,255,0.25);
    }

    /* Day content - MINIMAL PADDING */
    .schedule-day-content {
        padding: 4px !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    /* SHIFT CARDS - ULTRA COMPACT */
    .shift-card {
        padding: 5px 8px !important;
        margin-bottom: 3px !important;
        font-size: 10px !important;
        border-radius: var(--radius-sm) !important;
        box-shadow: none !important;
        border: 1px solid var(--border-color);
    }

    .shift-card:last-child {
        margin-bottom: 0 !important;
    }

    .shift-card-header {
        margin-bottom: 1px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .shift-employee {
        font-size: 10px !important;
        font-weight: 600;
        line-height: 1.2;
    }

    .shift-function {
        font-size: 8px !important;
        opacity: 0.7;
        display: none; /* Hide on mobile to save space */
    }

    .shift-time {
        font-size: 9px !important;
        margin-bottom: 0 !important;
        display: flex;
        align-items: center;
        gap: 2px;
        color: var(--text-secondary);
    }

    .shift-time .material-icons {
        font-size: 10px !important;
    }

    .shift-break {
        font-size: 8px !important;
        margin-bottom: 0 !important;
        display: none; /* Hide break on mobile */
    }

    .shift-tasks {
        margin-top: 2px;
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
    }

    .task-chip, .task-tag {
        font-size: 7px !important;
        padding: 1px 4px !important;
        margin: 0 !important;
        border-radius: 2px !important;
        line-height: 1.3;
    }

    .shift-notes {
        font-size: 8px !important;
        margin-top: 2px;
        color: var(--text-light);
        display: none; /* Hide notes on mobile */
    }

    .shift-actions {
        display: none !important; /* Hide edit/delete on mobile */
    }

    /* EMPTY DAY - MINIMAL */
    .empty-day {
        padding: 8px !important;
        min-height: 0 !important;
    }

    .empty-day .material-icons {
        font-size: 16px !important;
    }

    .empty-day p {
        font-size: 9px !important;
        margin: 2px 0 0 0 !important;
    }

    /* ADD SHIFT BUTTON - SMALL */
    .schedule-day-content .btn-small,
    .schedule-day-content .btn-secondary,
    .schedule-day-content .btn {
        padding: 4px 8px !important;
        font-size: 9px !important;
        min-height: 26px !important;
        gap: 4px;
    }

    .schedule-day-content .btn .material-icons,
    .schedule-day-content .btn-small .material-icons {
        font-size: 12px !important;
    }

    /* FORMS */
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-group {
        width: 100% !important;
        margin-bottom: 0;
    }

    label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    input, select, textarea {
        font-size: 16px !important; /* Prevent iOS zoom */
        padding: 14px 12px;
        border-radius: 8px;
    }

    /* BUTTONS */
    .btn {
        padding: 14px 18px;
        font-size: 14px;
        min-height: 48px;
        border-radius: 8px;
    }

    .btn-small {
        padding: 10px 14px;
        min-height: 40px;
        font-size: 12px;
    }

    .page-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-actions .btn {
        flex: 1 1 auto;
        min-width: 120px;
    }

    /* MODALS - Full screen */
    .modal {
        padding: 0;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .modal-header {
        padding: 16px;
        flex-shrink: 0;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        padding: 16px;
        flex-shrink: 0;
        border-top: 1px solid var(--border-color);
    }

    /* DAY SUMMARY */
    .day-summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .day-summary-card {
        padding: 12px;
    }

    .day-summary-card h4 {
        font-size: 12px;
    }

    /* LEAVE REQUESTS */
    .leave-requests-grid {
        grid-template-columns: 1fr;
    }

    .leave-request-card {
        padding: 14px;
    }

    /* BUDGET */
    .budget-calculator .card-content {
        padding: 12px;
    }

    /* TABLES GENERAL */
    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px 8px;
    }

    /* TOAST on mobile */
    .toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        transform: none;
        max-width: none;
    }

    /* Hide swipe hint after scroll */
    .has-scrolled .excel-view-container::before,
    .has-scrolled .table-container::before {
        display: none;
    }
}

/* Extra small screens (< 480px) - ULTRA COMPACT */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .stat-card {
        padding: 10px;
    }

    .day-summary-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .day-summary-card {
        padding: 8px;
    }

    .excel-employee-cell {
        min-width: 80px;
        max-width: 80px;
        font-size: 10px;
    }

    .excel-cell {
        min-width: 35px;
        font-size: 9px;
    }

    .week-selector {
        padding: 2px 4px;
    }

    #weekDisplay {
        font-size: 10px;
    }

    .page-header h1 {
        font-size: 18px;
    }

    /* Schedule EXTRA compact on tiny screens */
    .schedule-grid {
        gap: 3px !important;
    }

    .schedule-day {
        border-radius: var(--radius-sm);
    }

    .schedule-day-header {
        padding: 4px 8px;
    }

    .schedule-day-header h3 {
        font-size: 10px;
    }

    .schedule-day-content {
        padding: 3px !important;
    }

    .shift-card {
        padding: 4px 6px !important;
        margin-bottom: 2px !important;
    }

    .shift-employee {
        font-size: 9px !important;
    }

    .shift-time {
        font-size: 8px !important;
    }

    .task-chip, .task-tag {
        font-size: 6px !important;
        padding: 0 3px !important;
    }

    .empty-day {
        padding: 6px !important;
    }

    .empty-day .material-icons {
        font-size: 14px !important;
    }

    .empty-day p {
        font-size: 8px !important;
    }

    .schedule-day-content .btn,
    .schedule-day-content .btn-small {
        padding: 3px 6px !important;
        font-size: 8px !important;
        min-height: 22px !important;
    }

    .schedule-day-content .btn .material-icons {
        font-size: 10px !important;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        min-height: 48px;
        padding: 4px 12px;
    }

    .main-content {
        margin-top: 48px !important;
    }

    .sidebar {
        width: 50%;
    }

    .modal-content {
        /* Modal fullscreen on mobile */
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .modal-header, .modal-footer { padding: 16px; }
    .modal-body { padding: 16px; max-height: calc(100vh - 140px); overflow-y: auto; }

    /* Day summary */
    .day-summary-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .day-summary-card { padding: 10px; }

    /* Page header */
    .page-header { margin-bottom: 16px; }
    .page-header h1 { font-size: 20px; }

    /* Swipe hint for tables */
    .excel-view-container::before,
    .table-container::before {
        content: '← Swipe voor meer →';
        display: block;
        text-align: center;
        font-size: 11px;
        color: var(--text-secondary);
        padding: 8px;
        background: var(--bg-card);
        margin-bottom: 8px;
        border-radius: 4px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .day-summary-grid { grid-template-columns: 1fr; }
    .header-center { display: none; }
    .excel-cell { min-width: 30px; font-size: 8px; }
    .excel-employee-cell { min-width: 60px; font-size: 9px; }
}

/* ===================================
   PRINT HEADER FOR SCHEDULE
   =================================== */

.print-header { display: none; }

@media print {
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 10px;
        padding-bottom: 5px;
        border-bottom: 2px solid #459BD7;
    }

    .print-header h2 {
        display: block !important;
        font-size: 14px !important;
        margin: 0 !important;
        color: #333 !important;
    }

    .print-header .print-date {
        font-size: 10px;
        color: #666;
        margin-top: 2px;
    }
}

/* ===================================
   BUDGET & OMZET PAGE STYLES (UNIFIED)
   =================================== */

/* Header title row with week navigation */
.header-title-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-title-row h1 {
    margin: 0;
}

.week-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-main);
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.week-nav .week-display {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 120px;
    text-align: center;
}

.week-nav .btn-icon {
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.week-nav .btn-icon:hover {
    background: var(--bg-card);
    color: var(--primary);
}

/* Budget stats grid at top */
.budget-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

/* Header hint text */
.header-hint {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: normal;
}

/* Simple budget table */
.budget-simple-table {
    width: 100%;
}

.budget-simple-table .budget-input {
    width: 100px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    background: var(--bg-main);
}

.budget-simple-table .budget-input:focus {
    outline: none;
    border-color: var(--focus-color);
    box-shadow: var(--shadow-focus);
}

.budget-simple-table .today-row {
    background: rgba(255, 0, 0, 0.06);
}

.budget-simple-table .today-row td {
    font-weight: 600;
}

.budget-simple-table .totals-row {
    background: var(--bg-main);
    border-top: 2px solid var(--border-color);
}

.budget-simple-table .totals-row td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.budget-simple-table .status-cell {
    text-align: center;
}

.budget-simple-table .status-cell .material-icons {
    font-size: 20px;
    vertical-align: middle;
}

.budget-simple-table .status-ok .material-icons { color: var(--success); }
.budget-simple-table .status-over .material-icons { color: var(--warning); }
.budget-simple-table .status-under .material-icons { color: var(--error); }

.budget-simple-table .status-cell.ok { color: var(--success); }
.budget-simple-table .status-cell.over { color: var(--warning); }
.budget-simple-table .status-cell.under { color: var(--error); }

/* Daily budget cards grid - legacy */
.daily-budget-cards {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.daily-budget-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    padding: 14px;
    transition: var(--transition);
}

.daily-budget-card:hover {
    box-shadow: var(--shadow-md);
}

.daily-budget-card.today {
    border-color: #FF0000;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.15);
}

.daily-budget-card.past {
    opacity: 0.7;
}

.daily-budget-card.ok {
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.03);
}

.daily-budget-card.under {
    border-color: var(--error);
    background: rgba(244, 67, 54, 0.03);
}

.daily-budget-card.over {
    border-color: var(--warning);
    background: rgba(255, 152, 0, 0.03);
}

.daily-budget-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    min-width: 0; /* Allow flex shrinking */
}

.daily-budget-header .day-info {
    min-width: 0;
    overflow: hidden;
}

.daily-budget-header .day-info h4 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.daily-budget-header .day-info h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px 0;
    color: var(--text-primary);
}

.daily-budget-header .day-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.daily-budget-header .event-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--warning), #ff9800);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Compact input row */
.daily-budget-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.input-group.compact {
    flex: 1;
    position: relative;
}

.input-group.compact .input-prefix {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    z-index: 1;
}

.input-group.compact input {
    width: 100%;
    padding: 10px 10px 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-main);
}

.input-group.compact input:focus {
    border-color: var(--focus-color);
    outline: none;
    box-shadow: var(--shadow-focus);
}

.daily-multiplier-select.compact {
    width: 70px;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    cursor: pointer;
}

/* Mini stats in budget cards */
.daily-budget-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 10px;
}

.stat-mini {
    text-align: center;
}

.stat-mini .label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-mini .value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-mini.diff.ok .value { color: var(--success); }
.stat-mini.diff.under .value { color: var(--error); }
.stat-mini.diff.over .value { color: var(--warning); }

/* Budget table styling */
#budgetTable tbody tr.over td:last-child { color: var(--warning); font-weight: 600; }
#budgetTable tbody tr.under td:last-child { color: var(--error); font-weight: 600; }
#budgetTable tbody tr.totals-row {
    background: var(--bg-main);
    border-top: 2px solid var(--border-color);
}
#budgetTable tbody tr.totals-row td {
    padding-top: 12px;
    padding-bottom: 12px;
}

/* Task badge in budget table */
.task-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

/* Events compact list in budget page */
.events-compact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.events-compact-list .event-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.events-compact-list .event-item .material-icons {
    font-size: 18px;
    color: var(--warning);
}

.events-compact-list .empty-state {
    color: var(--text-secondary);
    font-style: italic;
    padding: 10px;
}

/* Collapsed tips by default */
.tips-banner.collapsed .tips-content {
    display: none;
}

.tips-banner.collapsed .tips-toggle {
    transform: rotate(0deg);
}

/* Legacy support */
.daily-budget-inputs {
    margin-bottom: 12px;
}

.daily-budget-inputs .form-group {
    margin-bottom: 10px;
}

.daily-budget-inputs .form-group label {
    font-size: 11px;
    margin-bottom: 4px;
}

.daily-budget-inputs input,
.daily-budget-inputs select {
    padding: 8px 10px;
    font-size: 13px;
}

.input-prefix {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-weight: 500;
}

.daily-budget-inputs .input-group {
    position: relative;
}

.daily-budget-inputs .input-group input {
    padding-left: 24px;
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }
    .sidebar,
    .header,
    .mobile-nav,
    .page-actions,
    .fab,
    .btn-icon,
    .btn:not(.no-print),
    #undoBtn,
    #redoBtn {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    /* Hide all pages; only the active page prints */
    .page {
        display: none !important;
        padding: 0 !important;
    }
    .page.active {
        display: block !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
    .schedule-table th,
    .schedule-table td {
        border: 1px solid #ccc !important;
        font-size: 10px !important;
    }
    .shift-block {
        border: 1px solid #999 !important;
        background: #f5f5f5 !important;
        color: black !important;
    }
}

.daily-budget-stats .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}

.daily-budget-stats .stat-row.ok strong { color: var(--success); }
.daily-budget-stats .stat-row.under strong { color: var(--error); }
.daily-budget-stats .stat-row.over strong { color: var(--warning); }

/* Events page styles */
.multiplier-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.multiplier-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    text-align: center;
}

.multiplier-card .material-icons {
    font-size: 32px;
}

.multiplier-card strong {
    font-size: 14px;
}

.multiplier-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.multiplier-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.badge-koopzondag { background: var(--warning); }
.badge-feestdag { background: var(--error); }
.badge-actieweek { background: var(--primary); }
.badge-inventaris { background: var(--info); }
.badge-custom { background: var(--text-secondary); }

/* Week events list */
.week-events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.week-event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
}

.week-event-item .event-day {
    font-weight: 600;
    color: var(--primary);
    min-width: 30px;
}

/* Vacation badge */
.vacation-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    border-radius: var(--radius-full);
    margin-left: 6px;
}

.week-event-item .event-name {
    flex: 1;
}

/* ===================================
   SICK CALL PAGE STYLES
   =================================== */

.sick-call-card {
    max-width: 500px;
    margin: 0 auto;
}

.sick-call-warning {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: rgba(244, 67, 54, 0.08);
    border: 1px solid var(--error);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.sick-call-warning .material-icons {
    font-size: 32px;
    color: var(--error);
    flex-shrink: 0;
}

.sick-call-warning strong {
    display: block;
    color: var(--error);
    margin-bottom: 4px;
    font-size: 16px;
}

.sick-call-warning p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.sick-call-info {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.sick-call-info h3 {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phone-number-large {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    padding: 16px 32px;
    background: rgba(255, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    letter-spacing: -0.02em;
}

.phone-number-large:hover {
    background: rgba(27, 106, 165, 0.12);
    transform: scale(1.02);
}

.phone-number-large .material-icons {
    font-size: 32px;
}

.call-instructions {
    margin: 16px 0 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.sick-call-checklist {
    padding: 20px;
    background: var(--bg-main);
    border-radius: var(--radius-lg);
}

.sick-call-checklist h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.sick-call-checklist ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sick-call-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.sick-call-checklist li .material-icons {
    font-size: 18px;
    color: var(--success);
}

/* Conflict warnings */
.conflicts-banner {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.conflicts-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--error);
}

.conflicts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conflict-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.conflict-item.error {
    border-left: 3px solid var(--error);
}

.conflict-item.warning {
    border-left: 3px solid var(--warning);
}

.conflict-item .material-icons {
    font-size: 18px;
}

.conflict-item.error .material-icons { color: var(--error); }
.conflict-item.warning .material-icons { color: var(--warning); }

/* Responsive budget page */
@media (max-width: 1400px) {
    .daily-budget-cards {
        grid-template-columns: repeat(4, 1fr);
    }
    .budget-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .daily-budget-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .daily-budget-cards {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .multiplier-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .daily-budget-cards {
        grid-template-columns: 1fr;
    }

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

    .multiplier-info-grid {
        grid-template-columns: 1fr;
    }

    .daily-budget-card {
        padding: 12px;
    }

    .daily-budget-input-row {
        flex-direction: column;
    }

    .daily-multiplier-select.compact {
        width: 100%;
    }
}

/* ===================================
   EMPLOYEE ACCOUNT SECTION
   =================================== */

.account-section {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
}

.account-section .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.account-section .section-title .material-icons {
    color: var(--primary);
    font-size: 20px;
}

.account-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.account-linked,
.account-not-linked {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.account-linked {
    border-color: #4CAF50;
    background: #E8F5E9;
}

.account-not-linked {
    border-color: #FF9800;
    background: #FFF3E0;
}

#empCreateAccountForm {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

#empCreateAccountForm .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

#empCreateAccountForm .form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

#empCreateAccountForm .btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ===================================
   LOONSOM BEGROTING
   =================================== */

.begroting-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.begroting-calc {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.begroting-calc-item {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    background: var(--neutral-50);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.begroting-calc-item .calc-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.begroting-calc-item .calc-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* KPI color classes */
.stat-card.kpi-green .stat-value { color: var(--success); }
.stat-card.kpi-orange .stat-value { color: var(--warning); }
.stat-card.kpi-red .stat-value { color: var(--error); }

.kpi-green-text { color: var(--success); font-weight: 600; }
.kpi-orange-text { color: var(--warning); font-weight: 600; }
.kpi-red-text { color: var(--error); font-weight: 600; }

/* Dark mode adjustments */
[data-theme="dark"] .begroting-calc-item {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

/* ===================================
   PRECISION COMMAND CENTER
   Design System Enhancement — Layer 2
   Depth, motion hierarchy & visual polish
   =================================== */

/* ─── Body — subtle dot grid texture ─── */
body {
    background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.025) 1px, transparent 0);
    background-size: 28px 28px;
    background-attachment: fixed;
}

[data-theme="dark"] body {
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.018) 1px, transparent 0);
    background-size: 28px 28px;
}

/* ─── Header — gradient accent at bottom ─── */
/* position: fixed already declared earlier — no override needed here */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 45%, transparent 100%);
    opacity: 0.55;
    pointer-events: none;
}

/* ─── Logo AnyShift ─── */
.logo-img {
    filter: drop-shadow(0 2px 6px rgba(255, 0, 0, 0.25));
}

/* ─── Sidebar — refined active state ─── */
.nav-item:hover {
    transform: translateX(2px);
    background: rgba(255,255,255,0.12);
}

.nav-item.active {
    background: rgba(255,255,255,0.20);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.08);
}

.nav-item.active::before {
    box-shadow: 0 0 10px rgba(255,255,255,0.55);
}

/* ─── Page entry — smoother spring animation ─── */
.page.active {
    animation: pageSpringIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pageSpringIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Page header h1 — gradient accent underline ─── */
.page-header h1::after {
    content: '';
    display: block;
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
    margin-top: 6px;
}

/* ─── Cards — top accent reveal on hover ─── */
.card {
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 60%, transparent 100%);
    opacity: 0;
    transition: opacity 0.22s;
    z-index: 2;
    pointer-events: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 0, 0, 0.18);
}

[data-theme="dark"] .card:hover {
    border-color: rgba(255, 0, 0, 0.28);
}

/* ─── Stat cards — elevated hover depth ─── */
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 0, 0, 0.12);
    border-color: rgba(255, 0, 0, 0.28);
}

/* ─── Stat value — more presence ─── */
.stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

/* ─── Budget bars — gradient fill with shimmer ─── */
.budget-bar-fill {
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary-light) 100%) !important;
    position: relative;
    overflow: hidden;
}

.budget-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
    animation: barShimmer 3s ease-in-out infinite;
}

@keyframes barShimmer {
    0%   { left: -100%; }
    60%  { left: 200%; }
    100% { left: 200%; }
}

/* ─── Buttons — refined hover/active ─── */
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 0, 0, 0.42);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 0, 0, 0.3);
}

.btn-secondary:hover {
    border-color: rgba(255, 0, 0, 0.4);
}

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

/* ─── Scrollbars — refined thin style ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.14);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.22);
}

/* ─── Modals — premium shadow depth ─── */
.modal-content {
    box-shadow: 0 24px 72px -12px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .modal-content {
    box-shadow: 0 24px 72px -12px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ─── Modal header — left accent ─── */
.modal-header {
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 0 2px 2px 0;
}

.modal-header h2 {
    padding-left: 12px;
}

/* ─── Toast — rounded & polished ─── */
.toast {
    border-radius: var(--radius-lg);
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.08);
}

/* ─── Week summary cards — glow hover ─── */
.week-summary-card:hover {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 0, 0, 0.15);
}

/* ─── Afdeling budget cards — status glow ─── */
.afdeling-budget-card.ok {
    background: rgba(76, 175, 80, 0.04);
}

.afdeling-budget-card:hover {
    border-color: rgba(255, 0, 0, 0.4);
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.1);
}

/* ─── Data table rows ─── */
.data-table tbody tr:hover {
    background: rgba(255, 0, 0, 0.055);
}

/* ─── Template cards — AH blue hover ─── */
.template-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ─── Planning table headers — uppercase clean ─── */
.planning-table th {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
    font-weight: 700;
}

/* ─── Schedule day cards — subtle depth on today ─── */
.schedule-day.is-today {
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.2);
}

/* ─── Login card — premium entrance ─── */
.login-card {
    animation: loginAppear 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes loginAppear {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Begroting calc items — hover depth ─── */
.begroting-calc-item {
    transition: var(--transition);
}

.begroting-calc-item:hover {
    border-color: rgba(255, 0, 0, 0.25);
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.08);
}

.begroting-calc-item .calc-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ─── Empty states — icon glow ─── */
.empty-state .material-icons {
    background: linear-gradient(135deg, var(--neutral-200), var(--neutral-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .empty-state .material-icons {
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Form inputs — depth on focus ─── */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    box-shadow: var(--shadow-focus), 0 1px 3px rgba(0,0,0,0.05);
}

/* ─── Sidebar section bottom fade ─── */
.sidebar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(transparent, rgba(0,0,0,0.18));
    pointer-events: none;
}

/* ==========================================================
   TOTAL REDESIGN — Deep Field Edition
   Glassmorphism, depth, precision typography
   ========================================================== */

/* ─── Plus Jakarta Sans for display headings ─── */
h1, h2, h3,
.page-header h1,
.card-header h2,
.modal-header h2,
.stat-content h3 {
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    letter-spacing: -0.025em;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

/* ─── Body — subtle mesh gradient ─── */
body {
    background: var(--bg-main);
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(255,0,0,0.04) 0%, transparent 50%),
        radial-gradient(circle at 1px 1px, rgba(0,0,0,0.022) 1px, transparent 0);
    background-size: cover, 28px 28px;
    background-attachment: scroll, fixed;
}

[data-theme="dark"] body {
    background: var(--bg-main);
    background-image:
        radial-gradient(ellipse at 15% 5%, rgba(255,0,0,0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 95%, rgba(0,144,192,0.04) 0%, transparent 45%),
        radial-gradient(circle at 1px 1px, rgba(255,0,0,0.015) 1px, transparent 0);
    background-size: cover, cover, 28px 28px;
    background-attachment: fixed, fixed, fixed;
}

/* ─── Header ─── */
.header {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
}

[data-theme="dark"] .header {
    background: rgba(6, 12, 22, 0.88) !important;
    border-bottom: 1px solid rgba(255, 0, 0, 0.08) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    box-shadow: 0 1px 0 rgba(255,0,0,0.06), 0 4px 24px rgba(0,0,0,0.3) !important;
}

.header::after {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 40%, transparent 100%);
    opacity: 0.6;
}

/* ─── Logo AnyShift — dark mode glow ─── */
.logo-img {
    filter: drop-shadow(0 2px 8px rgba(255, 0, 0, 0.3));
}

[data-theme="dark"] .logo-img {
    filter: drop-shadow(0 2px 12px rgba(255, 0, 0, 0.5)) drop-shadow(0 0 24px rgba(255, 0, 0, 0.15));
}

/* ─── Sidebar — white light / dark glass ─── */
.sidebar {
    background: #FFFFFF !important;
    border-right: 1px solid #E5E7EB !important;
    box-shadow: 2px 0 12px rgba(0,0,0,0.06);
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #040C18 0%, #030A14 100%) !important;
    border-right: 1px solid rgba(255,0,0,0.07) !important;
    box-shadow: 2px 0 24px rgba(0,0,0,0.5) !important;
}

/* Nav item — light mode */
.nav-item {
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    font-weight: 500;
    color: #374151;
    transition: background 0.15s ease, transform 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
    background: #F3F4F6;
    transform: translateX(2px);
    color: #111827;
}

.nav-item.active {
    background: rgba(255,0,0,0.08);
    color: var(--primary);
    font-weight: 700;
    box-shadow: none;
}

.nav-item.active::before {
    background: var(--primary);
    box-shadow: none;
    width: 3px;
    height: 22px;
}

/* Nav item — dark mode overrides */
[data-theme="dark"] .nav-item {
    color: #FFFFFF !important;
}

[data-theme="dark"] .nav-item:hover {
    background: rgba(255,255,255,0.10) !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .nav-item.active {
    background: rgba(255,0,0,0.14) !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 16px rgba(255,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ─── Page entry animation — spring curve ─── */
.page.active {
    animation: deepPageIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes deepPageIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Page header ─── */
.page-header h1::after {
    content: '';
    display: block;
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
    margin-top: 7px;
}

/* ─── Cards — light mode refinement ─── */
.card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.055), 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.055);
    border-radius: 14px;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 55%, transparent 100%);
    opacity: 0;
    transition: opacity 0.22s;
    z-index: 2;
    pointer-events: none;
    border-radius: 14px 14px 0 0;
}

.card:hover::before { opacity: 1; }

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
    border-color: rgba(255,0,0,0.15);
}

/* ─── Cards — dark glass morphism ─── */
[data-theme="dark"] .card {
    background: rgba(10, 20, 34, 0.82) !important;
    border: 1px solid rgba(255, 0, 0, 0.09) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.35), 0 0 1px rgba(255,0,0,0.06) !important;
}

[data-theme="dark"] .card:hover {
    background: rgba(12, 24, 40, 0.90) !important;
    border-color: rgba(255, 0, 0, 0.18) !important;
    box-shadow: 0 8px 40px rgba(0,0,0,0.45), 0 0 2px rgba(255,0,0,0.10) !important;
}

[data-theme="dark"] .card-header {
    border-bottom: 1px solid rgba(255, 0, 0, 0.08) !important;
}

[data-theme="dark"] .card-footer {
    background: rgba(0,0,0,0.2) !important;
    border-top: 1px solid rgba(255, 0, 0, 0.06) !important;
}

/* ─── Stat cards — colored top accent ─── */
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.stats-grid .stat-card:nth-child(1)::after { background: linear-gradient(90deg, #DD0000, #FF3333); }
.stats-grid .stat-card:nth-child(2)::after { background: linear-gradient(90deg, #E87000, #FFA726); }
.stats-grid .stat-card:nth-child(3)::after { background: linear-gradient(90deg, #2E8B3A, #66BB6A); }
.stats-grid .stat-card:nth-child(4)::after { background: linear-gradient(90deg, #C86600, #FFB74D); }

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06) !important;
    border-color: rgba(255,0,0,0.2) !important;
}

[data-theme="dark"] .stat-card {
    background: rgba(10, 20, 34, 0.82) !important;
    border: 1px solid rgba(255, 0, 0, 0.09) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 20px rgba(255,0,0,0.08) !important;
}

[data-theme="dark"] .stat-value {
    color: #CDD9EA;
}

/* KPI color classes must override the dark value color */
[data-theme="dark"] .stat-card.kpi-green .stat-value { color: var(--success); }
[data-theme="dark"] .stat-card.kpi-orange .stat-value { color: var(--warning); }
[data-theme="dark"] .stat-card.kpi-red .stat-value { color: var(--error); }

.stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

/* ─── Dashboard mini cards today ─── */
.day-mini-card.today {
    box-shadow: 0 6px 20px rgba(255,0,0,0.35);
}

[data-theme="dark"] .day-mini-card {
    background: rgba(255,0,0,0.05);
    border: 1px solid rgba(255,0,0,0.08);
    border-radius: 10px;
}

/* ─── Buttons — primary pill + glow ─── */
.btn-primary {
    border-radius: var(--radius-full);
    letter-spacing: 0.015em;
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,0,0,0.4) !important;
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(255,0,0,0.3) !important;
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #FF2020 0%, #C00000 100%) !important;
    box-shadow: 0 2px 10px rgba(255,0,0,0.35), 0 0 20px rgba(255,0,0,0.1) !important;
    border: none;
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #FF3333 0%, #DD0000 100%) !important;
    box-shadow: 0 6px 24px rgba(255,0,0,0.45), 0 0 32px rgba(255,0,0,0.15) !important;
}

[data-theme="dark"] .btn-secondary {
    background: rgba(255,0,0,0.06) !important;
    border: 1px solid rgba(255,0,0,0.18) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255,0,0,0.10) !important;
    border-color: rgba(255,0,0,0.3) !important;
}

[data-theme="dark"] .btn-ghost {
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-ghost:hover {
    background: rgba(255,0,0,0.08);
    color: var(--text-primary);
}

/* ─── Modal — glass premium ─── */
.modal-content {
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.04);
}

.modal-header {
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    left: 0; top: 12px; bottom: 12px;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 0 3px 3px 0;
}

.modal-header h2 {
    padding-left: 14px;
}

[data-theme="dark"] .modal {
    background: rgba(2, 6, 14, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .modal-content {
    background: rgba(8, 16, 28, 0.94) !important;
    border: 1px solid rgba(255,0,0,0.13) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 60px rgba(255,0,0,0.06) !important;
}

[data-theme="dark"] .modal-header {
    border-bottom: 1px solid rgba(255,0,0,0.08) !important;
}

[data-theme="dark"] .modal-footer {
    background: rgba(0,0,0,0.25) !important;
    border-top: 1px solid rgba(255,0,0,0.06) !important;
}

/* ─── Form inputs — glass in dark ─── */
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: rgba(4, 12, 24, 0.75) !important;
    border: 1px solid rgba(255,0,0,0.14) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
    background: rgba(6, 16, 30, 0.88) !important;
    border-color: var(--focus-color) !important;
    box-shadow: var(--shadow-focus), 0 0 16px rgba(59,130,246,0.08) !important;
}

[data-theme="dark"] select,
[data-theme="dark"] .form-select {
    background-color: rgba(4, 12, 24, 0.75) !important;
    border-color: rgba(255,0,0,0.14) !important;
    color: var(--text-primary) !important;
}

/* ─── Schedule table — dark glass ─── */
[data-theme="dark"] .schedule-table {
    background: rgba(8, 18, 32, 0.88) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

[data-theme="dark"] .schedule-table thead th {
    background: rgba(255,0,0,0.07) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

[data-theme="dark"] .schedule-table tbody td {
    border-color: rgba(255,0,0,0.06) !important;
}

[data-theme="dark"] .st-shift {
    background: rgba(255,0,0,0.09) !important;
    border-color: rgba(255,0,0,0.18) !important;
    border-left-color: var(--primary) !important;
}

[data-theme="dark"] .st-shift:hover {
    background: rgba(255,0,0,0.16) !important;
    box-shadow: 0 2px 12px rgba(255,0,0,0.18) !important;
}

[data-theme="dark"] .st-group-row {
    background: rgba(255,255,255,0.03) !important;
}

[data-theme="dark"] .st-hours,
[data-theme="dark"] .st-diff {
    background: rgba(255,0,0,0.03) !important;
}

[data-theme="dark"] .st-totals-row {
    background: rgba(255,0,0,0.04) !important;
}

[data-theme="dark"] .st-totals-row td {
    border-top-color: var(--primary) !important;
}

/* ─── Planning table — dark ─── */
[data-theme="dark"] .planning-table {
    background: rgba(8, 18, 32, 0.88) !important;
}

[data-theme="dark"] .planning-table th {
    background: linear-gradient(135deg, rgba(0,144,192,0.7) 0%, rgba(0,80,140,0.7) 100%) !important;
    border-color: rgba(255,0,0,0.15) !important;
}

[data-theme="dark"] .planning-table td {
    border-color: rgba(255,0,0,0.07) !important;
}

[data-theme="dark"] .planning-table td:first-child {
    background: rgba(255,0,0,0.03) !important;
}

/* ─── Data table — dark ─── */
[data-theme="dark"] .data-table th {
    background: rgba(255,0,0,0.06) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

[data-theme="dark"] .data-table td {
    border-color: rgba(255,0,0,0.06) !important;
}

[data-theme="dark"] .data-table tbody tr:nth-child(even) {
    background: rgba(255,0,0,0.02) !important;
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(255,0,0,0.05) !important;
}

/* ─── Shift cards — dark glass ─── */
[data-theme="dark"] .shift-card {
    background: rgba(10, 20, 34, 0.85) !important;
    border-color: rgba(255,0,0,0.10) !important;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

[data-theme="dark"] .shift-card:hover {
    border-color: rgba(255,0,0,0.22) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 10px rgba(255,0,0,0.08) !important;
}

[data-theme="dark"] .shift-card.selected {
    background: rgba(255,0,0,0.12) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(255,0,0,0.25), 0 0 16px rgba(255,0,0,0.12) !important;
}

/* ─── Schedule day cards — dark ─── */
[data-theme="dark"] .schedule-day {
    background: rgba(10, 20, 34, 0.85) !important;
    border-color: rgba(255,0,0,0.09) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* ─── Toast — glass dark ─── */
.toast {
    border-radius: 12px;
    font-weight: 500;
}

[data-theme="dark"] .toast {
    background: rgba(6, 14, 26, 0.92) !important;
    border: 1px solid rgba(255,0,0,0.2) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(255,0,0,0.08) !important;
    color: var(--text-primary);
}

/* ─── Login page — cinematic dark ─── */
[data-theme="dark"] .login-container {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255,0,0,0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 85%, rgba(200,0,0,0.06) 0%, transparent 55%),
        linear-gradient(160deg, #030C18 0%, #060F1E 50%, #03080F 100%) !important;
}

[data-theme="dark"] .login-card {
    background: rgba(7, 16, 30, 0.92) !important;
    border: 1px solid rgba(255,0,0,0.14) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    box-shadow:
        0 40px 100px -20px rgba(0,0,0,0.7),
        0 0 0 1px rgba(255,0,0,0.06),
        0 0 80px rgba(255,0,0,0.05) !important;
}

.login-card {
    animation: loginAppear 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes loginAppear {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Loading spinner — dark ─── */
[data-theme="dark"] .loading-spinner {
    background: rgba(8, 18, 32, 0.96) !important;
    border: 1px solid rgba(255,0,0,0.12) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    backdrop-filter: blur(20px) !important;
}

/* ─── Week summary cards — dark ─── */
[data-theme="dark"] .week-summary-card {
    background: rgba(10, 20, 34, 0.85) !important;
    border: 1px solid rgba(255,0,0,0.09) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    backdrop-filter: blur(8px) !important;
}

[data-theme="dark"] .week-summary-card.current,
[data-theme="dark"] .mw-week-card.mw-current {
    border-color: rgba(255,0,0,0.28) !important;
    background: rgba(255,0,0,0.06) !important;
    box-shadow: 0 0 24px rgba(255,0,0,0.08) !important;
}

[data-theme="dark"] .mw-week-card {
    background: rgba(10, 20, 34, 0.85) !important;
    border-color: rgba(255,0,0,0.09) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    backdrop-filter: blur(6px) !important;
}

[data-theme="dark"] .mw-day {
    background: rgba(255,0,0,0.04) !important;
}

/* ─── Begroting — dark glass ─── */
[data-theme="dark"] .begroting-calc-item {
    background: rgba(255,0,0,0.04) !important;
    border: 1px solid rgba(255,0,0,0.10) !important;
}

.begroting-calc-item .calc-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ─── Filter bar — dark ─── */
[data-theme="dark"] .filter-bar {
    background: rgba(255,0,0,0.03) !important;
    border-color: rgba(255,0,0,0.07) !important;
}

[data-theme="dark"] .search-box {
    background: rgba(4,12,24,0.75) !important;
    border-color: rgba(255,0,0,0.12) !important;
}

/* ─── Table container / card wrapper ─── */
[data-theme="dark"] .table-container {
    border-radius: 14px;
    overflow: hidden;
}

/* ─── Afdeling budget cards — dark ─── */
[data-theme="dark"] .afdeling-budget-card {
    background: rgba(10, 20, 34, 0.82) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

[data-theme="dark"] .afdeling-stats {
    background: rgba(255,0,0,0.04) !important;
}

[data-theme="dark"] .afdeling-progress .progress-bar {
    background: rgba(255,0,0,0.06) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

/* ─── Today badge ─── */
[data-theme="dark"] .today-badge {
    background: var(--primary);
    box-shadow: 0 0 10px rgba(255,0,0,0.5);
}

/* ─── Budget bar shimmer ─── */
.budget-bar-fill {
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary-light) 100%) !important;
    position: relative;
    overflow: hidden;
}

.budget-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: budgetShimmer 3.5s ease-in-out infinite;
}

@keyframes budgetShimmer {
    0%   { left: -100%; }
    55%  { left: 200%; }
    100% { left: 200%; }
}

/* ─── Progress bars ─── */
[data-theme="dark"] .afdeling-progress .progress-fill {
    box-shadow: 0 0 6px rgba(255,0,0,0.3);
}

/* ─── Scrollbars — refined ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.14); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.26); }

[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,0,0,0.14); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,0,0,0.26); }

/* ─── Selection indicator — dark ─── */
[data-theme="dark"] .selection-indicator {
    background: rgba(255,0,0,0.08) !important;
    border-color: rgba(255,0,0,0.25) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .clipboard-indicator {
    background: rgba(34,197,94,0.08) !important;
    border-color: rgba(34,197,94,0.25) !important;
    color: var(--text-primary);
}

/* ─── Template cards — dark ─── */
[data-theme="dark"] .template-card {
    background: rgba(10,20,34,0.82) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

[data-theme="dark"] .template-card:hover {
    border-color: rgba(255,0,0,0.25) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 12px rgba(255,0,0,0.06) !important;
}

/* ─── Day summary cards — dark ─── */
[data-theme="dark"] .day-summary-card {
    background: rgba(10,20,34,0.82) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

/* ─── Timeline — dark ─── */
[data-theme="dark"] .timeline-grid {
    background: rgba(8,18,32,0.88) !important;
}

[data-theme="dark"] .timeline-employee-name {
    background: rgba(255,0,0,0.04) !important;
}

[data-theme="dark"] .timeline-hour-marker {
    background: rgba(255,0,0,0.03) !important;
}

/* ─── Holiday banner — dark ─── */
[data-theme="dark"] .holiday-banner {
    background: rgba(255,152,0,0.08) !important;
    border-color: rgba(255,152,0,0.2) !important;
}

/* ─── Status badges ─── */
[data-theme="dark"] .status-badge.active {
    background: rgba(34,197,94,0.12) !important;
    color: #4ADE80 !important;
}

[data-theme="dark"] .status-badge.inactive {
    background: rgba(239,68,68,0.12) !important;
    color: #F87171 !important;
}

/* ─── Empty states — dark ─── */
[data-theme="dark"] .empty-state .material-icons {
    color: rgba(255,0,0,0.2);
}

/* ─── Pagination / badge ─── */
[data-theme="dark"] .badge {
    background: rgba(255,0,0,0.15);
    color: var(--primary);
    border: 1px solid rgba(255,0,0,0.2);
}

/* ─── Task checkboxes/dept checks — dark ─── */
[data-theme="dark"] .task-checkbox,
[data-theme="dark"] .department-check,
[data-theme="dark"] .availability-day,
[data-theme="dark"] .shift-pref-radio {
    background: rgba(255,0,0,0.04) !important;
    border-color: rgba(255,0,0,0.10) !important;
}

/* ─── Section header ─── */
[data-theme="dark"] .section-header {
    border-color: rgba(255,0,0,0.08) !important;
}

/* ─── Today shift items ─── */
[data-theme="dark"] .today-shift-item {
    background: rgba(255,0,0,0.04) !important;
    border-radius: 8px;
}

/* ─── Copy-paste toolbar ─── */
[data-theme="dark"] .copy-paste-toolbar {
    background: rgba(10,20,34,0.82) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

/* ─── Schedule drag-over ─── */
[data-theme="dark"] .schedule-day-content.drag-over {
    background: rgba(255,0,0,0.06) !important;
    outline-color: var(--primary);
}

/* ─── Excel view dark ─── */
[data-theme="dark"] .excel-grid {
    background: rgba(8,18,32,0.88) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

[data-theme="dark"] .excel-employee-cell {
    background: rgba(255,0,0,0.05) !important;
    border-right-color: rgba(255,0,0,0.10) !important;
}

[data-theme="dark"] .excel-legend {
    background: rgba(10,20,34,0.82) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

/* ─── Leave requests — dark ─── */
[data-theme="dark"] .leave-requests-container {
    background: rgba(4,12,24,0.75) !important;
    border-color: rgba(255,0,0,0.12) !important;
}

[data-theme="dark"] .leave-request-item {
    background: rgba(10,20,34,0.85) !important;
}

/* ─── Final: Number formatting ─── */
.stat-value,
.st-shift-time,
.begroting-calc-item .calc-value,
.day-hours, .st-hours, .st-diff {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ===================================
   PRODUCTION FIXES — Browser Compat & Mobile
   =================================== */

/* ── 1. Prevent iOS rubber-band / pull-to-refresh on main document ── */
html {
    overscroll-behavior-y: none;
}

/* ── 2. Safe-area-inset for iPhone X+/notched devices ──
   viewport-fit=cover already set in index.html.
   This ensures content doesn't hide under the home indicator. */
.sidebar {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.header {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

@media (max-width: 768px) {
    .main-content {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

/* ── 3. overscroll-behavior: contain — lock scroll inside containers ──
   Prevents parent from scrolling when inner container reaches its edge.
   Note: NOT applied to .sidebar/.header (position:fixed — different rendering layer). */
.modal-overlay,
.modal-content,
.main-content,
.schedule-container,
.excel-view-container,
.planning-table-wrapper,
.employees-table-container,
.table-container {
    overscroll-behavior: contain;
}

/* ── 4. Hover guards — prevent stuck hover states on touch devices ──
   Touch devices fire a simulated :hover on tap that can get "stuck".
   @media (hover: none) targets devices with no fine pointer (touch-only). */
@media (hover: none) and (pointer: coarse) {
    /* Remove transform effects that cause visual glitches on tap */
    .btn:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-ghost:hover,
    .shift-card:hover,
    .stat-card:hover,
    .card:hover,
    .template-card:hover {
        transform: none !important;
    }

    /* Keep active (pressed) states working — use :active instead */
    .btn:active {
        transform: scale(0.97);
    }

    /* Prevent nav hover styles flashing on tap (active state handles it) */
    .nav-item:hover:not(.active) {
        background: transparent !important;
        color: #FFFFFF !important;
    }
}

/* ── 5. Firefox scrollbar support (Webkit scrollbars ignored in Firefox) ── */
@supports not selector(::-webkit-scrollbar) {
    * {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
    }

    [data-theme="dark"] * {
        scrollbar-color: rgba(255, 0, 0, 0.18) transparent;
    }
}

/* ── 6. Safari backdrop-filter fallback for older iOS (<15.4) ──
   When backdrop-filter is not supported, fall back to solid background. */
@supports not (backdrop-filter: blur(1px)) {
    .header {
        background: rgba(255, 255, 255, 0.98) !important;
    }

    [data-theme="dark"] .header {
        background: rgba(6, 12, 22, 0.98) !important;
    }

    [data-theme="dark"] .login-card {
        background: rgba(7, 16, 30, 0.98) !important;
    }

    [data-theme="dark"] .toast {
        background: rgba(6, 14, 26, 0.98) !important;
    }

    [data-theme="dark"] .shift-card,
    [data-theme="dark"] .schedule-day,
    [data-theme="dark"] .week-summary-card,
    [data-theme="dark"] .mw-week-card {
        background: rgba(10, 20, 34, 0.98) !important;
    }
}

/* ── 7. Touch-action: pan-x/pan-y for swipeable elements ──
   Tells browser which pan directions are handled by JS to
   improve scrolling performance and prevent scroll jank. */
.schedule-container,
.excel-view-container {
    touch-action: pan-x pan-y;
}

/* Prevent text selection during swipe gestures on schedule grid */
.schedule-grid,
.excel-grid {
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-x pan-y;
}

/* ======================================================
   SIDEBAR NAV — DEFINITIVE COLOR OVERRIDE
   Light mode: dark text on white bg
   Dark mode: white text on dark bg
   ====================================================== */

/* Light mode: dark text */
.sidebar .nav-item,
.sidebar .nav-item > span,
.sidebar .nav-item > i,
.sidebar .nav-item * {
    color: #374151 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #374151 !important;
}

.sidebar .nav-item:hover,
.sidebar .nav-item:hover > span,
.sidebar .nav-item:hover > i,
.sidebar .nav-item:hover * {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
}

.sidebar .nav-item.active,
.sidebar .nav-item.active > span,
.sidebar .nav-item.active > i,
.sidebar .nav-item.active * {
    color: var(--primary) !important;
    -webkit-text-fill-color: var(--primary) !important;
}

/* Dark mode: white text */
[data-theme="dark"] .sidebar .nav-item,
[data-theme="dark"] .sidebar .nav-item > span,
[data-theme="dark"] .sidebar .nav-item > i,
[data-theme="dark"] .sidebar .nav-item * {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
}

[data-theme="dark"] .sidebar .nav-item:hover,
[data-theme="dark"] .sidebar .nav-item:hover > span,
[data-theme="dark"] .sidebar .nav-item:hover > i,
[data-theme="dark"] .sidebar .nav-item:hover * {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
}

[data-theme="dark"] .sidebar .nav-item.active,
[data-theme="dark"] .sidebar .nav-item.active > span,
[data-theme="dark"] .sidebar .nav-item.active > i,
[data-theme="dark"] .sidebar .nav-item.active * {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
}

/* ======================================================
   MOBILE SCHEDULE — Complete .mob- class system
   Target: phones <768px; rendered by renderMobileSchedule()
   ====================================================== */

/* ── Day tabs strip ── */
.mob-day-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
}

.mob-day-tabs::-webkit-scrollbar { display: none; }

.mob-day-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 52px;
    padding: 8px 6px 6px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    scroll-snap-align: start;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.mob-day-tab:active { transform: scale(0.94); }

.mob-day-tab.active {
    background: var(--primary);
    border-color: var(--primary);
}

.mob-day-tab.today:not(.active) {
    border-color: var(--primary);
    background: rgba(255, 0, 0, 0.05);
}

.mob-day-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    line-height: 1;
}

.mob-day-tab.active .mob-day-name,
.mob-day-tab.active .mob-day-date,
.mob-day-tab.active .mob-day-count {
    color: #FFFFFF !important;
}

.mob-day-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.mob-day-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-main);
    border-radius: 999px;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    margin-top: 2px;
}

.mob-day-tab.active .mob-day-count {
    background: rgba(255,255,255,0.25) !important;
    color: #FFFFFF !important;
}

/* ── Week summary bar ── */
.mob-week-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.mob-week-hours {
    flex: 1;
    text-align: right;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.mob-week-hours strong { font-weight: 700; }

/* ── Percentage status colours ── */
.mob-pct-ok    { color: var(--success); font-weight: 700; }
.mob-pct-over  { color: var(--error);   font-weight: 700; }
.mob-pct-under { color: var(--warning); font-weight: 700; }

/* ── Day header ── */
.mob-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 8px;
    margin-bottom: 6px;
    border-bottom: 1.5px solid var(--border-color);
}

.mob-day-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.today-badge {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: var(--primary);
    color: #FFFFFF;
    border-radius: 999px;
    padding: 2px 8px;
    vertical-align: middle;
}

.mob-day-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mob-stat {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.mob-stat strong { color: var(--text-primary); font-weight: 700; }

/* ── Shifts list container ── */
.mob-shifts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 80px; /* space for FAB */
}

/* ── Empty state ── */
.mob-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.mob-empty .material-icons {
    font-size: 48px;
    opacity: 0.3;
}

.mob-empty p {
    margin: 0;
    font-size: 14px;
}

/* ── Employee shift card ── */
.mob-shift-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.15s;
}

.mob-shift-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px 9px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-main);
}

.mob-emp-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.mob-emp-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mob-emp-hours {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ── Individual shift row inside card ── */
.mob-shift-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    cursor: pointer;
    border-left: 3px solid var(--primary);
    transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.mob-shift-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.mob-shift-row:active { background: rgba(255,0,0,0.04); }

.mob-shift-row.selected {
    background: rgba(255, 0, 0, 0.06);
    border-left-color: var(--primary);
}

.mob-shift-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.mob-shift-time .material-icons {
    font-size: 15px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.mob-shift-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.mob-shift-tasks {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status shifts */
.mob-shift-row.mob-status {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border-left-width: 4px;
}

.mob-status-badge {
    font-size: 11px;
    font-weight: 800;
    color: #FFFFFF;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

/* ── Add shift dashed link inside card ── */
.mob-add-shift {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 9px 14px;
    background: none;
    border: none;
    border-top: 1px dashed var(--border-color);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.mob-add-shift:active { background: rgba(255,0,0,0.04); }

.mob-add-shift .material-icons { font-size: 16px; }

/* ── Unscheduled employees section ── */
.mob-unscheduled {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
    overflow: hidden;
}

.mob-unscheduled-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: color 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.mob-unscheduled-toggle .material-icons {
    font-size: 18px;
    transition: transform 0.2s;
    margin-left: auto;
}

.mob-unscheduled.open .mob-unscheduled-toggle .material-icons {
    transform: rotate(180deg);
}

.mob-unscheduled-list {
    display: none;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
}

.mob-unscheduled.open .mob-unscheduled-list {
    display: flex;
}

.mob-unscheduled-emp {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    cursor: pointer;
    transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.mob-unscheduled-emp:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.mob-unscheduled-emp:active { background: rgba(255,0,0,0.04); }

.mob-unscheduled-emp > span:first-child {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.mob-add-icon {
    font-size: 20px !important;
    color: var(--primary) !important;
}

/* ── Floating action button ── */
.mob-fab {
    position: fixed;
    bottom: max(24px, env(safe-area-inset-bottom, 24px));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 4px 18px rgba(255, 0, 0, 0.45), 0 2px 6px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 800;
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.mob-fab:active {
    transform: scale(0.92);
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.5);
}

.mob-fab .material-icons { font-size: 28px; }

/* ── Dark mode mobile overrides ── */
[data-theme="dark"] .mob-day-tab {
    background: rgba(10,20,34,0.82);
    border-color: rgba(255,0,0,0.09);
}

[data-theme="dark"] .mob-day-tab.active {
    background: var(--primary);
    border-color: var(--primary);
}

[data-theme="dark"] .mob-day-tab.today:not(.active) {
    border-color: var(--primary);
    background: rgba(255,0,0,0.10);
}

[data-theme="dark"] .mob-day-count {
    background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .mob-week-summary,
[data-theme="dark"] .mob-shift-card,
[data-theme="dark"] .mob-unscheduled {
    background: rgba(10,20,34,0.82) !important;
    border-color: rgba(255,0,0,0.09) !important;
}

[data-theme="dark"] .mob-shift-header {
    background: rgba(255,0,0,0.04);
    border-bottom-color: rgba(255,0,0,0.07);
}

[data-theme="dark"] .mob-shift-row {
    border-left-color: var(--primary);
}

[data-theme="dark"] .mob-shift-row:not(:last-child) {
    border-bottom-color: rgba(255,0,0,0.06);
}

[data-theme="dark"] .mob-shift-row.selected {
    background: rgba(255,0,0,0.10);
}

[data-theme="dark"] .mob-add-shift {
    border-top-color: rgba(255,0,0,0.10);
}

[data-theme="dark"] .mob-unscheduled-toggle,
[data-theme="dark"] .mob-unscheduled-list {
    border-color: rgba(255,0,0,0.07);
}

[data-theme="dark"] .mob-unscheduled-emp:not(:last-child) {
    border-bottom-color: rgba(255,0,0,0.06);
}

[data-theme="dark"] .mob-fab {
    box-shadow: 0 4px 20px rgba(255,0,0,0.5), 0 0 32px rgba(255,0,0,0.12);
}

/* ===================================
   BEGROTING TABS
   =================================== */

/* Role-based tab visibility — CSS is the authoritative layer (JS is secondary) */
/* manager-operatie: only Operatie tab */
body[data-role="manager-operatie"] .beg-tab-btn[data-tab="overzicht"],
body[data-role="manager-operatie"] .beg-tab-btn[data-tab="vers"],
body[data-role="manager-operatie"] .beg-tab-btn[data-tab="service"] {
    display: none !important;
}
/* manager-vers: only Vers tab */
body[data-role="manager-vers"] .beg-tab-btn[data-tab="overzicht"],
body[data-role="manager-vers"] .beg-tab-btn[data-tab="operatie"],
body[data-role="manager-vers"] .beg-tab-btn[data-tab="service"] {
    display: none !important;
}
/* manager-service: only Service tab */
body[data-role="manager-service"] .beg-tab-btn[data-tab="overzicht"],
body[data-role="manager-service"] .beg-tab-btn[data-tab="operatie"],
body[data-role="manager-service"] .beg-tab-btn[data-tab="vers"] {
    display: none !important;
}

.beg-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
    flex-wrap: wrap;
}

.beg-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: color .15s, border-color .15s, background .15s;
}

.beg-tab-btn:hover {
    color: var(--text-primary);
    background: var(--neutral-50);
}

.beg-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-card);
}

.beg-tab-btn .material-icons {
    font-size: 16px;
}

/* Department begroting table */
.dept-beg-table {
    border-collapse: collapse;
    width: 100%;
}

.dept-beg-table th,
.dept-beg-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.dept-beg-table thead th {
    background: var(--neutral-50);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

@media (max-width: 768px) {
    .beg-tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    .beg-tab-btn span.material-icons {
        display: none;
    }
}

/* ─── Begroting — Afdeling sub-rows ─── */
.beg-sub-row td {
    padding: 3px 8px !important;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--neutral-50);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.beg-sub-row td:first-child {
    padding-left: 24px !important;
    font-weight: 500;
}
.beg-sub-row .beg-sub-icon {
    font-size: 13px;
    vertical-align: middle;
    margin-right: 4px;
}
.beg-sub-total td {
    padding: 4px 8px !important;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--neutral-100);
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.beg-sub-total td:first-child {
    padding-left: 24px !important;
}
.beg-sub-total .beg-sub-icon {
    font-size: 13px;
    vertical-align: middle;
    margin-right: 4px;
}

[data-theme="dark"] .beg-sub-row td {
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    border-bottom-color: rgba(255,255,255,0.04);
}
[data-theme="dark"] .beg-sub-total td {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    border-bottom-color: rgba(255,255,255,0.06);
}

/* ─── Planning Budget Banner ─── */

/* Revenue bar (shown above cards) */
#planningBudgetBanner {
    margin-bottom: var(--space-5);
}

.pbc-revenue-bar {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--neutral-100);
    padding: 8px 14px;
    border-radius: 8px;
    margin-bottom: var(--space-4);
    text-align: right;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Grid: 3 compact cards side-by-side (admin/manager view) */
.pbc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

/* Base card */
.planning-budget-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
}

/* Compact card (admin grid view) — no day breakdown */
.pbc-compact {
    padding: 12px 14px;
}
.pbc-compact .pbc-header {
    margin-bottom: 0;
    font-size: 13px;
}

/* Highlighted card (dept manager single view) */
.pbc-highlight {
    margin-bottom: 16px;
}

.pbc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 15px;
}
.pbc-header strong {
    flex: 1;
}
.pbc-week-total {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.pbc-days {
    display: flex;
    gap: 6px;
}
.pbc-day {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    background: var(--neutral-50);
    border: 1px solid var(--border-color);
    min-width: 0;
}
.pbc-day-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}
.pbc-day-budget {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
.pbc-day-sched {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
}
.pbc-day-total {
    background: var(--neutral-100);
    border-color: var(--border-color);
    flex: 1.3;
}
.pbc-day-total .pbc-day-budget {
    font-size: 14px;
}
.pbc-day-total .pbc-day-sched {
    font-size: 12px;
}

/* Dark mode */
[data-theme="dark"] .planning-budget-card {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
[data-theme="dark"] .pbc-revenue-bar {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
}
[data-theme="dark"] .pbc-day {
    background: rgba(255,255,255,0.04);
    border-color: var(--border-color);
}
[data-theme="dark"] .pbc-day-total {
    background: rgba(255,255,255,0.08);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .pbc-grid {
        grid-template-columns: 1fr;
    }
    .pbc-days {
        flex-wrap: wrap;
    }
    .pbc-day {
        flex: 0 0 calc(25% - 6px);
    }
    .pbc-day-total {
        flex: 0 0 100%;
        margin-top: 4px;
    }
    .pbc-header {
        flex-wrap: wrap;
    }
}

/* ═══════════════════════════════════════════════
   Polish Layer — Motion, Micro-interactions
   ═══════════════════════════════════════════════ */

/* Stagger reveal for grids */
.stats-grid > .stat-card,
.afdeling-budget-grid > .afdeling-budget-card,
.week-mini-grid > .day-mini-card {
    animation: staggerUp 0.4s var(--ease-out) both;
}

.stats-grid > .stat-card:nth-child(1) { animation-delay: 0s; }
.stats-grid > .stat-card:nth-child(2) { animation-delay: 0.04s; }
.stats-grid > .stat-card:nth-child(3) { animation-delay: 0.08s; }
.stats-grid > .stat-card:nth-child(4) { animation-delay: 0.12s; }
.stats-grid > .stat-card:nth-child(5) { animation-delay: 0.16s; }

.afdeling-budget-grid > .afdeling-budget-card:nth-child(1) { animation-delay: 0.05s; }
.afdeling-budget-grid > .afdeling-budget-card:nth-child(2) { animation-delay: 0.1s; }
.afdeling-budget-grid > .afdeling-budget-card:nth-child(3) { animation-delay: 0.15s; }

.week-mini-grid > .day-mini-card:nth-child(1) { animation-delay: 0s; }
.week-mini-grid > .day-mini-card:nth-child(2) { animation-delay: 0.03s; }
.week-mini-grid > .day-mini-card:nth-child(3) { animation-delay: 0.06s; }
.week-mini-grid > .day-mini-card:nth-child(4) { animation-delay: 0.09s; }
.week-mini-grid > .day-mini-card:nth-child(5) { animation-delay: 0.12s; }
.week-mini-grid > .day-mini-card:nth-child(6) { animation-delay: 0.15s; }
.week-mini-grid > .day-mini-card:nth-child(7) { animation-delay: 0.18s; }

@keyframes staggerUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger rows in today schedule */
.today-shift-item {
    animation: staggerUp 0.3s var(--ease-out) both;
}
.today-shift-item:nth-child(1) { animation-delay: 0.02s; }
.today-shift-item:nth-child(2) { animation-delay: 0.05s; }
.today-shift-item:nth-child(3) { animation-delay: 0.08s; }
.today-shift-item:nth-child(4) { animation-delay: 0.11s; }
.today-shift-item:nth-child(5) { animation-delay: 0.14s; }
.today-shift-item:nth-child(6) { animation-delay: 0.17s; }
.today-shift-item:nth-child(7) { animation-delay: 0.20s; }
.today-shift-item:nth-child(8) { animation-delay: 0.23s; }

/* Budget bar fill animation */
.budget-bar-fill {
    animation: barGrow 0.6s var(--ease-out) both;
    animation-delay: 0.2s;
}

@keyframes barGrow {
    from { transform: scaleX(0); transform-origin: left; }
    to { transform: scaleX(1); transform-origin: left; }
}

/* Refined form inputs */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    transition: border-color var(--duration-fast) var(--ease-smooth),
                box-shadow var(--duration-fast) var(--ease-smooth);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    border-color: var(--focus-color);
    box-shadow: var(--shadow-focus);
    outline: none;
}

/* Smooth badge pulse */
.notification-badge:not([style*="display: none"]) {
    animation: badgePop 0.3s var(--ease-spring) both;
}

@keyframes badgePop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Nav active indicator refined transition */
.nav-item.active::before {
    animation: navIndicator 0.25s var(--ease-out) both;
}

@keyframes navIndicator {
    from { transform: translateY(-50%) scaleY(0); opacity: 0; }
    to { transform: translateY(-50%) scaleY(1); opacity: 1; }
}

/* Card entrance when scrolled into view (dashboard sections) */
.dashboard-grid > .card,
.afdeling-budget-grid {
    animation: staggerUp 0.35s var(--ease-out) both;
    animation-delay: 0.15s;
}

/* Tooltip-like hover effects for shift items */
.today-shift-item {
    transition: background var(--duration-fast) var(--ease-smooth),
                transform var(--duration-fast) var(--ease-smooth);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
}

.today-shift-item:hover {
    background: var(--bg-hover);
    transform: translateX(2px);
}

/* Refined empty state */
.empty-state {
    animation: staggerUp 0.4s var(--ease-out) both;
    animation-delay: 0.1s;
}

/* Progress bar animation for afdeling cards */
.afdeling-progress .progress-fill {
    animation: barGrow 0.5s var(--ease-out) both;
    animation-delay: 0.3s;
}

/* Smooth scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: var(--radius-full);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-400);
}

.main-content::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--neutral-200);
    border-radius: var(--radius-full);
}

/* Day mini cards refinement */
.day-mini-card {
    transition: transform var(--duration-fast) var(--ease-smooth),
                box-shadow var(--duration-fast) var(--ease-smooth);
}

.day-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.day-mini-card.today {
    box-shadow: var(--shadow-sm);
}

/* Tips banner polish */
.tips-banner {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    animation: staggerUp 0.35s var(--ease-out) both;
    animation-delay: 0.05s;
}
