﻿/* Icon styling for emoji fallback */
.icon-text {
    display: inline-block;
    font-size: 1.2em;
    line-height: 1;
    vertical-align: middle;
}

.topbar-icon-link .icon-text {
    margin-right: 4px;
}

/* GlassIcon component styles - Global fallback */
.glass-icon-xs {
    display: inline-block;
    font-size: 0.75rem;
    line-height: 1;
}

.glass-icon-sm {
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
}

.glass-icon-md {
    display: inline-block;
    font-size: 1.5rem;
    line-height: 1;
}

.glass-icon-lg {
    display: inline-block;
    font-size: 2rem;
    line-height: 1;
}

.glass-icon-xl {
    display: inline-block;
    font-size: 3rem;
    line-height: 1;
}

.glass-icon-xxl {
    display: inline-block;
    font-size: 4rem;
    line-height: 1;
}

.glass-icon-xl,
.glass-icon-xxl {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}

/* Bootstrap Icons - Ensure proper rendering */
.bi {
    display: inline-block;
    font-family: "bootstrap-icons" !important;
    font-style: normal;
    font-weight: normal !important;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    vertical-align: -0.125em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------------------------------------------------------
   APPLE THEME VARIABLES
--------------------------------------------------------- */
:root {
    --frost-bg: rgb(255, 255, 255, 1.00);
    --frost-border: rgba(255, 255, 255, 0.35);
    --frost-shadow: rgba(0, 0, 0, 0.25);
    --frost-blur: blur(0px);
    --text-color: #1a1a1a;
    --bg-color: linear-gradient(135deg, rgb(237, 237, 236), rgb(77, 187, 235));
    --glass-bg: rgb(190, 196, 221, .13);
    --glass-border: rgba(255, 255, 255, 0.35);
    --glass-shadow: rgba(0, 255, 255, 0.15);
    --glass-blur: blur(0px);
    --apple-table-row-bg: #ffffff;
    --apple-table-row-hover-bg: #f4f7fb;
    --apple-table-row-bg-soft: #edf1f6;
    --apple-table-row-bg-glass: rgba(255, 255, 255, 0.42);
    --apple-table-row-hover-glass: rgba(255, 255, 255, 0.58);
    --apple-table-header-color: #333;
    --apple-table-header-muted: #4b5563;
    --apple-table-row-shadow: 5px 5px 10px rgba(80, 90, 110, 0.08), -4px -4px 8px rgba(255, 255, 255, 0.28);
    --apple-table-row-shadow-left: -5px 4px 10px rgba(80, 90, 110, 0.08), 0 6px 10px rgba(80, 90, 110, 0.08);
    --apple-table-row-shadow-right: 5px 4px 10px rgba(80, 90, 110, 0.08), 0 6px 10px rgba(80, 90, 110, 0.08);
    --stat-card-bg: rgba(255, 255, 255, 0.92);
    --stat-card-border: rgba(255, 255, 255, 0.45);
    --stat-card-shadow: 10px 10px 22px rgba(80, 90, 110, 0.16), -8px -8px 18px rgba(255, 255, 255, 0.55), inset 1px 1px 2px rgba(255, 255, 255, 0.35);
    --stat-card-hover-shadow: 12px 12px 26px rgba(80, 90, 110, 0.2), -8px -8px 18px rgba(255, 255, 255, 0.62), inset 1px 1px 2px rgba(255, 255, 255, 0.4);
    --stat-card-shine: linear-gradient(145deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.1) 42%, rgba(255, 255, 255, 0) 70%);
    --stat-card-shine-opacity: 0.7;
    --stat-label-color: #6b7280;
    --stat-value-color: #1f2937;
}

    /* DARK MODE */
    :root.dark {
        --frost-bg: rgba(0, 0, 0, 1.00);
        --frost-border: rgba(255, 255, 255, 0.15);
        --frost-shadow: rgba(0, 0, 0, 0.6);
        --frost-blur: blur(0px);
        --text-color: #f5f5f5;
        --bg-color: linear-gradient(135deg, rgb(55, 55, 55), rgb(22, 22, 22));
        --glass-bg: rgba(0, 0, 0, 1.00);
        --glass-border: rgba(255, 255, 255, 0.15);
        --glass-shadow: rgba(0, 0, 255, 0.5);
        --glass-blur: blur(0px);
        --apple-table-row-bg: #1c1c1e;
        --apple-table-row-hover-bg: #2c2c2e;
        --apple-table-row-bg-soft: #2c2c2e;
        --apple-table-row-bg-glass: rgba(44, 44, 46, 0.78);
        --apple-table-row-hover-glass: rgba(58, 58, 60, 0.92);
        --apple-table-header-color: #f5f5f7;
        --apple-table-header-muted: #d1d1d6;
        --apple-table-row-shadow: 5px 5px 10px rgba(0, 0, 0, 0.35), -4px -4px 8px rgba(255, 255, 255, 0.03);
        --apple-table-row-shadow-left: -5px 4px 10px rgba(0, 0, 0, 0.35), 0 6px 10px rgba(0, 0, 0, 0.28);
        --apple-table-row-shadow-right: 5px 4px 10px rgba(0, 0, 0, 0.35), 0 6px 10px rgba(0, 0, 0, 0.28);
        --stat-card-bg: rgba(44, 44, 46, 0.92);
        --stat-card-border: rgba(255, 255, 255, 0.12);
        --stat-card-shadow: 10px 10px 22px rgba(0, 0, 0, 0.35), -8px -8px 18px rgba(255, 255, 255, 0.03), inset 1px 1px 2px rgba(255, 255, 255, 0.04);
        --stat-card-hover-shadow: 12px 12px 26px rgba(0, 0, 0, 0.45), -8px -8px 18px rgba(255, 255, 255, 0.04), inset 1px 1px 2px rgba(255, 255, 255, 0.06);
        --stat-card-shine: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 42%, rgba(255, 255, 255, 0) 70%);
        --stat-card-shine-opacity: 0.35;
        --stat-label-color: #d1d1d6;
        --stat-value-color: #f5f5f7;
    }

/* Smooth theme cross-fade (Chromium/Edge/Safari 18+) */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.45s;
    animation-timing-function: ease;
}

