/* SimplBooks — Premium Design System
   Inspired by Linear, Vercel, Stripe, Raycast
   ============================================ */

/* ==================== DESIGN TOKENS ==================== */
:root {
    /* --- Primary Palette --- */
    --primary-color: #0D9488;
    --primary-hover: #0B7C72;
    --primary-light: #5EEAD4;
    --primary-bg: rgba(13, 148, 136, 0.08);

    --accent-color: #0D9488;
    --accent-light: #5EEAD4;
    --accent-bg: rgba(13, 148, 136, 0.08);

    /* --- Neutrals --- */
    --text-primary: #1a2332;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #ecf0f1;

    /* --- Surfaces (glassmorphism-ready) --- */
    --background: #f0f4f7;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #ffffff;
    --surface-hover: rgba(241, 245, 249, 0.9);
    --surface-raised: #ffffff;

    /* --- Borders --- */
    --border: rgba(226, 232, 240, 0.8);
    --border-light: rgba(241, 245, 249, 0.6);
    --border-focus: #0D9488;

    /* --- Semantic Colors --- */
    --success: #16A34A;
    --success-bg: rgba(22, 163, 74, 0.08);
    --success-border: rgba(22, 163, 74, 0.2);

    --warning: #B45309;
    --warning-bg: rgba(180, 83, 9, 0.06);
    --warning-border: rgba(180, 83, 9, 0.15);

    --danger: #E11D48;
    --danger-bg: rgba(225, 29, 72, 0.06);
    --danger-border: rgba(225, 29, 72, 0.2);

    --info: #6366F1;
    --info-bg: rgba(99, 102, 241, 0.08);

    --neutral: #64748B;
    --neutral-bg: rgba(100, 116, 139, 0.08);
    --neutral-border: rgba(100, 116, 139, 0.2);

    /* --- Spacing (8px grid) --- */
    --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-10: 48px;
    --space-12: 64px;
    --space-16: 80px;

    /* --- Layered Shadows (color-matched, multi-layer) --- */
    --shadow-xs: 0 1px 2px rgba(13, 50, 70, 0.04);
    --shadow-sm:
        0 1px 2px rgba(13, 50, 70, 0.04),
        0 2px 4px rgba(13, 50, 70, 0.03);
    --shadow-md:
        0 1px 2px rgba(13, 50, 70, 0.03),
        0 4px 8px rgba(13, 50, 70, 0.04),
        0 8px 16px rgba(13, 50, 70, 0.03);
    --shadow-lg:
        0 1px 2px rgba(13, 50, 70, 0.03),
        0 4px 8px rgba(13, 50, 70, 0.03),
        0 12px 24px rgba(13, 50, 70, 0.05),
        0 24px 48px rgba(13, 50, 70, 0.03);
    --shadow-xl:
        0 1px 2px rgba(13, 50, 70, 0.02),
        0 8px 16px rgba(13, 50, 70, 0.04),
        0 24px 48px rgba(13, 50, 70, 0.06),
        0 48px 96px rgba(13, 50, 70, 0.04);
    --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.15);
    --shadow-card:
        0 1px 3px rgba(13, 50, 70, 0.03),
        0 4px 12px rgba(13, 50, 70, 0.04);
    --shadow-card-hover:
        0 2px 4px rgba(13, 50, 70, 0.03),
        0 8px 24px rgba(13, 50, 70, 0.06),
        0 0 0 1px rgba(13, 148, 136, 0.08);

    /* --- Glassmorphism --- */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(24px);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);

    /* --- Border Radius (consistent scale) --- */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* --- Premium Easing (expo-out for snappy feel) --- */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    /* --- Transition presets --- */
    --transition-fast: 120ms var(--ease-out);
    --transition: 200ms var(--ease-out);
    --transition-slow: 350ms var(--ease-out);
    --transition-bounce: 500ms var(--ease-spring);

    /* --- Legacy compat --- */
    --white: #ffffff;
    --text-color: #1a2332;
    --medium-gray: #bdc3c7;
    --light-gray: #f5f7f8;
    --dark-gray: #7f8c8d;
    --border-radius: 10px;
    --shadow: var(--shadow-sm);
    --secondary-color: var(--primary-color);
}


