/* =============================================================
   sitops — design system
   ------------------------------------------------------------
   Tokens, layout, and components for the operations app.
   Class names match the markup in /public/views/* and the JS
   templates in /public/js/app/*.js — preserve them when editing.
   ============================================================= */

/* ---------- Tokens ---------- */
:root {
    /* Surfaces */
    --bg: #f4f7fb;
    --bg-deep: #dbe5f3;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --surface-quiet: rgba(248, 251, 255, 0.72);
    --surface-dark: #071120;

    /* Lines */
    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.14);
    --line-dark: rgba(255, 255, 255, 0.12);

    /* Text */
    --text: #06131f;
    --text-soft: #243349;
    --muted: #5b6b7e;
    --muted-soft: #7a8a9b;
    --on-dark: #f4f8ff;
    --on-dark-muted: rgba(244, 248, 255, 0.66);

    /* Brand */
    --navy: #081120;
    --navy-deep: #050b16;
    --cobalt: #2d6df6;
    --cobalt-deep: #1d52d2;
    --aqua: #69e5ff;
    --mint: #7cffc4;
    --chartreuse: #d7ff3f;
    --rose: #ff6b88;
    --amber: #ffb547;
    --danger: #d11f42;
    --success: #0a7a4a;

    /* Shadows */
    --shadow-sm: 0 4px 14px rgba(5, 16, 33, 0.06);
    --shadow: 0 18px 44px rgba(5, 16, 33, 0.09);
    --shadow-strong: 0 28px 64px rgba(5, 16, 33, 0.14);
    --shadow-pop: 0 30px 80px rgba(5, 16, 33, 0.18);
    --shadow-glow: 0 18px 40px rgba(45, 109, 246, 0.22);

    /* Radii */
    --r-xs: 0.55rem;
    --r-sm: 0.85rem;
    --r-md: 1.1rem;
    --r-lg: 1.45rem;
    --r-xl: 1.75rem;
    --r-2xl: 2.1rem;

    /* Responsive type — phone → desktop */
    --fs-h1: clamp(2.05rem, 1.4rem + 2.6vw, 3.4rem);
    --fs-h2: clamp(1.4rem, 1.18rem + 1vw, 2rem);
    --fs-h3: clamp(1.15rem, 1.02rem + 0.6vw, 1.5rem);
    --fs-body: 1rem;
    --fs-sm: 0.92rem;
    --fs-xs: 0.78rem;

    /* Motion */
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --t-fast: 140ms var(--ease);
    --t: 200ms var(--ease);
    --t-slow: 320ms var(--ease);
}

* {
    box-sizing: border-box;
}

/* ---------- Body & global backdrop ---------- */
body.sitops-shell {
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background:
        radial-gradient(circle at 12% 8%, rgba(105, 229, 255, 0.18), transparent 22%),
        radial-gradient(circle at 88% 14%, rgba(215, 255, 63, 0.14), transparent 18%),
        radial-gradient(circle at 60% 100%, rgba(45, 109, 246, 0.1), transparent 26%),
        linear-gradient(180deg, #eef4fb 0%, #e7eef8 38%, #f8fbff 100%);
    min-height: 100vh;
}

body.modal-open {
    overflow: hidden;
}

body.public-enquiry-mode #main-nav,
body.public-enquiry-mode #session-status {
    display: none;
}

.site-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(8, 17, 32, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 17, 32, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
}

.ambient {
    position: fixed;
    z-index: 0;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.5;
    pointer-events: none;
}

.ambient-one {
    top: 6rem;
    left: -5rem;
    width: 18rem;
    height: 18rem;
    background: rgba(45, 109, 246, 0.26);
}

.ambient-two {
    top: 10rem;
    right: 6%;
    width: 13rem;
    height: 13rem;
    background: rgba(124, 255, 196, 0.3);
}

.ambient-three {
    right: 18%;
    bottom: 8%;
    width: 20rem;
    height: 20rem;
    background: rgba(255, 107, 136, 0.1);
}