/* Fallback fade when View Transitions are unavailable */
html.theme-animating,
html.theme-animating body,
html.theme-animating .apple-shell,
html.theme-animating .apple-topbar,
html.theme-animating .map-layout-shell {
    transition: background 0.4s ease, background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none !important;
    }

    html.theme-animating,
    html.theme-animating body,
    html.theme-animating .apple-shell,
    html.theme-animating .apple-topbar,
    html.theme-animating .map-layout-shell {
        transition: none !important;
    }
}
/* Light mode defaults */
.apple-input,
input.apple-input,
textarea.apple-input {
    background: white;
    color: var(--apple-text);
    border: 1px solid var(--apple-border);
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dark mode overrides */
html.dark .apple-input,
html.dark input.apple-input,
html.dark textarea.apple-input {
    background: #1c1c1e; /* iOS dark input background */
    color: #f5f5f7; /* bright text */
    border: 1px solid #3a3a3c;
}

    /* Placeholder text in dark mode */
    html.dark .apple-input::placeholder,
    html.dark input.apple-input::placeholder,
    html.dark textarea.apple-input::placeholder {
        color: #8e8e93; /* iOS muted gray */
    }

/* ---------------------------------------------------------
   GLOBAL
--------------------------------------------------------- */
html {
    overflow-y: scroll; /* Always show scrollbar to prevent layout shift */
    scrollbar-gutter: stable; /* Modern browsers: reserve scrollbar space even when not scrolling */
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
.apple-section {
    display: flex;
    flex-direction: column;
}

    .apple-section .validation-message {
        order: -1; /* moves it above the input */
        color: #ff0000 !important; /* bright red */
        font-weight: 600;
        font-size: 1.1rem;
        margin-bottom: 6px;
    }
/* Validation summary (top of form) */
.validation-errors li {
    color: #ff0000 !important;
    font-weight: 600;
    font-size: 1.1rem;
}

/* ---------------------------------------------------------
   LAYOUT WRAPPER
--------------------------------------------------------- */
.apple-shell {
    min-height: 100vh;
    background: var(--bg-color);
    padding-bottom: 0px;
    /* backdrop-filter: blur(40px); REMOVED - creates stacking context that prevents search overlay */
}

/* ---------------------------------------------------------
   TOP BAR
--------------------------------------------------------- */
.apple-topbar {
    width: 100%;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    box-shadow:
        8px 8px 18px var(--glass-shadow),
        -8px -8px 18px rgba(255, 255, 255, 0.45),
        inset 0 0 25px rgba(255, 255, 255, 0.18);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-hover-zone {
    display: none;
}

html.topbar-autohide .topbar-hover-zone {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 18px;
    z-index: 99;
}

html.topbar-autohide .apple-topbar,
html.topbar-autohide .map-layout-shell .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(-110%);
    transition: transform 0.22s ease;
    pointer-events: none;
}

html.topbar-autohide.topbar-visible .apple-topbar,
html.topbar-autohide.topbar-visible .map-layout-shell .topbar,
html.topbar-autohide .apple-topbar:hover,
html.topbar-autohide .map-layout-shell .topbar:hover {
    transform: translateY(0);
    pointer-events: auto;
}

/* When the topbar auto-hides, floating elements anchored near the top
   (e.g. accounting-fab-menu) should sit closer to the real top edge
   instead of leaving space as if the topbar were always visible. */
html.topbar-autohide .accounting-fab-menu {
    top: 24px;
}

html.topbar-autohide.topbar-visible .accounting-fab-menu {
    top: 110px;
}

@media (hover: none) {
    html.topbar-autohide .topbar-hover-zone {
        height: 28px;
    }
}

    .apple-topbar::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: linear-gradient( 120deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.15) 40%, rgba(255,255,255,0) 70% );
        opacity: 0.55;
        mix-blend-mode: screen;
    }

    .apple-topbar::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-bottom: 1px solid rgba(255,255,255,0.55);
        box-shadow: inset 0 -20px 40px rgba(255,255,255,0.25);
    }

html.dark .apple-topbar {
    background: var(--glass-bg);
    box-shadow:
        8px 8px 18px rgba(0, 0, 0, 0.45),
        -6px -6px 14px rgba(255, 255, 255, 0.04),
        inset 0 0 20px rgba(255, 255, 255, 0.04);
}



.topbar-inner {
    width: 90%;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 1;
    flex-wrap: wrap;
    min-width: 0;
}

.topbar-center {
    display: flex;
    justify-content: center;
    flex: 1 1 280px;
    min-width: 0;
    overflow: visible;
}

.topbar-emoji-link {
    text-decoration: none;
    line-height: 1;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid var(--glass-border);
    box-shadow:
        5px 5px 10px rgba(80, 90, 110, 0.18),
        -4px -4px 8px rgba(255, 255, 255, 0.45);
}

    .topbar-emoji-link:hover {
        transform: translateY(-1px);
        background: rgba(255, 255, 255, 0.32);
        box-shadow:
            7px 7px 14px rgba(80, 90, 110, 0.22),
            -5px -5px 10px rgba(255, 255, 255, 0.55);
    }

    .topbar-emoji-link:active {
        transform: none;
        box-shadow:
            inset 4px 4px 8px rgba(80, 90, 110, 0.18),
            inset -4px -4px 8px rgba(255, 255, 255, 0.4);
    }

html.dark .topbar-emoji-link {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
        5px 5px 10px rgba(0, 0, 0, 0.4),
        -4px -4px 8px rgba(255, 255, 255, 0.04);
}

.topbar-img-icon {
    height: 3rem;
    width: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}

.topbar-map-button {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid var(--glass-border);
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    box-shadow:
        5px 5px 10px rgba(80, 90, 110, 0.18),
        -4px -4px 8px rgba(255, 255, 255, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .topbar-map-button:hover {
        transform: translateY(-1px);
        background: rgba(255, 255, 255, 0.32);
        box-shadow:
            7px 7px 14px rgba(80, 90, 110, 0.22),
            -5px -5px 10px rgba(255, 255, 255, 0.55);
    }

    .topbar-map-button:active {
        transform: none;
        box-shadow:
            inset 4px 4px 8px rgba(80, 90, 110, 0.18),
            inset -4px -4px 8px rgba(255, 255, 255, 0.4);
    }

html.dark .topbar-map-button {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
        5px 5px 10px rgba(0, 0, 0, 0.4),
        -4px -4px 8px rgba(255, 255, 255, 0.04);
}

    .topbar-map-button img {
        height: 3rem;
        width: auto;
        display: block;
        filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
    }

.topbar-icon-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.topbar-logo-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    
}

.topbar-logo {
    height: 42px;
    width: auto;
    border-radius: 12px;
}

/* NAV RIGHT SIDE ------------------------------------------- */

.top-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
    /* ---------------------------------------------------------
   ADMIN BUTTON — FINAL VERSION
--------------------------------------------------------- */
.adminbutton {
    padding: 8px 18px;
    border-radius: 16px;
    background: rgba(249, 89, 2, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #111;
    text-decoration: none;
    font-family: 'Poppins', system-ui, sans-serif;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: left;
    box-shadow:
        5px 5px 10px rgba(80, 90, 110, 0.18),
        -4px -4px 8px rgba(255, 255, 255, 0.45);
    transition: 0.18s ease-in-out;
}

   .adminbutton:hover {
       background: rgba(255, 255, 255, 0.75);
       transform: translateY(-1px);
       box-shadow:
           7px 7px 14px rgba(80, 90, 110, 0.22),
           -5px -5px 10px rgba(255, 255, 255, 0.55);
}

/* ---------------------------------------------------------
   CENTERED CONTENT
--------------------------------------------------------- */
.apple-main {
    height: 100vh;
    overflow-y: scroll; /* Changed from 'auto' to always show scrollbar */
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 2rem 1.75rem;
    box-sizing: border-box;
    /* position:relative removed — combining overflow+position traps fixed children in a stacking context */
}

.apple-container {
    max-width: 1600px;
    width: 100%;
    min-width: 0; /* Prevent flex items from overflowing */
}

    /* Wide desktop pages */
    .apple-container.wide {
        max-width: 1600px; /* adjust to taste */
    }

    /* Optional: ultra-wide pages */
    .apple-container.full {
        max-width: 100%;
    }

/* ---------------------------------------------------------
   BARE / PUBLIC INFO PAGES
--------------------------------------------------------- */
.apple-main2 {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 2rem 1.75rem;
    box-sizing: border-box;
    background: #ffffff;
    overflow-y: auto;
}

.apple-container2 {
    max-width: 640px;
    width: 100%;
    min-width: 0;
}

html:has(.apple-main2),
html:has(.apple-main2) body {
    background: #ffffff;
}

body:has(.apple-main2) .theme-switch,
body:has(.apple-main2) .theme-toggle,
body:has(.apple-main2) .beta-feedback-bar,
body:has(.apple-main2) .apple-topbar,
body:has(.apple-main2) .app-footer,
body:has(.apple-main2) .back-to-top,
body:has(.apple-main2) .location-pill {
    display: none !important;
}


/* ---------------------------------------------------------
   TILE GRID (AUTO MOBILE FRIENDLY)
--------------------------------------------------------- */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.tile {
    text-align: center;
    padding: 1.25rem;
}

/* ---------------------------------------------------------
   GLASS CARDS
--------------------------------------------------------- */
.apple-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 1.5rem;
    box-shadow:
        10px 10px 22px rgba(80, 90, 110, 0.18),
        -8px -8px 18px rgba(255, 255, 255, 0.45),
        inset 1px 1px 2px rgba(255, 255, 255, 0.28);
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 1.5rem auto;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
    transition: padding 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, transform 0.15s ease;
}

    /* Inner highlight (Apple shine) */
    .apple-card::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 22px;
        pointer-events: none;
        background: linear-gradient( 145deg, rgba(255,255,255,0.38) 0%, rgba(255,255,255,0.12) 42%, rgba(255,255,255,0) 70% );
        opacity: 0.7;
        mix-blend-mode: screen;
    }

    /* Outer rim light + edge glow */
    .apple-card::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 22px;
        pointer-events: none;
        border: 1px solid rgba(255,255,255,0.45);
        box-shadow: inset 0 0 28px rgba(255,255,255,0.22);
    }

    /* Refraction layer (the realism effect) */
    .apple-card .glass-refraction {
        position: absolute;
        inset: 0;
        background: inherit;
        filter: blur(1px) saturate(180%);
        transform: translate(-5px, -5px);
        opacity: 0.28;
        pointer-events: none;
    }