/* ==================== BASE & RESET ==================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Native app feel */
    overscroll-behavior: none;
}

body {
    margin: 0;
    background: var(--background);
    /* Subtle ambient gradient mesh */
    background-image:
        radial-gradient(ellipse at 15% 0%, rgba(13, 148, 136, 0.045) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgba(99, 102, 241, 0.03) 0%, transparent 55%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.55;
    /* Premium text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Prevent rubber-banding */
    overscroll-behavior: none;
}

/* Native app feel: prevent text selection on interactive elements */
button, [role="button"], .nav-item, .nav-link, .bottom-nav-item,
.profile-trigger, .pagination-item, .tab, .settings-nav-item {
    user-select: none;
    -webkit-user-select: none;
}

/* Prevent tap highlight on mobile */
a, button, [role="button"] {
    -webkit-tap-highlight-color: transparent;
}


/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Nunito', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
}

h1 {
    font-size: clamp(24px, 2.2vw, 30px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

h2 {
    font-size: clamp(18px, 1.6vw, 23px);
    letter-spacing: -0.025em;
}

h3 {
    font-size: clamp(15px, 1.3vw, 18px);
    letter-spacing: -0.015em;
}

/* Small text opens up */
small, .caption, .text-xs {
    letter-spacing: 0.01em;
}

/* Uppercase labels */
.label-uppercase, .card-title {
    letter-spacing: 0.05em;
    text-transform: uppercase;
}


/* ==================== VIEW TRANSITIONS API ==================== */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: vt-fade-out 180ms var(--ease-in);
}

::view-transition-new(root) {
    animation: vt-fade-in 220ms var(--ease-out);
}

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

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

/* Sidebar stays persistent */
.sidebar {
    view-transition-name: sidebar;
}

::view-transition-old(sidebar),
::view-transition-new(sidebar) {
    animation: none;
}


/* ==================== LAYOUT ==================== */
.dashboard {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}


/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 240px;
    min-width: 240px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(32px) saturate(1.5);
    -webkit-backdrop-filter: blur(32px) saturate(1.5);
    border-right: 1px solid rgba(255, 255, 255, 0.45);
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 200;
    box-shadow:
        1px 0 0 rgba(0, 0, 0, 0.03),
        4px 0 24px rgba(0, 0, 0, 0.02);
}

.sidebar-logo {
    height: 56px;
    width: auto;
    display: block;
}

.logo {
    padding: var(--space-6) var(--space-5) var(--space-5);
    border-bottom: 1px solid var(--border);
}

.logo h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.03em;
    margin: 0;
}

/* Glassmorphism variant */
.sidebar.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
}

/* --- Nav Menu --- */
.nav-menu {
    list-style: none;
    padding: var(--space-3) 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1px;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px var(--space-5);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    white-space: nowrap;
    border-left: 3px solid transparent;
    position: relative;
    /* Asymmetric timing: fast in, slow out */
    transition: background-color 120ms var(--ease-out),
                color 120ms var(--ease-out),
                border-color 120ms var(--ease-out);
}

.nav-link:hover {
    background-color: rgba(13, 148, 136, 0.05);
    color: var(--text-primary);
    transition-duration: 80ms; /* Even faster on enter */
}

.nav-link.active {
    background-color: var(--primary-bg);
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

.nav-link:active {
    transform: scale(0.985);
    transition-duration: 50ms;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 120ms var(--ease-out), color 120ms var(--ease-out);
}

.nav-link.active .nav-icon {
    opacity: 1;
    color: var(--primary-color);
}

.nav-link:hover .nav-icon {
    opacity: 0.8;
}

/* Featured nav item — Assistent */
.nav-item-featured {
    margin: 0 var(--space-3) var(--space-2);
}

.nav-link-featured {
    background: var(--surface);
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color) !important;
    border-radius: var(--radius);
    border-left: 1.5px solid var(--primary-color) !important;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: all 200ms var(--ease-out);
}

.nav-link-featured:hover {
    background: var(--primary-bg);
    color: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.12);
}

.nav-link-featured.active {
    background: linear-gradient(135deg, #0D9488 0%, #0B7C72 100%);
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35);
}