/* ---------- Typography helpers ---------- */
.brand-mark,
.brand-title,
h1,
h2,
h3 {
    font-family: 'Space Grotesk', sans-serif;
}

h1 { letter-spacing: -0.025em; }
h2 { letter-spacing: -0.015em; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #6b7d91;
}

.eyebrow::before {
    content: '';
    width: 1.15rem;
    height: 0.18rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cobalt), var(--chartreuse));
}

/* ---------- Header & brand ---------- */
.site-header {
    position: sticky;
    top: 0;
    isolation: isolate;
    background: linear-gradient(180deg, rgba(7, 14, 26, 0.92), rgba(7, 14, 26, 0.78));
    border-bottom: 1px solid var(--line-dark);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.header-shell {
    align-items: center;
}

.header-brand {
    color: inherit;
    transition: transform var(--t);
}

.header-brand:hover {
    transform: translateY(-1px);
}

.brand-mark {
    display: grid;
    height: 3rem;
    width: 3rem;
    place-items: center;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background:
        linear-gradient(145deg, rgba(45, 109, 246, 1), rgba(8, 17, 32, 1));
    color: white;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    box-shadow: 0 14px 30px rgba(45, 109, 246, 0.32);
    flex: 0 0 auto;
}

.brand-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--on-dark);
    line-height: 1.05;
}

.brand-subtitle {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--on-dark-muted);
}

/* ---------- Main navigation ---------- */
.main-nav {
    width: 100%;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.15rem;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
            mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.nav-chip {
    position: relative;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.6rem 0.95rem;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(244, 248, 255, 0.74);
    scroll-snap-align: center;
    transition:
        transform var(--t),
        background var(--t),
        color var(--t),
        border-color var(--t),
        box-shadow var(--t);
}

.nav-chip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(105, 229, 255, 0.22), rgba(45, 109, 246, 0.22), rgba(215, 255, 63, 0.14));
    opacity: 0;
    transition: opacity var(--t);
}

.nav-chip > * {
    position: relative;
    z-index: 1;
}

.nav-chip:hover,
.nav-chip:focus-visible {
    border-color: rgba(105, 229, 255, 0.34);
    color: white;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 32px rgba(5, 16, 33, 0.32);
    transform: translateY(-1px);
    outline: none;
}

.nav-chip.is-active {
    border-color: rgba(105, 229, 255, 0.45);
    color: white;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 36px rgba(5, 16, 33, 0.34);
}

.nav-chip:hover::before,
.nav-chip:focus-visible::before,
.nav-chip.is-active::before {
    opacity: 1;
}

body.auth-locked #main-nav,
body.portal-mode #main-nav {
    display: none;
}

/* ---------- Session pill / chip / icon-button ---------- */
.session-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.session-pill,
.session-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.7rem;
    color: rgba(244, 248, 255, 0.78);
    font-size: 0.82rem;
}

.session-chip {
    position: relative;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.55rem;
    max-width: 100%;
}

.session-name {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--on-dark);
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-topline {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    justify-content: flex-end;
}

.session-role {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--on-dark-muted);
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(244, 248, 255, 0.92);
    transition: transform var(--t), background var(--t), border-color var(--t), color var(--t);
}

.icon-button:hover,
.icon-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(105, 229, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    outline: none;
}

.icon-button svg {
    width: 1.1rem;
    height: 1.1rem;
}

.icon-button-sm {
    width: 2.2rem;
    height: 2.2rem;
}

.icon-button-sm svg {
    width: 0.95rem;
    height: 0.95rem;
}

.session-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    z-index: 200;
    display: grid;
    gap: 0.3rem;
    min-width: 14rem;
    padding: 0.5rem;
    border-radius: var(--r-md);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(7, 14, 26, 0.96);
    box-shadow: 0 24px 50px rgba(5, 16, 33, 0.4);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.session-menu-item {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    border-radius: 0.75rem;
    padding: 0.75rem 0.85rem;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(244, 248, 255, 0.92);
    background: transparent;
    transition: background var(--t-fast), color var(--t-fast);
}