/* ---------------------------------------------------------
   LISTS
--------------------------------------------------------- */
.apple-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.apple-list-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: var(--text-color);
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

    .apple-list-item:last-child {
        border-bottom: none;
    }

.muted {
    opacity: 0.6;
}

/* ---------------------------------------------------------
   INPUTS
--------------------------------------------------------- */
.apple-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--frost-border);
    background: var(--frost-bg);
    backdrop-filter: var(--frost-blur);
    box-shadow:
        inset 4px 4px 8px rgba(80, 90, 110, 0.1),
        inset -4px -4px 8px rgba(255, 255, 255, 0.35);
    margin-bottom: 1rem;
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   BUTTONS
--------------------------------------------------------- */
.apple-button {
    background: var(--frost-bg);
    border: 1px solid var(--frost-border);
    padding: 0.5rem 1rem;
    border-radius: 14px;
    font-weight: 400;
    cursor: pointer;
    backdrop-filter: var(--frost-blur);
    box-shadow:
        5px 5px 10px rgba(80, 90, 110, 0.16),
        -4px -4px 8px rgba(255, 255, 255, 0.5);
    transition: 0.2s ease;
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

    .apple-button:hover {
        background: white;
        transform: translateY(-1px);
        box-shadow:
            7px 7px 14px rgba(80, 90, 110, 0.2),
            -5px -5px 10px rgba(255, 255, 255, 0.6);
    }

    .apple-button:active {
        transform: none;
        box-shadow:
            inset 4px 4px 8px rgba(80, 90, 110, 0.16),
            inset -4px -4px 8px rgba(255, 255, 255, 0.45);
    }

    .apple-button.danger {
        border-color: #ff6b6b;
        background: #efefef;
        color: #ff6b6b;
        box-shadow:
            5px 5px 10px rgba(80, 90, 110, 0.16),
            -4px -4px 8px rgba(255, 255, 255, 0.5);
    }
/* Dark mode buttons */
html.dark .apple-button {
    background: #ce770a; 
    color: #f5f5f7;
    border: 1px solid #1c1c1e;
}

    /* Hover effect */
    html.dark .apple-button:hover {
        background: #ff5804; /* iOS hover blue */
    }

    /* Danger button in dark mode */
    html.dark .apple-button.danger {
        background: #560501; /* iOS system red */
        color: white;
    }

        html.dark .apple-button.danger:hover {
            background: #ff6961;
        }

/* ---------------------------------------------------------
   QUICK ACTION ROW
--------------------------------------------------------- */
.action-row {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ---------------------------------------------------------
   ANIMATED DAY/NIGHT THEME TOGGLE
--------------------------------------------------------- */
.theme-switch {
    position: fixed;
    top: 12px;
    right: 16px;
    display: inline-block;
    width: 75px;
    height: 75px;
    cursor: pointer;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
    z-index: 9999;
    view-transition-name: theme-switch;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    overflow: hidden;
    isolation: isolate;
    border: 4px solid #ffffff;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.15),
        inset 0 6px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, #5ab5e6 0%, #aee0ff 100%);
    z-index: 1;
    transition: border-color 0.8s ease;
}

.switch-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #0b1325 0%, #1a2845 100%);
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: -1;
}

.sky-vault {
    position: absolute;
    width: 100%;
    height: 200%;
    top: 0;
    left: 0;
    transform: translateZ(0);
    transform-origin: 50% 50%;
    transition: transform 0.9s cubic-bezier(0.5, 0.1, 0.3, 1);
    z-index: 2;
    backface-visibility: visible;
}

.sun,
.moon {
    position: absolute;
    width: 20px;
    height: 20px;
    left: calc(50% - 14px);
    border-radius: 50%;
    backface-visibility: visible;
    transform: translateZ(0);
}

.sun {
    top: 9px;
    background: linear-gradient(145deg, #fffcf0, #ffd300);
    box-shadow:
        0 0 15px rgba(255, 211, 0, 0.6),
        inset -2px -2px 6px rgba(0, 0, 0, 0.1);
}

.moon {
    bottom:9px;
    background: linear-gradient(145deg, #e2e2e5, #8a8e94);
    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.4),
        inset -2px -2px 6px rgba(0, 0, 0, 0.3);
    transform: translateZ(0) rotate(180deg);
}

.craters {
    position: absolute;
    width: 100%;
    height: 100%;
}

.crater {
    position: absolute;
    background: #7a7e85;
    border-radius: 50%;
    box-shadow:
        inset 1px 1px 2px rgba(0, 0, 0, 0.4),
        inset -1px -1px 2px rgba(255, 255, 255, 0.8);
}

.crater-1 {
    width: 6px;
    height: 6px;
    top: 4px;
    left: 4px;
}

.crater-2 {
    width: 3px;
    height: 3px;
    top: 12px;
    left: 3px;
}

.crater-3 {
    width: 3px;
    height: 3px;
    top: 12px;
    left: 12px;
}

.sky-clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: 0.8s ease;
    opacity: 1;
    z-index: 1;
}

.cloud {
    position: absolute;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cloud-1 {
    width: 32px;
    height: 12px;
    top: 32px;
    left: -8px;
}

.cloud-1::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: -7px;
    left: 8px;
}

.cloud-2 {
    width: 26px;
    height: 10px;
    top: 50px;
    right: -6px;
}

.cloud-2::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: -6px;
    left: 6px;
}

.sky-stars {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: 0.8s ease;
    opacity: 0;
    transform: translateY(-15px);
    z-index: 1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 3px white;
}

.star-1 {
    width: 2px;
    height: 2px;
    top: 18px;
    left: 18px;
}

.star-2 {
    width: 3px;
    height: 3px;
    top: 28px;
    left: 60px;
}

.star-3 {
    width: 2px;
    height: 2px;
    top: 45px;
    left: 22px;
}

.star-4 {
    width: 1.5px;
    height: 1.5px;
    top: 18px;
    left: 45px;
}

.landscape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 3;
    pointer-events: none;
}

.mountain {
    position: absolute;
    bottom: 12px;
    width: 0;
    height: 0;
    border-left: 24px solid transparent;
    border-right: 24px solid transparent;
    transition: border-bottom-color 0.8s ease;
}

.mountain-1 {
    left: -8px;
    border-bottom: 42px solid #4ca382;
}

.mountain-2 {
    right: -8px;
    border-bottom: 32px solid #65b899;
}

.terrain {
    position: absolute;
    bottom: -20px;
    left: -15px;
    width: 120px;
    height: 40px;
    background: #348e6a;
    border-radius: 50%;
    transition: background 0.8s ease;
}

.tree {
    position: absolute;
    width: 18px;
    height: 26px;
    filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.25));
    z-index: 4;
}