.nav-link-featured.active svg {
    color: white;
}

.nav-link-featured svg {
    flex-shrink: 0;
    color: var(--primary-color);
}


/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: var(--space-7) var(--space-8);
    min-height: 100vh;
    max-width: calc(100% - 240px);
    overflow-x: hidden;
    background: var(--background);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 199;
}

.sidebar-overlay.open {
    display: block;
}


/* ==================== PAGE HEADER ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-7);
}

.page-title {
    font-family: 'Nunito', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    margin-top: var(--space-1);
    line-height: 1.5;
}

.action-buttons {
    display: flex;
    gap: var(--space-3);
}


/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-weight: 550;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    /* Asymmetric: slow out (300ms), fast in (overridden in :hover) */
    transition: transform 200ms var(--ease-out),
                box-shadow 200ms var(--ease-out),
                background-color 200ms var(--ease-out),
                border-color 200ms var(--ease-out),
                color 200ms var(--ease-out);
}

.btn:hover {
    transition-duration: 120ms;
}

.btn:active {
    transform: scale(0.975);
    transition-duration: 60ms;
}

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

.btn .icon {
    margin-right: 6px;
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    border-color: transparent;
    box-shadow: 0 1px 3px rgba(13, 148, 136, 0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f766e, #0d5c55);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35), inset 0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--surface-solid);
    color: var(--text-primary);
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-focus);
    box-shadow: var(--shadow-sm);
}

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

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

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

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

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

.btn-success:hover {
    background-color: #15803d;
}

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

.btn-ghost:hover {
    background-color: var(--surface-hover);
    color: var(--primary-color);
    border-color: rgba(13, 148, 136, 0.15);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

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


/* ==================== CARDS ==================== */
.card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-card);
    /* Slow out transition */
    transition: transform 300ms var(--ease-out),
                box-shadow 300ms var(--ease-out),
                border-color 300ms var(--ease-out);
}

.card:hover {
    border-color: rgba(13, 148, 136, 0.15);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    /* Fast in */
    transition-duration: 150ms;
}

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

.card-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card-value {
    font-family: 'Nunito', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.card-trend {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 550;
    margin-top: var(--space-2);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.card-trend.positive {
    color: var(--success);
    background: var(--success-bg);
}

.card-trend.negative {
    color: var(--danger);
    background: var(--danger-bg);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-7);
}

/* Focus-within glow */
.card:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--primary-bg);
}


/* ==================== SECTIONS ==================== */
.section {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    overflow-x: hidden;
    box-shadow: var(--shadow-card);
    transition: border-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}

.section:hover {
    border-color: rgba(13, 148, 136, 0.08);
    transition-duration: 150ms;
}

.section:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--primary-bg);
}

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

.section-title {
    font-family: 'Nunito', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.section-actions {
    display: flex;
    gap: var(--space-2);
}


/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-variant-numeric: tabular-nums;
}

.table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    background: rgba(13, 148, 136, 0.025);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table td {
    padding: 18px 20px;
    text-align: left;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

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

.table tbody tr {
    transition: background-color 100ms var(--ease-out);
}

.table tbody tr:hover {
    background-color: rgba(13, 148, 136, 0.025);
}

/* Subtle zebra */
.table tbody tr:nth-child(even) {
    background-color: rgba(241, 245, 249, 0.35);
}

.table tbody tr:nth-child(even):hover {
    background-color: rgba(13, 148, 136, 0.025);
}

/* Column alignment */
.table th.text-right, .table td.text-right { text-align: right; }
.table th.text-center, .table td.text-center { text-align: center; }

.table td:has(.amount), .table .col-amount {
    text-align: right;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.table a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 100ms var(--ease-out);
}

.table a:hover {
    color: var(--accent-color);
}

.table td strong {
    font-weight: 600;
    color: var(--text-primary);
}

.table td small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.table td[colspan] {
    text-align: center;
    padding: var(--space-10) 20px;
    color: var(--text-muted);
}

.table td[colspan] a {
    color: var(--accent-color);
}


/* ==================== STATUS BADGES ==================== */
.status, .badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.status-paid, .status-active, .badge-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.status-unpaid, .status-sent, .status-pending, .badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.status-overdue, .status-late, .status-inactive, .badge-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info);
}