.session-menu-item:hover,
.session-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.session-menu-item-danger {
    color: #ff8ea1;
}

.session-menu-item-danger:hover,
.session-menu-item-danger:focus-visible {
    background: rgba(255, 107, 136, 0.16);
    color: #ffd0d8;
}

/* ---------- Auth shell ---------- */
.auth-shell {
    display: flex;
    justify-content: center;
    width: 100%;
}

.auth-card {
    max-width: 46rem;
    margin: 0 auto;
    width: 100%;
}

.auth-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.auth-toggle {
    display: inline-flex;
    padding: 0.3rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(248, 251, 255, 0.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-toggle-button {
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--muted);
    transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.auth-toggle-button:hover {
    color: var(--text);
}

.auth-toggle-button.is-active {
    background: var(--navy);
    color: white;
    box-shadow: 0 14px 24px rgba(8, 17, 32, 0.22);
}

.auth-panel {
    animation: lift-in 320ms var(--ease) both;
}

.auth-panel.hidden {
    display: none;
}

.auth-feedback-slot {
    min-height: 1.25rem;
}

.auth-feedback {
    display: block;
    min-height: 1.15rem;
    margin-top: 0.2rem;
    padding-left: 0.6rem;
    border-left: 2px solid transparent;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-fast), visibility var(--t-fast);
}

.auth-feedback.is-visible {
    opacity: 1;
    visibility: visible;
}

.auth-feedback.is-pending {
    color: #475569;
    border-left-color: #cbd5e1;
}

.auth-feedback.is-invalid {
    color: #b91c1c;
    border-left-color: #ef4444;
}

.auth-feedback.is-valid {
    color: #166534;
    border-left-color: #22c55e;
}

/* ---------- Password field ---------- */
.password-field {
    position: relative;
}

.password-input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    transform: translateY(-50%);
    color: #64748b;
    transition: background var(--t-fast), color var(--t-fast);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: rgba(15, 23, 42, 0.06);
    color: var(--navy);
    outline: none;
}

.password-toggle svg {
    width: 1.05rem;
    height: 1.05rem;
}

@media (min-width: 1024px) {
    .auth-shell {
        padding-top: 1rem;
    }
}

/* ---------- Hero, banners, surfaces ---------- */
.hero-panel,
.content-card,
.stat-card,
.booking-card,
.record-card,
.queue-card,
.list-row,
.page-banner {
    animation: lift-in 380ms var(--ease) both;
}

.hero-panel {
    position: relative;
    display: grid;
    gap: 1.6rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--r-2xl);
    background:
        linear-gradient(135deg, rgba(8, 17, 32, 0.98) 0%, rgba(15, 33, 63, 0.96) 50%, rgba(45, 109, 246, 0.92) 100%);
    padding: 1.7rem;
    color: var(--on-dark);
    box-shadow: var(--shadow-strong);
}

.hero-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 78% 18%, rgba(215, 255, 63, 0.28), transparent 22%),
        radial-gradient(circle at 70% 82%, rgba(105, 229, 255, 0.22), transparent 24%);
    pointer-events: none;
}

.hero-panel > * {
    position: relative;
    z-index: 1;
}

.hero-panel h1,
.hero-panel h2,
.hero-panel h3 {
    color: var(--on-dark);
}

.hero-panel p {
    color: rgba(244, 248, 255, 0.78);
}

.hero-panel .eyebrow {
    color: rgba(244, 248, 255, 0.72);
}

.hero-focus-panel {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--r-xl);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
    padding: 1.2rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@media (min-width: 1024px) {
    .hero-panel {
        grid-template-columns: 1.25fr 0.78fr;
        padding: 2.6rem;
        gap: 2rem;
    }
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.content-card {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--r-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 252, 0.9));
    padding: 1.55rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.content-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(45, 109, 246, 0.12));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