.tree::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 85%;
    background: linear-gradient(90deg, #3aa673 0%, #236b47 50%, #15452d 100%);
    clip-path: polygon(
        50% 0%,
        80% 35%,
        60% 35%,
        90% 70%,
        65% 70%,
        100% 100%,
        0% 100%,
        35% 70%,
        10% 70%,
        40% 35%,
        20% 35%
    );
    transition: background 0.8s ease;
}

.tree::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 40%;
    width: 20%;
    height: 15%;
    background: linear-gradient(90deg, #704629 0%, #4a2d1a 100%);
    transition: background 0.8s ease;
    border-radius: 1px;
}

.tree-1 {
    left: 14px;
    bottom: 12px;
    transform: scale(0.85);
}

.tree-2 {
    right: 18px;
    bottom: 14px;
    transform: scale(1.05);
}

.tree-3 {
    left: 32px;
    bottom: 7px;
    transform: scale(0.65);
    z-index: 5;
}

.tree-3::before {
    background: linear-gradient(90deg, #2d8a5c 0%, #1a5436 50%, #0f3621 100%);
}

/* Night mode transitions */
.theme-switch input:checked + .switch-bg {
    border-color: #2a3b5c;
}

.theme-switch input:checked + .switch-bg::before {
    opacity: 1;
}

.theme-switch input:checked + .switch-bg .sky-vault {
    transform: translateZ(0) rotate(180deg);
}

.theme-switch input:checked + .switch-bg .sky-clouds {
    opacity: 0;
    transform: translateY(15px);
}

.theme-switch input:checked + .switch-bg .sky-stars {
    opacity: 1;
    transform: translateY(0);
}

.theme-switch input:checked + .switch-bg .landscape .mountain-1 {
    border-bottom-color: #162238;
}

.theme-switch input:checked + .switch-bg .landscape .mountain-2 {
    border-bottom-color: #1e2c45;
}

.theme-switch input:checked + .switch-bg .landscape .terrain {
    background: #0d1526;
}

.theme-switch input:checked + .switch-bg .landscape .tree::before {
    background: linear-gradient(90deg, #1a283b 0%, #101a29 50%, #070c14 100%);
}

.theme-switch input:checked + .switch-bg .landscape .tree-3::before {
    background: linear-gradient(90deg, #131e2e 0%, #0b121f 50%, #05080f 100%);
}

.theme-switch input:checked + .switch-bg .landscape .tree::after {
    background: linear-gradient(90deg, #111a26 0%, #080d14 100%);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .theme-switch {
        width: 70px;
        height: 70px;
        top: 12px;
        right: 12px;
    }

    .sun, .moon {
        width: 22px;
        height: 22px;
    }

    .sun {
        left: calc(50% - 11px);
    }

    .moon {
        left: calc(50% - 11px);
    }
}

@media (max-width: 480px) {
    .theme-switch {
        width: 60px;
        height: 60px;
        top: 10px;
        right: 10px;
    }

    .sun, .moon {
        width: 18px;
        height: 18px;
    }

    .sun {
        left: calc(50% - 9px);
        top: 8px;
    }

    .moon {
        left: calc(50% - 9px);
        bottom: 8px;
    }
}

/* OLD THEME TOGGLE STYLES - DEPRECATED */
.theme-fab-toggle,
.theme-fab-icon,
.theme-fab-menu,
.theme-fab-main,
.theme-fab-items,
.theme-fab-item,
.theme-item-icon,
.theme-label {
    display: none !important;
}

.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    background: var(--frost-bg);
    backdrop-filter: var(--frost-blur);
    border: 1px solid var(--frost-border);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--frost-shadow);
    transition: 0.2s ease;
}

    .theme-toggle:hover {
        background: rgba(255,255,255,0.5);
        transform: scale(1.1);
    }

    .theme-toggle .theme-icon {
        display: inline-block;
        line-height: 1;
        font-size: 1.5rem;
    }

    /* Remove previous Bootstrap Icon color styling */
    .theme-toggle .bi-sun,
    .theme-toggle .bi-moon {
        color: inherit;
        filter: none;
    }

/* Dropdown header and arrow styling */
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 1rem;
    user-select: none;
    border-radius: 8px;
    will-change: auto; /* Reset will-change to avoid unnecessary repaints */
    /* Removed hover background transition - just keep pointer cursor */
}

/* Emoji-based dropdown arrows */
.dropdown-arrow-emoji {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

/* Bootstrap Icons dropdown arrows (fallback) */
.dropdown-arrow {
    font-family: "bootstrap-icons" !important;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.dropdown-arrow::before {
    content: "\f282"; /* bi-chevron-down */
}

.dropdown-header.expanded .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    overflow: hidden;
    animation: expandIn 0.25s ease forwards;
}

@keyframes expandIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inline-form {
    padding: 16px;
    background: var(--apple-card);
    border-radius: var(--apple-radius);
    border: 1px solid var(--apple-border);
    margin-bottom: 16px;
    box-shadow: var(--apple-shadow);
}

    .inline-form .apple-input {
        margin-bottom: 10px;
        width: 100%;
    }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.action-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.date-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

    .date-row label {
        font-size: 13px;
        color: var(--apple-muted);
        margin-bottom: 4px;
    }
.drop-zone {
    position: relative;
    border: 2px dashed var(--apple-border);
    background: #fafafa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
}

.drop-zone-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.search-container {
    padding: 0 16px;
    margin-bottom: 12px;
}

    .search-container input {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        display: block;
    }
.search-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 16px;
    box-sizing: border-box;
}

    .search-wrapper .apple-input {
        width: 100%;
        max-width: 600px;
    }
.tile-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Makes the link fill the tile */
}

    .tile-link .apple-card {
        cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .tile-link:hover .apple-card {
        transform: translateY(-2px);
        box-shadow:
            14px 14px 28px rgba(80, 90, 110, 0.22),
            -10px -10px 22px rgba(255, 255, 255, 0.5),
            inset 1px 1px 2px rgba(255, 255, 255, 0.3);
    }
/* Alphabet Jump Bar */
.alphabet-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1rem;
    justify-content: center;
}

.alphabet-letter {
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    transition: 0.15s ease;
}

    .alphabet-letter:hover {
        background: #e5e5e5;
        transform: scale(1.1);
    }

/* Letter Section Header */
.letter-header {
    margin: 0;
    padding: 0.5rem 0;
    font-weight: 700;
    font-size: 1.2rem;
    border-bottom: 1px solid #ddd;
}

/* Avatar */
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #007aff;
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 1rem;
}

/* Customer Info */
.customer-info {
    flex: 1;
    color: var(--text-color);
}

.customer-info strong {
    color: var(--text-color);
}

.customer-info .muted {
    color: var(--text-color);
    opacity: 0.65;
}
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff5e00;
    color: white;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: fadeInOut 1s ease;
    z-index: 999999;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
}
.badge-commercial {
    background: rgba(255,255,255,0.35);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    margin-left: 6px;
    color: #333;
}
/* Style Google Places Autocomplete Dropdown */
.google-visual-element,
.pac-container,
.pac-item {
    font-family: inherit !important;
    background-color: #fcfcfc !important; /* Match your dark theme */
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
}

.pac-item {
    padding: 10px 12px !important;
}

    .pac-item:hover {
        background-color: #e0e0e0 !important;
    }

.pac-matched {
    color: #4da6ff !important; /* Highlight color */
    font-weight: bold;
}

/* Make it wider if needed */
.pac-container {
    width: 100% !important;
    max-width: 500px !important;
}
.pac-item span {
    color: #3a3a3a !important;
    font-weight: bold;
}
.apple-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.apple-page-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 1.5rem 0;
}

.apple-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.apple-card-body {
    padding: 1.25rem 1.5rem;
}

.apple-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 2rem;
}

.notes-split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 2rem;
}

@media (max-width: 700px) {
    .notes-split-grid {
        grid-template-columns: 1fr;
    }
}

.apple-field-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #555;
}