.badge-neutral {
    background-color: var(--neutral-bg);
    color: var(--neutral);
}

.badge-secondary {
    background-color: var(--surface-hover);
    color: var(--text-secondary);
}

.status-badge {
    font-weight: 500;
    font-size: 11px;
}


/* ==================== SEARCH & FILTERS ==================== */
.filters {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}

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

.filter-label {
    margin-right: var(--space-2);
    font-size: 13px;
    color: var(--text-secondary);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface-solid);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}

.filter-select:hover {
    border-color: var(--border-focus);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.search-box {
    display: flex;
    align-items: center;
    border: 1px solid rgba(226, 232, 240, 0.7);
    border-radius: var(--radius-lg);
    padding: 10px var(--space-4);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-grow: 1;
    max-width: 360px;
    transition: border-color 120ms var(--ease-out),
                box-shadow 200ms var(--ease-out),
                background 120ms var(--ease-out);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

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

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

.search-box .icon {
    margin-right: var(--space-2);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}


/* ==================== DRAWER / MODAL ==================== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: flex-end;
    z-index: 200;
}

.drawer {
    background: var(--surface-solid);
    width: 480px;
    max-width: 100%;
    height: 100%;
    transform: translateX(100%);
    transition: transform 300ms var(--ease-out);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.drawer-open .drawer {
    transform: translateX(0);
}

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

.drawer-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.drawer-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-1);
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: color 100ms var(--ease-out), background 100ms var(--ease-out);
}

.drawer-close:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.drawer-body {
    padding: var(--space-6);
    overflow-y: auto;
    flex: 1;
}

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


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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(226, 232, 240, 0.75);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.75);
    min-height: 44px;
    transition: border-color 120ms var(--ease-out),
                box-shadow 200ms var(--ease-out),
                background 120ms var(--ease-out);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
    background: rgba(255, 255, 255, 0.97);
}

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

/* Generic focus for inputs outside form-group */
input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg);
    outline: none;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: 14px;
}


/* ==================== NOTIFICATIONS ==================== */
#notification-container {
    position: fixed;
    top: var(--space-5);
    right: var(--space-5);
    z-index: 1000;
}

.notification {
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s var(--ease-out);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

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

.notification.success { background-color: var(--success); color: white; }
.notification.error { background-color: var(--danger); color: white; }


/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: var(--space-5);
    gap: var(--space-1);
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 120ms var(--ease-out);
}

.pagination-item:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
}

.pagination-item.active {
    background-color: var(--primary-color);
    color: white;
}


/* ==================== ICONS ==================== */
.icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.icon-button {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 100ms var(--ease-out);
}

.icon-button:hover {
    background: var(--surface-hover);
}

/* Icon definitions */
.icon-dashboard   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/%3E%3C/svg%3E"); }
.icon-invoice     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E"); }
.icon-expense     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z'/%3E%3C/svg%3E"); }
.icon-vat         { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 14h-2V9h-2V7h4v10zm6-3h-2v2h-2v-2h-2v-2h2v-2h2v2h2v2z'/%3E%3C/svg%3E"); }
.icon-report      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z'/%3E%3C/svg%3E"); }
.icon-settings    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/svg%3E"); }
.icon-client      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E"); }
.icon-plus        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-filter      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-search      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-arrow-up    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23059669'%3E%3Cpath d='M7 14l5-5 5 5z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-arrow-down  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-edit        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-delete      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-export      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-import      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-download    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-more        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E"); width:16px; height:16px; }
.icon-view        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M12 4.5C7 4.52 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z'/%3E%3C/svg%3E"); width:16px; height:16px; cursor:pointer; }
.icon-calendar    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z'/%3E%3C/svg%3E"); }
.icon-upload      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z'/%3E%3C/svg%3E"); }
.icon-print       { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M19 8H5c-1.1 0-2 .9-2 2v6h4v4h10v-4h4v-6c0-1.1-.9-2-2-2zm-3 10H8v-4h8v4zm3-8H5V6h14v4z'/%3E%3C/svg%3E"); }
.icon-back        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z'/%3E%3C/svg%3E"); }
.icon-euro        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M15 18.5c-2.76 0-5.1-1.68-6.16-4H15v-2H8.23a6.5 6.5 0 010-1h6.77V9H8.84c1.06-2.32 3.4-4 6.16-4 1.63 0 3.09.63 4.24 1.76L21 4.99C19.37 3.36 17.28 2.5 15 2.5c-4.08 0-7.55 2.43-9.05 6H3v2h2.36c-.04.33-.06.66-.06 1s.02.67.06 1H3v2h2.95c1.5 3.57 4.97 6 9.05 6 2.28 0 4.37-.86 6-2.49l-1.76-1.76c-1.15 1.13-2.61 1.76-4.24 1.76z'/%3E%3C/svg%3E"); }


/* ==================== CHART ==================== */
.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}


/* ==================== DROPDOWNS ==================== */
.actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
}