.page-banner {
    display: grid;
    gap: 1.25rem;
    align-items: end;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--r-xl);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(240, 246, 255, 0.84));
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.archive-header {
    align-items: center;
}

.archive-search {
    width: 100%;
    max-width: 22rem;
}

@media (min-width: 1024px) {
    .page-banner {
        grid-template-columns: 1.2fr 0.6fr;
        padding: 1.8rem 2rem;
    }
}

.profile-banner {
    align-items: center;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-self: stretch;
    border: 1px solid rgba(8, 17, 32, 0.08);
    border-radius: var(--r-lg);
    background: linear-gradient(145deg, rgba(8, 17, 32, 0.98), rgba(19, 44, 87, 0.96));
    padding: 1rem 1.1rem;
    color: white;
    box-shadow: var(--shadow);
}

.profile-summary .eyebrow {
    color: rgba(244, 248, 255, 0.62);
}

.profile-summary .eyebrow::before {
    background: linear-gradient(90deg, var(--chartreuse), var(--aqua));
}

.profile-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.15rem;
    background: linear-gradient(145deg, var(--aqua), var(--cobalt));
    color: var(--navy);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    box-shadow: var(--shadow-glow);
}

.profile-summary-copy {
    min-width: 0;
}

.profile-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.profile-card {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.92));
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
}

.profile-details {
    display: grid;
    gap: 0.95rem;
    margin-top: 1rem;
}

.profile-details dt {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #6b7d91;
}

.profile-details dd {
    margin-top: 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.banner-metric {
    justify-self: stretch;
    border: 1px solid rgba(8, 17, 32, 0.08);
    border-radius: var(--r-lg);
    background: linear-gradient(145deg, rgba(8, 17, 32, 0.98), rgba(19, 44, 87, 0.96));
    padding: 1.05rem 1.15rem;
    box-shadow: var(--shadow);
}

.banner-metric span {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(244, 248, 255, 0.6);
}

.banner-metric strong {
    display: block;
    margin-top: 0.55rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.18rem;
    line-height: 1.25;
    color: white;
}

/* ---------- Layouts ---------- */
.split-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1280px) {
    .split-layout {
        grid-template-columns: 0.9fr 1.1fr;
    }

    .split-layout-reverse {
        grid-template-columns: 0.84fr 1.16fr;
    }

    .split-layout-tight {
        grid-template-columns: 0.8fr 1.2fr;
    }
}

.rail-card {
    position: relative;
    overflow: hidden;
}

.rail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.32rem;
    background: linear-gradient(90deg, var(--cobalt), var(--aqua), var(--chartreuse));
    z-index: 1;
}

.board-card {
    min-height: 100%;
}

.panel-copy {
    margin-top: 0.75rem;
    max-width: 32rem;
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.55;
}

/* ---------- Forms ---------- */
.field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #5d6e82;
}

.required-field::after {
    content: ' *';
    color: var(--danger);
}

.form-block {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, 0.6);
    padding: 1.15rem;
}

.form-block-header {
    margin-bottom: 1rem;
}

.form-block-copy {
    margin-top: 0.55rem;
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.55;
}

.form-input {
    width: 100%;
    border-radius: var(--r-md);
    border: 1px solid var(--line-strong);
    background: rgba(249, 252, 255, 0.96);
    /* 16px on phone prevents iOS zoom; desktop scales up via media query */
    font-size: 1rem;
    padding: 0.9rem 1rem;
    color: var(--text);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), transform var(--t-fast);
    min-height: 44px;
}

.form-input::placeholder {
    color: var(--muted-soft);
}

.form-input:hover {
    border-color: rgba(45, 109, 246, 0.3);
}