.apple-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.9);
    outline: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

    .apple-input:focus {
        border-color: #007aff;
        box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
    }

.apple-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: -1px;
}

    .apple-table th {
        text-align: left;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--apple-table-header-color);
        padding: 0 0.75rem 0.5rem;
    }

    .apple-table td {
        padding: 0.5rem 0.75rem;
        vertical-align: middle;
        background: var(--apple-table-row-bg);
        color: var(--text-color);
        border-top: transparent;
        border-bottom: transparent;
    }

    /* Color indicator sliver on first cell when color scheme is applied */
    .apple-table tr td:first-child[style*="--color-indicator"] {
        background: linear-gradient(to right, var(--color-indicator) 0, var(--color-indicator) 8px, var(--apple-table-row-bg) 8px, var(--apple-table-row-bg) 100%);
        padding-left: 14px;
    }

    .apple-table tr td:first-child {
        border-left: transparent;
        border-top-left-radius: 14px;
        border-bottom-left-radius: 14px;
    }

    .apple-table tr td:last-child {
        border-right: transparent;
        border-top-right-radius: 14px;
        border-bottom-right-radius: 14px;
    }

.work-hours-calculator-card {
    max-width: 1600px;
}

.work-hours-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.work-hours-time-input {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.work-hours-period-select {
    width: 5.5rem;
    flex: 0 0 5.5rem;
    margin-bottom: 0;
}

.login-card {
    max-width: 520px;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-logo {
    max-width: 180px;
    width: 100%;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.login-card .apple-field-group {
    margin-bottom: 1rem;
}

.login-card .apple-actions {
    margin-top: 1rem;
}

.apple-login-error {
    margin-bottom: 1rem;
    font-weight: 600;
}

.apple-link {
    color: #007aff;
    text-decoration: none;
    font-weight: 600;
}

    .apple-link:hover {
        text-decoration: underline;
    }

.work-hours-break-input {
    width: 100%;
    margin-bottom: 0;
}

.work-hours-table strong {
    font-size: 1rem;
}

.apple-button-primary,
.apple-button-secondary,
.apple-button-danger {
    border-radius: 18px;
    padding: 0.45rem 1.1rem;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.apple-button-primary {
    background: linear-gradient(135deg, #000000, #3f3f3f);
    color: white;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    padding: 0.55rem 1.2rem;
    font-weight: 600;
    box-shadow:
        6px 6px 12px rgba(0, 0, 0, 0.28),
        -3px -3px 8px rgba(255, 255, 255, 0.18),
        inset 1px 1px 1px rgba(255, 255, 255, 0.12);
    transition: 0.2s ease;
}

    .apple-button-primary:hover {
        transform: translateY(-1px);
        background: linear-gradient(135deg, #000000, #727272);
        box-shadow:
            8px 8px 16px rgba(0, 0, 0, 0.32),
            -4px -4px 10px rgba(255, 255, 255, 0.2),
            inset 1px 1px 1px rgba(255, 255, 255, 0.16);
    }


.apple-button-secondary {
    background: linear-gradient(135deg, #a84300, #ff8a00);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 0.55rem 1.2rem;
    font-weight: 600;
    box-shadow:
        6px 6px 12px rgba(168, 67, 0, 0.28),
        -3px -3px 8px rgba(255, 255, 255, 0.28),
        inset 1px 1px 1px rgba(255, 255, 255, 0.22);
    transition: 0.2s ease;
}

    .apple-button-secondary:hover {
        transform: translateY(-1px);
        box-shadow:
            8px 8px 16px rgba(168, 67, 0, 0.32),
            -4px -4px 10px rgba(255, 255, 255, 0.32),
            inset 1px 1px 1px rgba(255, 255, 255, 0.26);
    }


.apple-button-danger {
    background: #ff3b30;
    color: white;
    font-weight: 600;
    box-shadow:
        6px 6px 12px rgba(255, 59, 48, 0.28),
        -3px -3px 8px rgba(255, 255, 255, 0.22),
        inset 1px 1px 1px rgba(255, 255, 255, 0.18);
}

    .apple-button-primary:hover,
    .apple-button-secondary:hover,
    .apple-button-danger:hover {
        transform: translateY(-1px);
    }

    .apple-button-primary:active,
    .apple-button-secondary:active,
    .apple-button-danger:active {
        transform: none;
        box-shadow:
            inset 4px 4px 8px rgba(0, 0, 0, 0.22),
            inset -3px -3px 6px rgba(255, 255, 255, 0.12);
    }

.apple-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    .apple-table th,
    .apple-table td {
        padding: 0.55rem 0.4rem;
        text-align: left;
    }

    .apple-table thead {
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

.apple-actions-right {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.apple-error-box,
.apple-error-box ul,
.apple-error-box li,
.apple-error-text {
    color: #ff3b30;
}

.apple-error-box li,
.apple-error-text {
    font-weight: 600;
}

/* ---------------------------------------------------------
   STATUS BADGES
--------------------------------------------------------- */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.status-draft {
    background: #e0e0e0;
    color: #555;
}

.status-badge.status-sent {
    background: #b3d9ff;
    color: #004080;
}

.status-badge.status-partiallypaid {
    background: #fff4cc;
    color: #806600;
}

.status-badge.status-paid {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.status-overdue {
    background: #fed7d7;
    color: #742a2a;
}

.status-badge.status-voided {
    background: #e0e0e0;
    color: #333;
    text-decoration: line-through;
}

.status-badge.status-scheduled {
    background: #ffd9b3;
    color: #663300;
}

.status-badge.status-inprogress {
    background: #cce5ff;
    color: #003d66;
}

.status-badge.status-completed {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.status-invoiced {
    background: #d6b3ff;
    color: #4d0099;
}

/* ---------------------------------------------------------
   INVOICE LIST RESPONSIVE LAYOUT
--------------------------------------------------------- */

/* Table container with horizontal scroll on small screens */
.invoice-table-container {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

.invoice-table-desktop {
    width: 100%;
    min-width: 800px; /* Minimum width before horizontal scroll kicks in */
}

/* Mobile optimization - smaller fonts and tighter spacing */
@media (max-width: 768px) {
    .invoice-table-desktop {
        font-size: 0.85rem;
        min-width: 700px;
    }

    .invoice-table-desktop th,
    .invoice-table-desktop td {
        padding: 8px 6px;
        white-space: nowrap;
    }

    .invoice-table-desktop td:nth-child(2) {
        /* Customer column - allow wrapping */
        white-space: normal;
        min-width: 120px;
        max-width: 150px;
        word-wrap: break-word;
    }

    .invoice-table-desktop .apple-button-secondary {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

/* Tablet optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .invoice-table-desktop {
        font-size: 0.9rem;
    }

    .invoice-table-desktop th,
    .invoice-table-desktop td {
        padding: 10px 8px;
    }

    .invoice-table-desktop .apple-button-secondary {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
}
.apple-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--frost-border);
    background: var(--frost-bg);
    backdrop-filter: var(--frost-blur);
    margin-bottom: 1rem;
    box-sizing: border-box;
    color: var(--text-color);
    font-size: 1rem;
    appearance: none;
    /* Arrow */
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5.516 7.548l4.484 4.484 4.484-4.484L16 8.548l-6 6-6-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 2.5rem;
}

/* Dark mode */
html.dark .apple-select {
    background: #1c1c1e;
    color: #f5f5f7;
    border: 1px solid #3a3a3c;
}

/* =========================================================
   MISSING COMPONENT + UTILITY CLASSES
   ========================================================= */

.apple-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 1000;
    margin-bottom: 0.35rem;
    opacity: 0.75;
}

.apple-section-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 0 1.25rem;
}

.apple-card-title {
    font-size: 1rem;
    font-weight: 1200;
    margin: 0;
}

.apple-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.55;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1rem 0 0.5rem;
}

.apple-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 1rem 0;
}

/* Horizontal field row: label left, input right */
.apple-field-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

    .apple-field-row label {
        font-size: 0.85rem;
        font-weight: 500;
        opacity: 0.75;
    }

/* Generic action / button groups */
.apple-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
    align-items: center;
}

.apple-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.75rem;    
    align-items: center;
}

/* Key-value detail rows (customer details, etc.) */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.5rem;
}

    .detail-row:last-of-type {
        border-bottom: none;
    }

.detail-label {
    font-size: 0.85rem;
    opacity: 0.65;
    flex-shrink: 0;
    min-width: 120px;
}

.detail-value {
    text-align: right;
    word-break: break-word;
    font-weight: 500;
}

/* Page wrapper variant */
.apple-page {
    padding: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Utility spacing / layout helpers */
.apple-mb   { margin-bottom: 1.5rem; }
.apple-gap-lg { gap: 1.5rem; }

.apple-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

/* Nav list (NavMenu.razor) */
.apple-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

    .apple-nav li a,
    .apple-nav li .logout-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 7px 14px;
        border-radius: 20px;
        text-decoration: none;
        color: inherit;
        font-size: 0.9rem;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: background 0.15s ease;
        font-family: inherit;
    }

    .apple-nav li a:hover,
    .apple-nav li .logout-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
}

/* =========================================================
   RESPONSIVE: HALF-SCREEN PC / SMALL LAPTOP  (≤ 1200px)
   ========================================================= */
@media (max-width: 1200px) {
    .topbar-inner {
        width: 100%;
        padding: 8px 16px;
        gap: 0.4rem 0.75rem;
    }

    .topbar-left {
        gap: 10px;
        flex-wrap: wrap;
    }

    .topbar-center {
        flex-basis: 100%;   /* push search/selectors onto their own row */
        width: 100%;
        margin-top: 2px;
    }

    .location-logo-frame {
        height: 52px;
        max-width: 220px;
    }

    .location-logo {
        max-height: 52px;
    }
}

/* =========================================================
   RESPONSIVE: TABLET  (≤ 1024px)
   ========================================================= */
@media (max-width: 1024px) {
    .apple-container,
    .apple-container.wide {
        max-width: 100%;
        padding: 0 1.25rem;
    }

    .apple-card {
        max-width: 100%;
    }

    .apple-page-container {
        padding: 1rem;
    }

    .apple-grid-2 {
        gap: 0.75rem 1.25rem;
    }

    .apple-field-row {
        grid-template-columns: 140px 1fr;
    }
}

/* =========================================================
   RESPONSIVE: MOBILE  (≤ 768px)
   ========================================================= */
@media (max-width: 768px) {
    /* --- Layout --- */
    .apple-main {
        height: auto;
        min-height: calc(100svh - 60px);
        padding: 1rem 0.75rem;
    }

    .apple-container,
    .apple-container.wide,
    .apple-container.full {
        max-width: 100%;
        padding: 0;
    }

    .apple-card {
        max-width: 100%;
        padding: 1rem 0.9rem;
        border-radius: 16px;
        margin-bottom: 1rem;
    }

    .apple-page,
    .apple-page-container {
        padding: 0.75rem;
    }

    /* --- Topbar --- */
    .topbar-inner {
        padding: 0.5rem 0.6rem;
        width: 100%;
        gap: 0.4rem;
    }

    .topbar-logo {
        height: 32px;
    }

    .topbar-left {
        gap: 8px;
        flex-wrap: wrap;
    }

    .topbar-center {
        width: 100%;
        flex-basis: 100%;
        margin-top: 0.25rem;
    }

    /* Move theme toggle to bottom-right on mobile to avoid topbar overlap */
    .theme-toggle {
        top: auto;
        bottom: 16px;
        right: 16px;
        padding: 7px 12px;
        font-size: 1.1rem;
    }

    /* --- Typography --- */
    .apple-page-title {
        font-size: 1.4rem;
        margin: 0.75rem 0;
    }

    .apple-section-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    /* --- Field rows: stack label above input --- */
    .apple-field-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
        margin-bottom: 0.6rem;
    }

    /* --- Actions / button rows: stay flex-row but wrap --- */
    .apple-actions,
    .apple-button-row,
    .action-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.45rem;
        margin-top: 0.75rem;
    }

    /* --- Detail rows: stack --- */
    .detail-row {
        flex-direction: column;
        gap: 0.15rem;
    }

    .detail-value {
        text-align: left;
    }

    /* --- Grids --- */
    .apple-grid-2,
    .apple-grid-3,
    .apple-grid-4 {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    .tile-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* --- Tables: horizontal scroll --- */
    .apple-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- List items: stack content on small screens --- */
    .apple-list-item {
        flex-direction: column;
        gap: 0.4rem;
        align-items: flex-start;
    }

    /* --- Section headers --- */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* --- Inline forms --- */
    .inline-form {
        padding: 0.75rem;
    }

    /* --- Search --- */
    .search-container,
    .search-wrapper {
        padding: 0 0.5rem;
    }

    /* --- Toast: full-ish width on mobile --- */
    .toast {
        bottom: 72px;
        width: 85%;
        max-width: 340px;
        text-align: center;
        font-size: 0.9rem;
    }

    /* --- Admin button --- */
    .adminbutton {
        padding: 6px 12px;
        font-size: 14px;
    }

    /* --- Actions-right: left-align on mobile --- */
    .apple-actions-right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    /* --- Alphabet jump bar --- */
    .alphabet-bar {
        gap: 4px;
    }

    .alphabet-letter {
        padding: 3px 6px;
        font-size: 0.82rem;
    }
}

/* =========================================================
   RESPONSIVE: SMALL PHONE  (≤ 480px)
   ========================================================= */
@media (max-width: 480px) {
    .tile-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.55rem;
        margin-bottom: 1.25rem;
    }

    .tile {
        padding: 0.9rem 0.5rem;
    }

        .tile h3 {
            font-size: 1.2rem;
        }

    .apple-card {
        padding: 0.75rem;
        border-radius: 14px;
    }

    .apple-button,
    .apple-button-primary,
    .apple-button-secondary,
    .apple-button-danger {
        font-size: 0.82rem;
        padding: 0.4rem 0.8rem;
    }

    .topbar-inner {
        padding: 0.5rem 0.75rem;
    }

    .topbar-logo {
        height: 40px;
    }

    .apple-page-title {
        font-size: 1.25rem;
    }

    .apple-section-title {
        font-size: 1.1rem;
    }
}

/* =========================================================
   TOUCH DEVICE: disable hover-only transforms / effects
   ========================================================= */
@media (hover: none) {
    .apple-button:hover,
    .apple-button-primary:hover,
    .apple-button-secondary:hover,
    .apple-button-danger:hover {
        transform: none;
        box-shadow: none;
    }

    .tile-link:hover .apple-card {
        transform: none;
    }

    .alphabet-letter:hover {
        transform: none;
        background: transparent;
    }

    .adminbutton:hover {
        transform: none;
    }
}
.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: white;
    display: inline-block;
}

.status-scheduled {
    background: #6c757d;
}

.status-inprogress {
    background: #007bff;
}

.status-paused {
    background: #ffc107;
    color: black;
}

.status-needsparts {
    background: #dc3545;
}

.status-completed {
    background: #28a745;
}

/* Search suggestions dropdown */
.search-suggestions {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
    border: 1px solid #ccc;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.search-suggestions li {
    margin: 0;
    padding: 0;
}

.search-suggestions li:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.search-suggestions button {
    width: 100%;
    text-align: left;
    padding: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.1s ease;
}

.search-suggestions button:hover {
    background: #f5f5f5;
}

/* Link-style button */
.apple-button-link {
    background: none;
    border: none;
    color: #007aff;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-align: left;
    transition: color 0.1s ease;
}

.apple-button-link:hover {
    color: #0051d5;
    text-decoration: underline;
}

html.dark .apple-button-link {
    color: #5eb3ff;
}

html.dark .apple-button-link:hover {
    color: #85c4ff;
}

html.dark .search-suggestions {
    background: #1c1c1e;
    border-color: #424245;
}

html.dark .search-suggestions li:not(:last-child) {
    border-bottom-color: #3a3a3c;
}

html.dark .search-suggestions button:hover {
    background: #2c2c2e;
}

/* ---------------------------------------------------------
   RESPONSIVE TOPBAR - MEDIA QUERIES
--------------------------------------------------------- */

/* Tablet and smaller - Hide button text, show icons only */
@media (max-width: 1024px) {
    .topbar-left {
        gap: 12px;
    }

    .adminbutton {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Smaller tablets - Wrap topbar into multiple rows */
@media (max-width: 768px) {
    .topbar-inner {
        grid-template-columns: 1fr;
        padding: 8px 16px;
        gap: 8px;
    }

    .topbar-left {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        justify-content: flex-start;
        grid-column: 1;
    }

    .topbar-logo {
        height: 36px;
    }

    .adminbutton {
        padding: 6px 10px;
        font-size: 13px;
    }

    .topbar-map-button img {
        height: 2.2rem;
    }
}

/* Mobile - More compact */
@media (max-width: 480px) {
    .topbar-inner {
        grid-template-columns: 1fr;
        padding: 6px 12px;
        gap: 6px;
    }

    .topbar-left {
        gap: 6px;
    }

    .topbar-logo {
        height: 32px;
    }

    .adminbutton {
        padding: 6px 8px;
        font-size: 12px;
    }

    .topbar-map-button img {
        height: 2rem;
    }

}

/* ============================================================
   GLOBAL SEARCH BACKDROP
   ============================================================ */
.search-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    z-index: 9998;
    animation: fadeIn 0.2s ease-out;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================================
   GLOBAL SEARCH COMPONENT STYLES
   ============================================================ */
.global-search-container {
    position: relative;
    flex: 1;
    max-width: 500px;
    margin: 0 1rem;
    z-index: 9999;
}

.global-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 0.5rem 1rem;
    box-shadow:
        inset 4px 4px 8px rgba(80, 90, 110, 0.12),
        inset -4px -4px 8px rgba(255, 255, 255, 0.35);
    transition: all 0.3s ease;
    min-height: 42px;
}

.global-search-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.53);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 5px 5px 10px rgba(80, 90, 110, 0.14),
        inset -5px -5px 10px rgba(255, 255, 255, 0.4);
    position: relative;
    z-index: 10000;
}

:root.dark .global-search-input-wrapper,
html.dark .global-search-input-wrapper {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        inset 4px 4px 8px rgba(0, 0, 0, 0.35),
        inset -3px -3px 6px rgba(255, 255, 255, 0.04);
}

:root.dark .global-search-input-wrapper:focus-within,
html.dark .global-search-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

.search-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
    opacity: 0.7;
}