.more-container {
    position: relative;
    display: inline-block;
}

.action-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: var(--space-1);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 170px;
    z-index: 50;
    overflow: hidden;
    animation: dropdownIn 150ms var(--ease-out);
}

.dropdown-menu.show {
    display: block;
}

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

.dropdown-menu a {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 80ms var(--ease-out);
}

.dropdown-menu a:hover {
    background-color: var(--surface-hover);
}

.invoice-actions {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    list-style: none;
    padding: var(--space-1) 0;
    z-index: 10;
    min-width: 170px;
    animation: dropdownIn 150ms var(--ease-out);
}

.invoice-actions.show {
    display: block;
}

.invoice-actions li a {
    display: block;
    padding: 10px 14px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: background 80ms var(--ease-out);
}

.invoice-actions li a:hover {
    background-color: var(--surface-hover);
}


/* ==================== VAT & REPORTS ==================== */
.vat-summary {
    font-size: 13px;
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

.year-selector {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.year-selector h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.year-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface-solid);
    font-size: 13px;
}

/* Quarter cards */
.quarter-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.quarter-card {
    background-color: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform 300ms var(--ease-out),
                box-shadow 300ms var(--ease-out),
                border-color 300ms var(--ease-out);
}

.quarter-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    transition-duration: 150ms;
}

.quarter-card.active {
    border-color: var(--primary-color);
}

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

.quarter-title {
    font-size: 15px;
    font-weight: 600;
}

.quarter-toggle {
    font-size: 14px;
    color: var(--text-muted);
}

.quarter-chart {
    height: 120px;
    margin-bottom: var(--space-4);
}

.chart-placeholder {
    position: relative;
    height: 100%;
    background-color: var(--surface-hover);
    border-radius: var(--radius);
}

.chart-area, .chart-area-costs {
    position: absolute;
    bottom: 0;
    width: 35%;
    border-radius: var(--radius-sm);
}

.chart-area {
    left: 15%;
    background-color: var(--accent-bg);
    border: 1px solid var(--accent-color);
    height: 60%;
}

.chart-area-costs {
    right: 15%;
    background-color: var(--warning-bg);
    border: 1px solid var(--warning);
    height: 40%;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    font-size: 13px;
}

.summary-label { color: var(--text-secondary); }
.summary-value { font-weight: 500; font-variant-numeric: tabular-nums; }
.summary-value.positive { color: var(--success); }

.quarter-details {
    display: none;
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
}

.quarter-details.active { display: block; }

.details-section { margin-bottom: var(--space-4); }
.details-title { font-weight: 600; margin-bottom: var(--space-2); font-size: 13px; }

.details-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 6px;
    font-size: 13px;
}

.details-label { color: var(--text-secondary); }
.details-value { text-align: right; font-variant-numeric: tabular-nums; }
.details-total { font-weight: 600; }

.btw-section {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-light);
}

.btw-title { font-weight: 600; margin-bottom: var(--space-2); font-size: 13px; }

.btw-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 6px;
    font-size: 13px;
}

.btw-note {
    margin-top: var(--space-2);
    font-size: 11px;
    color: var(--text-muted);
}


/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    gap: var(--space-4);
}

.stat-card {
    transition: border-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}

.stat-card:hover {
    border-color: var(--border-focus);
    transition-duration: 150ms;
}


/* ==================== EMPTY STATES ==================== */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-5);
    background: var(--primary-bg);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
    opacity: 0.8;
}