.form-input:focus,
.form-input:focus-visible {
    border-color: rgba(45, 109, 246, 0.55);
    background: white;
    box-shadow:
        0 0 0 4px rgba(45, 109, 246, 0.14),
        0 14px 28px rgba(45, 109, 246, 0.1);
    transform: translateY(-1px);
}

textarea.form-input {
    resize: vertical;
    min-height: 7rem;
}

select.form-input {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(8, 17, 32, 0.45) 50%),
        linear-gradient(135deg, rgba(8, 17, 32, 0.45) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
}

input[type="search"].form-input {
    background-image: none;
}

input[type="date"].form-input {
    min-height: 44px;
}

/* ---------- Buttons ---------- */
.primary-button,
.secondary-button,
.success-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    min-height: 44px;
    line-height: 1;
    transition:
        transform var(--t),
        box-shadow var(--t),
        background var(--t),
        color var(--t),
        border-color var(--t);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.success-button:focus-visible {
    outline: 3px solid rgba(45, 109, 246, 0.55);
    outline-offset: 2px;
}

.primary-button {
    border: 1px solid rgba(8, 17, 32, 0.06);
    background: linear-gradient(135deg, var(--navy) 0%, var(--cobalt) 100%);
    color: white;
    box-shadow: var(--shadow-glow);
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 44px rgba(45, 109, 246, 0.32);
}

.primary-button:disabled {
    cursor: not-allowed;
    transform: none;
    opacity: 0.45;
    box-shadow: none;
    background: linear-gradient(135deg, rgba(8, 17, 32, 0.4) 0%, rgba(45, 109, 246, 0.36) 100%);
}

.secondary-button {
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.86);
    color: var(--navy);
    box-shadow: var(--shadow-sm);
}

.secondary-button:hover {
    transform: translateY(-1px);
    background: white;
    border-color: rgba(45, 109, 246, 0.3);
    box-shadow: var(--shadow);
}

.success-button {
    border: 1px solid rgba(10, 122, 74, 0.14);
    background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
    color: white;
    box-shadow: 0 18px 36px rgba(34, 197, 94, 0.24);
}

.success-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 44px rgba(34, 197, 94, 0.32);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.4rem 0.78rem;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid transparent;
    line-height: 1;
}