.global-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.95rem;
    padding: 0.25rem 0;
}

.global-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

:root.dark .global-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.clear-search {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.85rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.clear-search:hover {
    opacity: 1;
}

.global-search-results {
    position: fixed !important;
    top: 65px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90% !important;
    max-width: 550px !important;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    max-height: 60vh !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    animation: slideDown 0.2s ease-out !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

:root.dark .global-search-results {
    background: #1e1e1e !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
}

.result-category {
    padding: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.result-category:last-child {
    border-bottom: none;
}

.result-category:first-child .category-header {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

:root.dark .result-category {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #888;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

:root.dark .category-header {
    color: #999;
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.category-icon {
    font-size: 0.95rem;
}

.search-result-item {
    display: block;
    padding: 0.85rem 1.25rem;
    text-decoration: none;
    color: #333;
    transition: all 0.15s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.search-result-item:hover {
    background: rgba(59, 130, 246, 0.08);
    border-left-color: #3b82f6;
}

:root.dark .search-result-item {
    color: #e0e0e0;
}

:root.dark .search-result-item:hover {
    background: rgba(59, 130, 246, 0.15);
}

.result-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: #1a1a1a;
}

.result-subtitle {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.3;
}

:root.dark .result-title {
    color: #f0f0f0;
}

:root.dark .result-subtitle {
    color: #999;
}

.no-results {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
}

:root.dark .no-results {
    color: #999;
}

/* Custom scrollbar for results */
.global-search-results::-webkit-scrollbar {
    width: 8px;
}

.global-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.global-search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.global-search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

:root.dark .global-search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

:root.dark .global-search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .global-search-container {
        max-width: 100%;
        margin: 0 0.25rem; /* Reduced margin for more space */
        flex: 1;
    }

    .global-search-input-wrapper {
        min-height: 36px; /* Smaller height on mobile */
        padding: 0.4rem 0.75rem; /* Reduced padding */
        border-radius: 18px; /* Slightly smaller radius */
    }

    .search-icon {
        font-size: 0.85rem; /* Smaller icon */
        margin-right: 0.4rem;
    }

    .global-search-input {
        font-size: 0.875rem; /* 14px - better for mobile */
    }

    .clear-search {
        font-size: 0.75rem; /* Smaller clear button */
        padding: 0.2rem;
    }

    .global-search-results {
        max-height: 400px !important;
    }
}

    /* Allow topbar to expand vertically on very small screens */
    .apple-topbar {
        min-height: auto;
    }

}

/* Search Result Modal Styles */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0 !important;
    z-index: 2000000 !important;
}

.apple-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2000001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h4 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-button:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 1.5rem;
}

.detail-section {
    margin-bottom: 1.25rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
    color: #1a1a1a;
    line-height: 1.5;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.detail-grid-item {
    display: flex;
}

.detail-badge {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1a1a1a;
    font-weight: 500;
    text-align: center;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap; /* Allow buttons to wrap on small screens */
}

.modal-footer button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.modal-footer button .bi {
    font-size: 1rem;
}

/* Dark mode support for modal */
:root.dark .apple-modal {
    background: #2a2a2a;
}

:root.dark .modal-header {
    border-bottom-color: #444;
}

:root.dark .modal-header h4 {
    color: #f0f0f0;
}

:root.dark .close-button {
    color: #ccc;
}

:root.dark .close-button:hover {
    background: #3a3a3a;
}

:root.dark .detail-label {
    color: #999;
}

:root.dark .detail-value {
    color: #f0f0f0;
}

:root.dark .modal-footer {
    border-top-color: #444;
}

:root.dark .detail-badge {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.25);
    color: #e0e0e0;
}

/* ---------------------------------------------------------
   CONFIRM DELETE DIALOG
--------------------------------------------------------- */
.confirm-dialog {
    background: white;
    border-radius: 20px;
    padding: 2rem 2rem 1.5rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: confirmSlideIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes confirmSlideIn {
    from { opacity: 0; transform: scale(0.88) translateY(12px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

html.dark .confirm-dialog {
    background: #1c1c1e;
    border: 1px solid #3a3a3c;
    color: #f5f5f7;
}

.confirm-dialog__icon {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.confirm-dialog__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
}

html.dark .confirm-dialog__title { color: #f5f5f7; }

.confirm-dialog__message {
    font-size: 0.97rem;
    font-weight: 500;
    margin: 0 0 0.5rem;
    color: #333;
}

html.dark .confirm-dialog__message { color: #d1d1d6; }

.confirm-dialog__detail {
    font-size: 0.82rem;
    color: #888;
    margin: 0 0 1.5rem;
    line-height: 1.5;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 59, 48, 0.06);
    border-radius: 8px;
    border: 1px solid rgba(255, 59, 48, 0.15);
}

html.dark .confirm-dialog__detail {
    background: rgba(255, 59, 48, 0.12);
    border-color: rgba(255, 59, 48, 0.25);
    color: #ababab;
}

.confirm-dialog__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
}

/* ============================================================
   PRINT LAYOUT - Dedicated layout for print pages
   ============================================================ */
.print-layout {
    width: 100%;
    max-width: 8.5in;
    margin: 0 auto;
    padding: 0;
    background: white;
}

/* Print layout should have no app chrome */
.print-layout .apple-topbar,
.print-layout .apple-nav,
.print-layout .theme-toggle,
.print-layout button:not(.print-keep-button),
.print-layout .apple-button,
.print-layout .apple-actions {
    display: none;
}

/* ============================================================
   PRINT OVERRIDES - FORCE PORTRAIT MODE
   ============================================================ */
@media print {
    /* NUCLEAR: Cap everything at portrait width */
    *,
    *::before,
    *::after {
        max-width: 8.5in !important;
        box-sizing: border-box !important;
    }

    /* Force HTML/BODY to portrait dimensions */
    html {
        width: 8.5in !important;
        max-width: 8.5in !important;
        min-height: 11in !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        width: 8.5in !important;
        max-width: 8.5in !important;
        min-height: 11in !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    /* Override ALL layout containers */
    .apple-shell,
    .apple-main,
    .apple-container,
    .apple-container.wide,
    .apple-container.full,
    .apple-container.dashboard-wide,
    .apple-page-container,
    .topbar-inner,
    .apple-card,
    .apple-page,
    .modal-overlay,
    .apple-modal,
    .global-search-container,
    .global-search-results,
    .invoice-table-container {
        width: 100% !important;
        max-width: 8.5in !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Hide all app chrome */
    .apple-topbar,
    .topbar-inner,
    .topbar-left,
    .topbar-center,
    .top-nav,
    .theme-toggle,
    .adminbutton,
    .topbar-icon-link,
    .global-search-container,
    nav,
    header:not(#print-invoice header):not(#print-area header),
    footer,
    button,
    .apple-button,
    .apple-button-primary,
    .apple-button-secondary,
    .apple-button-danger,
    .apple-page-title,
    .apple-card-header,
    .modal-overlay,
    .search-backdrop {
        display: none !important;
    }

    /* Show only print areas */
    #print-invoice,
    #print-area,
    .print-page {
        display: block !important;
        width: 100% !important;
        max-width: 8.5in !important;
        margin: 0 !important;
        padding: 0.5in !important;
    }
}

/* ========================================
   Apple-Style Toggle Switch
   ======================================== */
.apple-toggle-container {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    margin-right: 12px;
    margin-bottom: 0;
}

.apple-toggle-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.apple-toggle-container .apple-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e9e9ea;
    border-radius: 31px;
    box-shadow:
        inset 0 1px 5px hsla(0, 0%, 0%, 0.5),
        inset 0 0 10px hsla(0, 0%, 0%, 0.5),
        0 0 0 1px hsla(0, 0%, 0%, 0.1),
        0 -1px 2px 2px hsla(0, 0%, 0%, 0.25),
        0 2px 2px 5px hsla(0, 0%, 100%, 0.75);
    transition: background-color 0.3s ease;
}

.apple-toggle-container .apple-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    background-image: linear-gradient(
        hsla(0, 0%, 100%, 0.1),
        hsla(0, 0%, 0%, 0.1)
    );
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 50%;
    box-shadow:
        inset 0 1px 1px 1px hsla(0, 0%, 100%, 1),
        inset 0 -1px 1px 1px hsla(0, 0%, 0%, 0.25),
        0 0 0 1px hsla(0, 0%, 0%, 0.2),
        2px 0px 10px 0px hsla(0, 0%, 0%, 0.5),
        -2px 0px 10px 0px hsla(0, 0%, 0%, 0.5);
}

.apple-toggle-container input:checked + .apple-slider {
    background-color: #34c759;
}

.apple-toggle-container input:checked + .apple-slider:before {
    transform: translateX(20px);
}

.apple-toggle-container input:focus-visible + .apple-slider {
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.15);
}

.apple-toggle-container input:disabled + .apple-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.apple-toggle-container:hover input:not(:disabled) + .apple-slider {
    background-color: #d1d1d6;
}

.apple-toggle-container:hover input:checked:not(:disabled) + .apple-slider {
    background-color: #30b350;
}

.apple-toggle-container input:active:not(:disabled) + .apple-slider:before {
    width: 31px;
}

.apple-toggle-container input:checked:active:not(:disabled) + .apple-slider:before {
    transform: translateX(16px);
}

/* Dark theme support */
[data-theme="dark"] .apple-toggle-container .apple-slider {
    background-color: #39393d;
}

[data-theme="dark"] .apple-toggle-container input:checked + .apple-slider {
    background-color: #30d158;
}

[data-theme="dark"] .apple-toggle-container:hover input:not(:disabled) + .apple-slider {
    background-color: #48484d;
}

[data-theme="dark"] .apple-toggle-container:hover input:checked:not(:disabled) + .apple-slider {
    background-color: #32d058;
}

/* Dark theme support for apple-table, including page-level list/item overrides */
html.dark .apple-table th,
html.dark .list-page .apple-table th,
html.dark .items-page .apple-table th,
html.dark .inventory-page .apple-table th {
    color: var(--apple-table-header-muted);
}

html.dark .apple-table td,
html.dark .apple-table tbody td,
html.dark .list-page .apple-table tbody td,
html.dark .items-page .apple-table tbody td,
html.dark .inventory-page .apple-table tbody td {
    background: var(--apple-table-row-bg-soft);
    color: var(--text-color);
    border-top-color: transparent;
    border-bottom-color: transparent;
}

html.dark .list-page .apple-table tbody td {
    background: var(--apple-table-row-bg-glass);
    box-shadow: var(--apple-table-row-shadow);
}

html.dark .apple-table tbody tr:hover td,
html.dark .list-page .apple-table tbody tr:hover td,
html.dark .items-page .apple-table tbody tr:hover td,
html.dark .inventory-page .apple-table tbody tr:hover td,
html.dark .items-page .apple-table tbody tr:hover td:first-child[style*="--color-indicator"],
html.dark .inventory-page .apple-table tbody tr:hover td:first-child[style*="--color-indicator"] {
    background: var(--apple-table-row-hover-bg);
}

html.dark .list-page .apple-table tbody tr:hover td {
    background: var(--apple-table-row-hover-glass);
}

html.dark .apple-table tr td:first-child[style*="--color-indicator"],
html.dark .items-page .apple-table tr td:first-child[style*="--color-indicator"],
html.dark .inventory-page .apple-table tr td:first-child[style*="--color-indicator"] {
    background: var(--apple-table-row-bg-soft);
}

html.dark .apple-table tr td:first-child {
    border-left-color: transparent;
}

html.dark .apple-table tr td:last-child {
    border-right-color: transparent;
}

html.dark .apple-list-item {
    color: var(--text-color);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.dark .customers-page .apple-list-item {
    color: var(--text-color);
    background: var(--apple-table-row-bg-soft);
    box-shadow: var(--apple-table-row-shadow);
    border-bottom-color: transparent;
}

html.dark .customers-page .apple-list-item:hover {
    background: var(--apple-table-row-hover-bg);
}

html.dark .customer-info,
html.dark .customer-info strong,
html.dark .customer-info .muted {
    color: var(--text-color);
}

html.dark .stat-card {
    background: var(--stat-card-bg);
    border-color: var(--stat-card-border);
    box-shadow: var(--stat-card-shadow);
    color: var(--text-color);
}

html.dark .stat-card::before {
    background: var(--stat-card-shine);
    opacity: var(--stat-card-shine-opacity);
}

html.dark .stat-card:hover,
html.dark .stat-card.clickable:hover {
    box-shadow: var(--stat-card-hover-shadow);
}

html.dark .stat-label {
    color: var(--stat-label-color);
}

html.dark .stat-value {
    color: var(--stat-value-color);
}