.empty-state-title {
    font-family: 'Nunito', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state-desc {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 320px;
    margin: 0 auto var(--space-6);
    line-height: 1.6;
}


/* ==================== PROFILE MENU ==================== */
.profile-menu {
    margin-top: auto;
    padding: var(--space-4);
    border-top: 1px solid var(--border);
    position: relative;
}

.profile-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 8px 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 120ms var(--ease-out);
}

.profile-trigger:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-xs);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.profile-chevron {
    color: var(--text-muted);
    transition: transform 200ms var(--ease-out);
}

.profile-menu.open .profile-chevron {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    bottom: 100%;
    left: var(--space-4);
    right: var(--space-4);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(28px) saturate(1.4);
    -webkit-backdrop-filter: blur(28px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    display: none;
    margin-bottom: var(--space-2);
    z-index: 1000;
    animation: dropdownIn 150ms var(--ease-out);
}

.profile-menu.open .profile-dropdown {
    display: block;
}

.profile-dropdown-header {
    padding: 12px var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.profile-dropdown-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.profile-dropdown-email {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px var(--space-4);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: background 80ms var(--ease-out);
}

.profile-dropdown-item:hover {
    background: var(--surface-hover);
}

.profile-dropdown-item.danger {
    color: var(--danger);
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-1) 0;
}


/* ==================== MOBILE: HAMBURGER ==================== */
/* Base: hide mobile nav */
.mobile-menu-toggle, .bottom-nav {
    display: none;
}

.mobile-menu-toggle {
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    z-index: 201;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
    transition: border-color 120ms var(--ease-out);
}

.mobile-menu-toggle:hover {
    border-color: var(--primary-color);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}


/* ==================== MOBILE: BOTTOM NAV ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-top: 1px solid rgba(232, 236, 239, 0.4);
    padding: var(--space-2) 0;
    padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-1) var(--space-3);
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    text-decoration: none;
    font-family: inherit;
    transition: color 100ms var(--ease-out);
}

.bottom-nav-item:hover { color: var(--text-secondary); }
.bottom-nav-item.active { color: var(--primary-color); }

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
}

.bottom-nav-label {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
}

/* Featured bottom nav (Assistent) */
.bottom-nav-featured {
    color: var(--primary-color);
    position: relative;
}

.bottom-nav-featured svg {
    background: linear-gradient(135deg, #0D9488, #0B7C72);
    border-radius: 50%;
    padding: 4px;
    color: white;
    width: 28px;
    height: 28px;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.bottom-nav-featured .bottom-nav-label {
    font-weight: 600;
    color: var(--primary-color);
}


/* ==================== RESPONSIVE ==================== */

/* Tablet */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 300ms var(--ease-out);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 80px var(--space-6) var(--space-6);
        max-width: 100%;
    }

    .page-header {
        flex-direction: column;
        gap: var(--space-4);
    }

    .action-buttons { width: 100%; }
    .action-buttons .btn { flex: 1; }

    .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
    .kpi-bar { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .nav-link .nav-text-long { display: none; }
}

/* Mobile */
@media (max-width: 768px) {
    .main-content {
        padding: var(--space-5) var(--space-4) var(--space-5);
        padding-top: calc(var(--space-5) + env(safe-area-inset-top, 0px));
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .bottom-nav {
        display: flex !important;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .page-title { font-size: 22px; }

    .action-buttons {
        width: 100%;
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .action-buttons .btn-primary {
        flex: 1 1 100%;
        justify-content: center;
        order: -1;
    }

    .action-buttons .btn-secondary {
        flex: 1;
        justify-content: center;
        font-size: 12px;
        padding: 8px 12px;
    }

    .filters {
        flex-direction: column;
        gap: var(--space-3);
    }

    .search-box { max-width: 100%; width: 100%; }
    .filter-group { width: 100%; }
    .filter-select { width: 100%; }

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

    .card {
        padding: var(--space-5);
        border-radius: var(--radius-lg);
    }

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

    .section {
        padding: var(--space-5);
        margin-bottom: var(--space-4);
        border-radius: var(--radius-lg);
    }

    /* Touch targets */
    .btn {
        min-height: 48px;
        padding: 12px 20px;
        border-radius: var(--radius-lg);
        font-size: 14px;
    }

    .btn-sm {
        min-height: 36px;
        padding: 8px 12px;
    }

    .bottom-nav-item {
        padding: var(--space-2) var(--space-3);
        min-height: 48px;
    }

    .form-row, .fields-row, .fields-row-3 {
        grid-template-columns: 1fr !important;
        flex-direction: column;
    }

    .profile-name { display: none; }

    .form-row { flex-direction: column; }
    .form-group { width: 100%; }

    .chart-container { height: 250px; }

    .modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }

    .quick-actions {
        overflow-x: auto;
        padding-bottom: var(--space-2);
        -webkit-overflow-scrolling: touch;
    }

    .quick-action-btn { flex-shrink: 0; }
}

/* Small table responsive */
@media (max-width: 900px) {
    .table th, .table td { padding: 12px 14px; }
    .table th { font-size: 10px; }
    .table td { font-size: 13px; }
}

/* Small mobile */
@media (max-width: 480px) {
    .main-content {
        padding: var(--space-4) var(--space-3);
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }

    .page-title { font-size: 18px; }

    .action-buttons { flex-direction: column; }
    .action-buttons .btn { width: 100%; }

    .btn { padding: 10px 14px; }

    .kpi-card { padding: var(--space-4); }
    .kpi-value { font-size: 20px; }

    .section { padding: var(--space-3); }

    .logo h1 { font-size: 16px; }

    .drawer { width: 100%; }
    .drawer-header, .drawer-body, .drawer-footer { padding: var(--space-4); }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    .filter-label { margin-bottom: var(--space-1); margin-right: 0; }
    .filter-select { width: 100%; }
}


/* ==================== MOBILE "MEER" SHEET ==================== */
.mobile-more-sheet {
    display: none;
}
.mobile-more-sheet.open {
    display: block;
}
.mobile-more-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1100;
    animation: fadeIn 0.2s ease;
}
.mobile-more-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1101;
    background: var(--surface-solid, #fff);
    border-radius: 16px 16px 0 0;
    padding: 8px 0 calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.25s var(--ease-out);
}
.mobile-more-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 12px;
}
.mobile-more-nav {
    display: flex;
    flex-direction: column;
}
.mobile-more-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    text-align: left;
}
.mobile-more-item:hover,
.mobile-more-item:active {
    background: var(--surface-hover);
}
.mobile-more-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-muted);
}
.mobile-more-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 24px;
}
.mobile-more-danger {
    color: var(--danger) !important;
}
.mobile-more-danger svg {
    color: var(--danger) !important;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* ==================== PRINT ==================== */
@media print {
    .sidebar, .profile-menu, .mobile-menu-toggle,
    .bottom-nav, .action-buttons, .quick-actions, .filters {
        display: none !important;
    }
    .main-content { margin: 0; padding: 0; }
    .section { box-shadow: none; border: none; }
}


/* ==================== SKELETON LOADERS ==================== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-hover) 25%,
        rgba(226, 232, 240, 0.5) 50%,
        var(--surface-hover) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
    border-radius: var(--radius);
}

.skeleton-text { height: 1em; margin-bottom: 0.5em; border-radius: var(--radius-sm); }
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.long { width: 100%; }

.skeleton-card { height: 120px; border-radius: var(--radius-lg); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); }
.skeleton-button { width: 100px; height: 36px; border-radius: var(--radius); }

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

.skeleton-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) 20px;
    border-bottom: 1px solid var(--border-light);
}

.skeleton-row .skeleton-cell {
    height: 14px;
    border-radius: var(--radius-sm);
}

.skeleton-row .skeleton-cell:nth-child(1) { width: 80px; }
.skeleton-row .skeleton-cell:nth-child(2) { width: 150px; }
.skeleton-row .skeleton-cell:nth-child(3) { flex: 1; }
.skeleton-row .skeleton-cell:nth-child(4) { width: 100px; }


/* ==================== MICRO ANIMATIONS ==================== */

/* Staggered page content */
.main-content > .page-header,
.main-content > .welcome-header,
.main-content > .quick-actions,
.main-content > .kpi-bar,
.main-content > .dashboard-cards,
.main-content > .section,
.main-content > .card,
.main-content > .table-container,
.main-content > .filters,
.main-content > .demo-banner {
    animation: contentFadeIn 0.4s var(--ease-out) backwards;
}

.main-content > *:nth-child(1) { animation-delay: 0ms; }
.main-content > *:nth-child(2) { animation-delay: 40ms; }
.main-content > *:nth-child(3) { animation-delay: 80ms; }
.main-content > *:nth-child(4) { animation-delay: 120ms; }
.main-content > *:nth-child(5) { animation-delay: 160ms; }
.main-content > *:nth-child(6) { animation-delay: 200ms; }
.main-content > *:nth-child(7) { animation-delay: 240ms; }
.main-content > *:nth-child(8) { animation-delay: 280ms; }

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

/* Staggered card load */
.kpi-card, .quarter-card, .chart-card {
    animation: contentFadeIn 0.4s var(--ease-out) backwards;
}

.kpi-card:nth-child(1), .quarter-card:nth-child(1) { animation-delay: 50ms; }
.kpi-card:nth-child(2), .quarter-card:nth-child(2) { animation-delay: 100ms; }
.kpi-card:nth-child(3), .quarter-card:nth-child(3) { animation-delay: 150ms; }
.kpi-card:nth-child(4), .quarter-card:nth-child(4) { animation-delay: 200ms; }

/* Quick action ripple */
.quick-action-btn {
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--primary-bg);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 350ms var(--ease-out), height 350ms var(--ease-out);
}