.badge-amber  { background: rgba(255, 226, 123, 0.26); color: #8b6400; border-color: rgba(255, 196, 89, 0.45); }
.badge-blue   { background: rgba(45, 109, 246, 0.12); color: #1551ca; border-color: rgba(45, 109, 246, 0.26); }
.badge-green  { background: rgba(124, 255, 196, 0.2); color: var(--success); border-color: rgba(124, 255, 196, 0.36); }
.badge-rose   { background: rgba(255, 107, 136, 0.14); color: #b61e47; border-color: rgba(255, 107, 136, 0.27); }
.badge-stone  { background: rgba(8, 17, 32, 0.06); color: #4f5e6d; border-color: rgba(8, 17, 32, 0.1); }
.badge-info   { background: rgba(105, 229, 255, 0.18); color: #0a6580; border-color: rgba(105, 229, 255, 0.36); }

/* ---------- Stat cards ---------- */
.dashboard-stat-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .dashboard-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .dashboard-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.dashboard-main-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1280px) {
    .dashboard-main-grid {
        grid-template-columns: 1.28fr 0.72fr;
    }
}

.dashboard-side-stack {
    display: grid;
    gap: 1.5rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 11rem;
    border-radius: var(--r-xl);
    padding: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow);
    transition: transform var(--t), box-shadow var(--t);
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: -1.6rem;
    right: -1.6rem;
    width: 6rem;
    height: 6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    filter: blur(10px);
}

.stat-sand   { background: linear-gradient(135deg, #ffffff 0%, #e9fff7 54%, #b8ffe2 100%); }
.stat-clay   { background: linear-gradient(135deg, #ffffff 0%, #edf3ff 52%, #b7cbff 100%); }
.stat-sage   { background: linear-gradient(135deg, #ffffff 0%, #fbffe0 48%, #e1ff68 100%); }
.stat-ink    {
    background: linear-gradient(145deg, #071120 0%, #112547 56%, #2463ea 100%);
    color: var(--on-dark);
    border-color: rgba(255, 255, 255, 0.15);
}

.signal-card {
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top right, rgba(215, 255, 63, 0.18), transparent 22%),
        linear-gradient(145deg, #071120 0%, #102445 65%, #18345e 100%);
    color: white;
    box-shadow: var(--shadow-strong);
}

.signal-card .eyebrow {
    color: rgba(255, 255, 255, 0.62);
}

.signal-card .eyebrow::before {
    background: linear-gradient(90deg, var(--chartreuse), var(--aqua));
}

/* ---------- Booking / record / queue / list rows ---------- */
.booking-card,
.record-card,
.queue-card,
.list-row {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.92));
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
}

.archive-card {
    background: linear-gradient(180deg, rgba(246, 249, 253, 0.98), rgba(238, 243, 250, 0.94));
}

.booking-card,
.record-card,
.queue-card {
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.booking-card:hover,
.record-card:hover,
.queue-card:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 109, 246, 0.2);
    box-shadow: var(--shadow);
}

.list-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

/* ---------- Empty state ---------- */
.empty-state {
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-lg);
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.5);
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    max-width: 24rem;
    border-radius: var(--r-md);
    padding: 0.95rem 1.05rem;
    color: white;
    box-shadow: 0 22px 50px rgba(5, 16, 33, 0.32);
    animation: lift-in 280ms var(--ease) both;
}

.toast-success { background: linear-gradient(135deg, var(--success), #13a062); }
.toast-error   { background: linear-gradient(135deg, #af1835, #d13a57); }

/* ---------- Modals ---------- */
.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: start center;
    overflow-y: auto;
    padding: 4.5rem 1.25rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 17, 32, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 58rem);
    max-height: calc(100vh - 9rem);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--r-xl);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(243, 247, 252, 0.95));
    padding: 1.6rem;
    box-shadow: var(--shadow-pop);
    animation: lift-in 280ms var(--ease) both;
}

.modal-panel-compact {
    width: min(100%, 38rem);
}

.modal-panel-wide {
    width: min(100%, 76rem);
    padding: 1.85rem;
}

.modal-header,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modal-header {
    flex-wrap: wrap;
    align-items: flex-start;
}

.modal-actions {
    padding-top: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Calendar ---------- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-day {
    min-height: 130px;
    background: linear-gradient(180deg, #ffffff, #f3f7fc);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 8px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.calendar-day:hover {
    border-color: rgba(45, 109, 246, 0.25);
    box-shadow: var(--shadow-sm);
}

.calendar-day-label {
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.calendar-visit-card {
    background: #fff;
    border-radius: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-left: 3px solid var(--cobalt);
    font-size: 12px;
    cursor: pointer;
    transition: box-shadow var(--t-fast), transform var(--t-fast);
}

.calendar-visit-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateX(1px);
}

.calendar-visit-card .visit-client {
    font-weight: 700;
}

.calendar-visit-card .visit-meta {
    color: #64748b;
    margin-top: 2px;
}

/* ---------- Animations ---------- */
@keyframes lift-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =============================================================
   Mobile (≤ 767px) — phone overrides, Android baseline 360px
   ============================================================= */
@media (max-width: 767px) {
    body.sitops-shell {
        background:
            radial-gradient(circle at 100% 0%, rgba(105, 229, 255, 0.16), transparent 30%),
            radial-gradient(circle at 0% 100%, rgba(45, 109, 246, 0.1), transparent 36%),
            linear-gradient(180deg, #eef4fb 0%, #f3f7fb 50%, #f8fbff 100%);
    }

    .ambient {
        opacity: 0.28;
        filter: blur(50px);
    }

    .ambient-one,
    .ambient-three {
        display: none;
    }

    .ambient-two {
        width: 11rem;
        height: 11rem;
    }

    /* Header: condense brand and stack action area */
    .site-header {
        position: sticky;
    }

    .header-shell {
        gap: 0.85rem;
        padding: 0.85rem 1rem;
    }

    .brand-mark {
        height: 2.5rem;
        width: 2.5rem;
        font-size: 0.8rem;
    }

    .brand-title {
        font-size: 1.25rem;
    }

    .brand-subtitle {
        display: none;
    }

    .main-nav {
        order: 3;
        justify-content: flex-start;
        padding: 0.1rem 0;
    }

    .nav-chip {
        font-size: 0.72rem;
        padding: 0.65rem 0.85rem;
    }

    .session-status {
        justify-content: flex-end;
    }

    .session-name {
        max-width: 9rem;
        font-size: 0.82rem;
    }

    .session-menu {
        right: auto;
        left: 0;
        min-width: min(15rem, calc(100vw - 2.5rem));
    }

    /* Hero */
    .hero-panel {
        padding: 1.4rem;
        border-radius: var(--r-xl);
        gap: 1.2rem;
    }

    .hero-panel h1 {
        font-size: clamp(1.65rem, 7vw, 2.2rem);
        line-height: 1.15;
    }

    .hero-focus-panel {
        padding: 1rem;
    }

    /* Page banner */
    .page-banner {
        padding: 1.25rem;
        border-radius: var(--r-xl);
    }

    .page-banner h1 {
        font-size: clamp(1.5rem, 6.5vw, 2rem);
    }

    .banner-metric {
        padding: 0.95rem 1rem;
    }

    /* Section headers wrap */
    .section-header {
        align-items: flex-start;
    }

    .section-header > div:first-child {
        min-width: 0;
    }

    .section-header h2 {
        font-size: 1.4rem;
    }

    /* Content card */
    .content-card {
        padding: 1.2rem;
        border-radius: var(--r-xl);
    }

    /* Lists / list-row */
    .list-row {
        flex-direction: column;
    }

    .booking-card,
    .record-card,
    .queue-card,
    .list-row {
        padding: 1rem;
    }

    /* Buttons full-width by default in page-banner side */
    .page-banner .primary-button,
    .page-banner .secondary-button {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .modal-actions > * {
        width: 100%;
    }

    /* Modals */
    .modal-shell {
        padding: 4.5rem 0.85rem 1.5rem;
    }

    .modal-panel {
        padding: 1.2rem;
        border-radius: var(--r-xl);
        max-height: calc(100vh - 6rem);
    }

    .modal-panel-wide {
        padding: 1.2rem;
    }

    .modal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-header > button {
        align-self: flex-end;
    }

    /* Profile */
    .profile-summary {
        align-items: flex-start;
    }

    .profile-grid {
        gap: 0.75rem;
    }

    /* Auth */
    .auth-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-toggle {
        align-self: flex-start;
    }

    /* Calendar — horizontal scroll on phones, day cells stay readable */
    #bookings-calendar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 0 1rem;
    }

    .calendar-grid {
        min-width: 700px;
    }

    /* Stat cards keep some breathing room */
    .stat-card {
        min-height: 9rem;
        padding: 1.2rem;
    }

    /* Forms — inputs already 16px, but tighten padding */
    .form-input {
        padding: 0.85rem 0.9rem;
    }

    /* Toast */
    .toast {
        left: 0.75rem;
        right: 0.75rem;
        top: 0.75rem;
        max-width: none;
    }
}

/* Tablet refinements (768–1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .header-shell {
        gap: 1rem;
    }

    .session-name {
        max-width: 12rem;
    }
}

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

    .nav-chip:hover,
    .stat-card:hover,
    .booking-card:hover,
    .record-card:hover,
    .queue-card:hover,
    .primary-button:hover,
    .secondary-button:hover,
    .form-input:focus {
        transform: none !important;
    }
}