.quick-action-btn:hover::before {
    width: 200%;
    height: 200%;
}

.quick-action-btn > * {
    position: relative;
    z-index: 1;
}


/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: var(--space-6);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toastSlideIn 0.3s var(--ease-spring);
    max-width: 400px;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info { border-left: 4px solid var(--info); }

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

.toast-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-bg); color: var(--danger); }
.toast-warning .toast-icon { background: var(--warning-bg); color: var(--warning); }
.toast-info .toast-icon { background: var(--info-bg); color: var(--info); }

.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.toast-message { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.toast-close {
    background: none;
    border: none;
    padding: var(--space-1);
    cursor: pointer;
    color: var(--text-muted);
    transition: color 100ms var(--ease-out);
    border-radius: var(--radius-sm);
}

.toast-close:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.toast.toast-exit {
    animation: toastSlideOut 0.2s var(--ease-in) forwards;
}

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

@keyframes toastSlideOut {
    to { opacity: 0; transform: translateX(100%); }
}


/* ==================== SPINNER ==================== */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; }
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.loading {
    animation: pulse 1.5s infinite;
}

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


/* ==================== PROGRESS BAR ==================== */
.progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-full);
    transition: width 400ms var(--ease-out);
}

.progress-bar-animated .progress-bar-fill {
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}


/* ==================== TOOLTIPS ==================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 10px;
    background: var(--text-primary);
    color: white;
    font-size: 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
    pointer-events: none;
    z-index: 1000;
    margin-bottom: 6px;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}


/* ==================== SCROLLBAR ==================== */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
    background-clip: content-box;
}


/* ==================== FOCUS ==================== */
:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-bg), 0 0 0 1px var(--primary-color);
}

:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}


/* ==================== KONFETTI ==================== */
@keyframes confetti-fall {
    0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: 0;
    z-index: 9999;
    pointer-events: none;
    animation: confetti-fall 3s linear forwards;
}


/* ==================== NUMBER COUNTER ==================== */
.counter-animate {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.counter-animate.counting {
    animation: counterPop 0.15s var(--ease-out);
}

@keyframes counterPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}


/* ==================== NOISE TEXTURE OVERLAY ==================== */
/* Subtle grain for depth — applied to body via pseudo-element */
.dashboard::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.018;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
}


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

    .skeleton {
        animation: none;
        background: var(--surface-hover);
    }

    .card:hover, .btn:hover, .btn:active,
    .kpi-card:hover, .table tbody tr:hover,
    .quarter-card:hover {
        transform: none !important;
    }

    @view-transition {
        navigation: none;
    }

    /* Disable noise texture */
    body::after {
        display: none;
    }
}
