/* ===================================================================
   NADX – New Age Domain Experience
   Brand design system  v3
   Palette: Navy / Royal Blue / Professional Pink
   =================================================================== */

/* Nunito (SIL Open Font License 1.1, see /static/fonts/Nunito-OFL.txt).
   Self-hosted so no visitor data is sent to Google Fonts. */
@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../fonts/nunito-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../fonts/nunito-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --navy:       #0b1e3f;
    --navy-900:   #081730;
    --navy-700:   #122b54;
    --royal:      #2747d6;
    --royal-600:  #1f3bbd;
    --royal-300:  #6f86ec;
    --pink:       #d63355;
    --pink-soft:  #e8657f;
    --pink-text:  #b0213f;  /* pink for text: meets WCAG AA contrast */

    --ink:     #0b1e3f;
    --muted:   #55627f;  /* WCAG AA on white and --bg */
    --line:    #dde3f0;
    --surface: #ffffff;
    --bg:      #edf0f8;

    --radius:      20px;
    --radius-sm:   14px;
    --radius-pill: 100px;
    --shadow-sm:   0 2px 8px rgba(11, 30, 63, 0.07);
    --shadow-md:   0 8px 28px rgba(11, 30, 63, 0.11);
    --shadow-lg:   0 20px 60px rgba(11, 30, 63, 0.16);

    --btn-shadow:       0 5px 0 0 var(--pink);
    --btn-shadow-ghost: 0 4px 0 0 var(--line);

    --font: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: var(--font);
    color: var(--ink);
    background-color: var(--bg);
    background-image: radial-gradient(circle, rgba(11,30,63,0.13) 1.5px, transparent 1.5px);
    background-size: 36px 36px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
}

/* ===================================================================
   BRAND
   =================================================================== */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.brand__logo { height: 46px; width: auto; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-weight: 900; font-size: 1.3rem; letter-spacing: 0.5px; color: var(--navy); }
.brand__name .x { color: var(--pink); }
.brand__tag {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 2.4px;
    text-transform: uppercase; color: var(--muted); margin-top: 4px;
}

/* ===================================================================
   AUTH / LOGIN
   =================================================================== */
.auth {
    height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}
.auth__hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #0d2348 0%, #16307a 55%, #0b1e3f 100%);
    color: #fff;
    padding: 56px 56px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.auth__hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1.5px, transparent 1.5px);
    background-size: 32px 32px;
    pointer-events: none;
}
.auth__hero::after {
    content: "";
    position: absolute;
    right: -160px;
    top: 40%;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(214,51,85,0.40) 0%, rgba(214,51,85,0) 70%);
    pointer-events: none;
}
.auth__hero-top { position: relative; z-index: 1; }
.auth__motto {
    font-size: clamp(2.6rem, 4.2vw, 5rem);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -1.5px;
}
.auth__motto .accent { color: var(--pink-soft); }
.auth__logo-band {
    position: relative;
    z-index: 1;
    align-self: stretch;
    margin: auto 0;
    padding: clamp(24px, 3.5vw, 48px) clamp(28px, 4vw, 60px);
    background: #fff;
    border-radius: 20px;
    transform: rotate(-4deg);
    box-shadow: 0 24px 50px rgba(0,0,0,0.35), 0 4px 0 0 var(--pink);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.auth__logo-band:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 30px 60px rgba(0,0,0,0.4), 0 5px 0 0 var(--pink);
}
.auth__logo { width: 100%; height: auto; display: block; }
.auth__hero-foot {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    letter-spacing: 0.4px;
    color: rgba(255,255,255,0.45);
}
.auth__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 72px 32px 48px;
    overflow-y: auto;
}
.auth__mobile-brand { display: none; }
.auth__foot-mobile {
    display: none;
    margin-top: 20px;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}
.auth__card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--shadow-md);
}
.auth__card h2 {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--navy);
    letter-spacing: -0.4px;
}
.auth__card .sub { color: var(--muted); margin-top: 6px; margin-bottom: 28px; font-size: 0.92rem; }

/* Form fields */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--navy); margin-bottom: 7px; }
.field input {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--ink);
    background: var(--bg);
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background: #fff;
}
.field input::placeholder { color: var(--muted); font-weight: 400; }

/* ===================================================================
   FORM CONTROLS — global dropdown (select) styling
   Every native <select> across the app gets a consistent, branded look
   with a custom chevron.  Component rules may override padding/border but
   inherit the chevron because they set background-color (longhand), which
   never clears this background-image.
   =================================================================== */
select {
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    padding: 12px 44px 12px 15px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232747d6' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 15px;
    box-shadow: var(--shadow-sm);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
select:hover {
    border-color: var(--royal-300);
    background-color: #fcfdff;
    box-shadow: 0 6px 16px rgba(11,30,63,0.10);
}
select:focus {
    outline: none;
    border-color: var(--royal);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(39,71,214,0.14);
}
select:disabled {
    cursor: not-allowed;
    color: var(--muted);
    background-color: #f3f5fa;
    border-color: var(--line);
    box-shadow: none;
    opacity: 1;
}
select option { color: var(--ink); background-color: #fff; font-weight: 600; }
select option:disabled { color: var(--muted); }

/* Selects that live inside an auth/onboarding .field match their inputs. */
.field select {
    width: 100%;
    padding: 12px 42px 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    background-color: var(--bg);
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
}
.field select:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background-color: #fff;
}

.combo { position: relative; }
.combo__input { padding-right: 44px !important; }
.combo__caret {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.combo__caret svg { width: 18px; height: 18px; }
.combo--open .combo__caret { color: var(--royal); }
.combo--open .combo__caret svg { transform: rotate(180deg); transition: transform 0.15s ease; }
.combo__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 30;
    margin: 0;
    padding: 6px;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}
.combo__option {
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
}
.combo__option:hover { background: rgba(39,71,214,0.08); color: var(--royal); }
.combo__empty {
    padding: 10px 12px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--muted);
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 22px;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 0.3px;
    color: #fff;
    background: var(--navy);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    box-shadow: var(--btn-shadow);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 7px 0 0 var(--pink); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 0 var(--pink); }
.btn--ghost {
    width: auto;
    color: var(--navy);
    background: var(--surface);
    box-shadow: var(--btn-shadow-ghost);
    border: 2px solid var(--line);
    padding: 9px 18px;
}
.btn--ghost:hover { border-color: var(--navy); box-shadow: 0 4px 0 0 var(--navy); color: var(--navy); transform: translateY(-1px); }
.btn--ghost:active { transform: translateY(3px); box-shadow: none; }

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(214,51,85,0.07);
    border: 1.5px solid rgba(214,51,85,0.22);
    color: #a01f39;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 22px;
}
.alert .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); margin-top: 5px; flex: none; }

/* ===================================================================
   APP SHELL — TOPBAR
   =================================================================== */
.topbar {
    height: 64px;
    background: var(--navy);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 2px 20px rgba(0,0,0,0.25), 0 4px 0 0 var(--pink);
    overflow: hidden;
}
.topbar::before {
    content: "";
    position: absolute;
    left: -60px; top: -40px;
    width: 200px; height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}
.topbar::after {
    content: "";
    position: absolute;
    right: 120px; bottom: -50px;
    width: 260px; height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(214,51,85,0.22) 0%, rgba(214,51,85,0) 70%);
    pointer-events: none;
}
.topbar .brand__logo { height: 32px; filter: brightness(0) invert(1); position: relative; z-index: 1; }
.topbar__left { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.topbar__right { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; justify-content: flex-end; }

/* Bare back arrow — sits at the far left, before the brand */
.topbar__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    color: rgba(255,255,255,0.88);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}
.topbar__back svg { width: 20px; height: 20px; }
.topbar__back:hover { background: rgba(255,255,255,0.12); color: #fff; }
.topbar__back:active { transform: scale(0.9); }

/* Brand wordmark (replaces the logo image in the bar) */
.topbar__brand { gap: 10px; }
.brand__mark {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--royal) 0%, var(--pink) 100%);
    box-shadow: 0 2px 8px rgba(214,51,85,0.45), inset 0 0 0 1px rgba(255,255,255,0.22);
    position: relative;
    flex-shrink: 0;
}
.brand__mark::after {
    content: "";
    position: absolute;
    inset: 7px;
    background: #fff;
    opacity: 0.95;
    clip-path: polygon(0 100%, 0 0, 42% 0, 42% 62%, 100% 0, 100% 100%, 58% 100%, 58% 38%);
}
.brand__word {
    color: #fff;
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: 0.16em;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    padding: 5px 14px 5px 5px;
    border-radius: 100px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    cursor: default;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s;
}
.user-chip:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.13);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35), 0 2px 0 0 var(--pink);
}
.avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: var(--navy); font-weight: 900; font-size: 0.78rem;
    background: linear-gradient(135deg, #fff 0%, #e8ecf8 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.avatar--solo {
    width: 40px; height: 40px;
    font-size: 0.95rem;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

/* ---- Account / hamburger dropdown ---- */
.menu { position: relative; z-index: 2; }
.menu__trigger {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.menu__trigger--avatar .avatar { transition: transform 0.12s, box-shadow 0.12s; }
.menu__trigger--avatar:hover .avatar { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.3); }
.menu--open .menu__trigger--avatar .avatar { box-shadow: 0 0 0 3px rgba(255,255,255,0.4); }
.menu__trigger--burger {
    width: 42px; height: 42px;
    border-radius: 12px;
    color: #fff;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    display: none;
}
.menu__trigger--burger svg { width: 22px; height: 22px; }
.menu__trigger--burger:hover { background: rgba(255,255,255,0.15); }

.menu__panel {
    position: fixed;
    top: 62px;
    right: 32px;
    min-width: 250px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(8,23,48,0.28);
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 2px;
}
.menu--open .menu__panel {
    display: flex;
    animation: menuPop 0.14s ease;
}
@keyframes menuPop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.menu__panel::before {
    content: "";
    position: absolute;
    top: -6px; right: 22px;
    width: 12px; height: 12px;
    background: #fff;
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    transform: rotate(45deg);
}
.menu__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}
.avatar--lg {
    width: 44px; height: 44px;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    border: none;
}
.menu__id { display: flex; flex-direction: column; min-width: 0; }
.menu__name { font-weight: 800; color: var(--navy); font-size: 0.95rem; line-height: 1.2; }
.menu__role { font-size: 0.72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.menu__lang { display: none; padding: 4px 6px 10px; }
.menu__item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--navy);
    font-weight: 700;
    font-size: 0.9rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}
.menu__item svg { width: 18px; height: 18px; color: var(--royal); flex-shrink: 0; }
.menu__item:hover { background: #f1f5fc; }
.menu__item--danger { color: var(--pink-text); }
.menu__item--danger svg { color: var(--pink-text); }
.menu__item--danger:hover { background: rgba(214,51,85,0.08); }
.menu__logout { margin: 0; }

.logout-form { margin: 0; }

.topbar .btn--ghost {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 4px 0 0 var(--pink), 0 2px 10px rgba(0,0,0,0.2);
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: var(--radius-pill);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s;
}
.topbar .btn--ghost:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.28);
    box-shadow: 0 6px 0 0 var(--pink), 0 4px 14px rgba(0,0,0,0.25);
    transform: translateY(-2px);
    color: #fff;
}
.topbar .btn--ghost:active { transform: translateY(3px); box-shadow: 0 1px 0 0 var(--pink), 0 1px 4px rgba(0,0,0,0.2); }

/* Language switcher (EN / ES) — sleek segmented control */
.lang {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.18);
}
.lang__btn {
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.65);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    padding: 5px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}
.lang__btn:hover { color: #fff; }
.lang__btn--active {
    color: var(--navy);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    cursor: default;
}

/* Standalone (non-topbar) placement, e.g. the login page */
.lang--plain {
    background: rgba(11,30,63,0.05);
    border-color: rgba(11,30,63,0.12);
    box-shadow: none;
}
.lang--plain .lang__btn { color: var(--muted); }
.lang--plain .lang__btn:hover { color: var(--navy); }
.lang--plain .lang__btn--active { color: #fff; background: var(--royal); box-shadow: 0 1px 4px rgba(37,99,235,0.4); }

/* Login page: switcher in the form panel's top-right corner */
.auth__lang {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 2;
}

.page { max-width: 1080px; margin: 0 auto; padding: 48px 40px 64px; }

/* ===================================================================
   GENERIC CARDS / GRID
   =================================================================== */
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.card .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-weight: 700; }
.card .v { margin-top: 8px; font-size: 1.05rem; font-weight: 800; color: var(--navy); }
.card .bar { height: 4px; width: 40px; border-radius: 4px; margin-top: 16px; background: linear-gradient(90deg, var(--royal), var(--pink)); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
    .auth__hero { display: none; }
    .auth__panel {
        justify-content: flex-start;
        padding: 72px 20px 32px;
        background: linear-gradient(180deg, #0d2348 0, #16307a 190px, transparent 190px);
    }
    .auth__lang { top: 16px; right: 16px; }
    .auth__lang .lang--plain { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); }
    .auth__lang .lang--plain .lang__btn { color: rgba(255,255,255,0.75); }
    .auth__lang .lang--plain .lang__btn:hover { color: #fff; }
    .auth__lang .lang--plain .lang__btn--active { color: var(--navy); background: #fff; }
    .auth__mobile-brand {
        display: block;
        width: 100%;
        max-width: 380px;
        margin-bottom: 20px;
        padding: 14px 20px;
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 10px 24px rgba(0,0,0,0.25), 0 3px 0 0 var(--pink);
    }
    .auth__mobile-brand img { width: 100%; max-height: 64px; object-fit: contain; display: block; }
    .auth__card { padding: 32px 24px; }
    .auth__foot-mobile { display: block; }
    .grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 20px; }
    .dash__grid { gap: 16px; }
    .ra__markets { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .auth__panel { padding: 64px 14px 24px; }
    .auth__card { padding: 26px 18px; }
    .auth__card h2 { font-size: 1.5rem; }
    /* 16px prevents iOS from zooming into focused inputs */
    .auth__card .field input { font-size: 16px; }
    .dash__grid { gap: 12px; }
    .ra__markets { grid-template-columns: 1fr 1fr; }
}

/* Topbar: collapse to a hamburger menu on phones */
@media (max-width: 640px) {
    .topbar { padding: 0 16px; }
    .topbar__lang { display: none; }
    .menu__trigger--avatar { display: none; }
    .menu__trigger--burger { display: inline-flex; }
    .menu__lang { display: block; }
    .menu__panel { right: 16px; left: 16px; min-width: 0; }
    .menu__panel::before { right: 18px; }
}

/* ===================================================================
   DASHBOARD — square module grid
   =================================================================== */
.dash {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dash__head h1 { font-size: 2rem; font-weight: 900; color: var(--navy); letter-spacing: -0.5px; }
.dash__sub { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.dash__label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-top: 20px; }

.dash__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 10px;
}

.dash__tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 30px 18px 24px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--line);
    border-bottom: 4px solid var(--line);
    text-decoration: none;
    color: inherit;
    text-align: center;
    min-height: 190px;
    overflow: hidden;
    transition: border-color 0.18s, border-bottom-color 0.18s, box-shadow 0.18s, transform 0.18s;
    cursor: pointer;
}

/* Pink shimmer strip on top edge — reveals on hover */
.dash__tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 60%; height: 3px;
    background: linear-gradient(90deg, var(--pink) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.22s;
}
a.dash__tile:hover::before { opacity: 1; }

a.dash__tile:hover {
    border-color: var(--royal-300);
    border-bottom-color: var(--pink);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.dash__tile--soon {
    cursor: default;
    background:
        linear-gradient(180deg, rgba(237,240,248,0.5) 0%, rgba(255,255,255,0.9) 60%),
        var(--surface);
    border-style: dashed;
    border-bottom-style: solid;
    border-bottom-color: var(--royal-300);
}
.dash__tile--soon .dash__tile-icon {
    background: linear-gradient(145deg, #8893b4 0%, #aab4d1 100%);
    box-shadow: 0 6px 18px rgba(11,30,63,0.14), 0 0 0 3px rgba(11,30,63,0.05);
}
.dash__tile--soon .dash__tile-name { color: var(--navy); }
.dash__tile--soon:hover {
    border-color: var(--royal-300);
    border-bottom-color: var(--pink);
    box-shadow: var(--shadow-sm);
}

/* "Coming soon" ribbon — angled corner banner on upcoming modules */
.dash__ribbon {
    position: absolute;
    top: 14px; right: -34px;
    transform: rotate(45deg);
    width: 140px;
    padding: 4px 0;
    text-align: center;
    font-size: 0.58rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: #fff;
    background: linear-gradient(90deg, var(--pink) 0%, var(--pink-soft) 100%);
    box-shadow: 0 3px 8px rgba(214,51,85,0.28);
    z-index: 1;
}

/* Pink corner pip */
.dash__tile-pip {
    position: absolute;
    top: 10px; right: 10px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--pink);
    opacity: 0;
    transition: opacity 0.18s;
}
a.dash__tile:hover .dash__tile-pip { opacity: 1; }

.dash__tile-icon {
    flex-shrink: 0;
    width: 60px; height: 60px;
    background: linear-gradient(145deg, var(--navy) 0%, var(--royal) 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 18px rgba(39,71,214,0.28), 0 0 0 3px rgba(214,51,85,0.12);
    transition: box-shadow 0.18s, transform 0.18s;
}
a.dash__tile:hover .dash__tile-icon {
    box-shadow: 0 8px 24px rgba(39,71,214,0.38), 0 0 0 4px rgba(214,51,85,0.2);
    transform: scale(1.06);
}
.dash__tile-icon svg { width: 26px; height: 26px; }

.dash__tile-body { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.dash__tile-name { font-size: 0.95rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.dash__tile-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.45; }

/* "Soon" badge — top-right corner */
.dash__badge--soon {
    position: absolute;
    top: 10px; right: 10px;
    font-size: 0.6rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.8px;
    background: rgba(11,30,63,0.08);
    color: var(--muted);
    padding: 3px 8px;
    border-radius: 20px;
}
.dash__badge {
    font-size: 0.6rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.8px;
    background: rgba(11,30,63,0.08);
    color: var(--muted);
    padding: 3px 8px;
    border-radius: 20px;
}

/* ===================================================================
   ROUTE ASSIGNMENT — shared
   =================================================================== */
.ra {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.ra__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.ra__head h1 { font-size: 2rem; font-weight: 900; color: var(--navy); letter-spacing: -0.5px; }
.ra__muted { color: var(--muted); font-size: 0.92rem; }

.ra__switch { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.ra__switch select { padding: 8px 32px 8px 12px; border-radius: 10px; border: 1px solid rgba(11,30,63,0.18); font: inherit; background-color: #fff; }

.ra__section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
}

.ra__card { background: var(--surface); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow-sm); }
.ra__card h2 { font-size: 1.2rem; font-weight: 800; color: var(--navy); margin-bottom: 6px; }

.ra__form { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; max-width: 480px; }
.ra__field { display: flex; flex-direction: column; gap: 6px; }
.ra__field label { font-size: 0.82rem; font-weight: 700; color: var(--navy); }
.ra__field select { padding: 11px 36px 11px 13px; border-radius: 12px; border: 1px solid rgba(11,30,63,0.18); font: inherit; background-color: #fff; }

.ra__table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 0.9rem; }
.ra__table th, .ra__table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(11,30,63,0.08); }
.ra__table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

/* Compact key/value table */
.ra__table--compact th { width: 1%; white-space: nowrap; color: var(--muted); font-weight: 700; text-align: left; padding-right: 12px; }
.ra__table--compact td { padding-right: 28px; }

/* Phone layout: stack the 4-column key/value table so it never overflows */
@media (max-width: 600px) {
    .page { padding: 28px 16px 48px; }
    .ra__card { padding: 20px 16px; }

    .ra__table--compact,
    .ra__table--compact tbody,
    .ra__table--compact tr,
    .ra__table--compact th,
    .ra__table--compact td { display: block; width: 100%; }

    .ra__table--compact { margin-top: 10px; }
    .ra__table--compact tr {
        padding: 10px 0;
        border-bottom: 1px solid rgba(11,30,63,0.08);
    }
    .ra__table--compact tr:last-child { border-bottom: none; }
    .ra__table--compact th,
    .ra__table--compact td {
        padding: 0;
        border: none;
        white-space: normal;
    }
    .ra__table--compact th {
        font-size: 0.66rem;
        letter-spacing: 1px;
        margin-top: 8px;
    }
    .ra__table--compact th:first-child { margin-top: 0; }
    .ra__table--compact td {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--navy);
        margin: 2px 0 4px;
    }

    /* Bigger, iPhone-friendly tap target for the remove button */
    .ra__discard-btn { width: 40px; height: 40px; }
    .ra__discard-icon { width: 18px; height: 18px; }
}

.ra__empty { color: var(--muted); font-style: italic; margin-top: 12px; }

.ra__messages { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ra__msg { padding: 12px 16px; border-radius: 12px; font-size: 0.9rem; font-weight: 600; }
.ra__msg--success { background: rgba(34,160,90,0.12); color: #166c3b; }
.ra__msg--error   { background: rgba(214,51,85,0.12); color: var(--pink-text); }
.ra__msg--warning { background: rgba(255,168,0,0.12); color: #92600a; }
.ra__msg--info    { background: rgba(39,71,214,0.10); color: var(--royal); }

/* Loading overlay */
.ra__loader {
    display: none;
    position: fixed; inset: 0; z-index: 999;
    background: rgba(11,30,63,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: #fff;
}
.ra__loader.is-active { display: flex; }
.ra__spinner {
    width: 52px; height: 52px;
    border: 5px solid rgba(255,255,255,0.2);
    border-top-color: var(--pink);
    border-radius: 50%;
    animation: ra-spin 0.75s linear infinite;
}
@keyframes ra-spin { to { transform: rotate(360deg); } }
.ra__loader-text { font-size: 1rem; font-weight: 700; letter-spacing: 0.3px; opacity: 0.9; }

/* Crew helpers */
.ra__optional { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.ra__helper2-wrap { display: flex; gap: 8px; align-items: center; }
.ra__helper2-wrap select { flex: 1; }
.ra__remove-helper {
    flex-shrink: 0;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(214,51,85,0.3);
    background: rgba(214,51,85,0.07);
    color: var(--pink-text);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: grid; place-items: center;
    transition: background 0.15s, border-color 0.15s;
}
.ra__remove-helper:hover { background: rgba(214,51,85,0.16); border-color: var(--pink); }
.ra__crew-actions { margin-top: 4px; }
.ra__add-helper {
    display: inline-flex; align-items: center; gap: 6px;
    background: none;
    border: 1.5px dashed rgba(39,71,214,0.35);
    color: var(--royal);
    font: inherit; font-size: 0.85rem; font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.ra__add-helper:hover { background: rgba(39,71,214,0.07); border-color: var(--royal); }
.ra__add-icon { font-size: 1.1rem; line-height: 1; font-weight: 900; }
.ra__assign { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(11,30,63,0.08); }

/* Crew row — driver + helper1 side by side */
.ra__crew-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) { .ra__crew-row { grid-template-columns: 1fr; } }

.ra__confirm-btn { max-width: 240px; margin-top: 4px; }

/* ===================================================================
   ROUTE ASSIGNMENT — Review card: source image, editable fields, crew
   =================================================================== */

/* Scanned source preview on top of a route card */
.ra__source {
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #f6f8fd;
}
.ra__source a { display: block; }
.ra__source img {
    display: block;
    width: 100%;
    max-height: 340px;
    object-fit: contain;
    background: #0b1e3f;
}
.ra__source-cap {
    margin: 0;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
    background: #fff;
    border-top: 1px solid var(--line);
}

/* Route start date */
.ra__routedate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding-bottom: 4px;
}
.ra__routedate-label {
    font-weight: 700;
    color: var(--navy);
    font-size: 0.95rem;
}
.ra__req {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(214,39,71,0.10);
    color: #b3123b;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    vertical-align: middle;
}
.ra__routedate input[type="date"] {
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font: inherit;
    color: var(--navy);
    background: #fbfcff;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ra__routedate input[type="date"]:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background: #fff;
}
.ra__routedate-hint { color: var(--muted); font-size: 0.82rem; }

/* Editable extracted fields */
.ra__edit {
    margin-top: 4px;
    padding-top: 18px;
    border-top: 1px solid rgba(11,30,63,0.08);
}
.ra__edit-label {
    margin: 0 0 12px;
    font-weight: 700;
    color: var(--navy);
    font-size: 0.95rem;
}
.ra__edit-hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.ra__edit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.ra__edit-field { display: flex; flex-direction: column; gap: 4px; }
.ra__edit-field span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}
.ra__edit-field input {
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font: inherit;
    background: #fbfcff;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ra__edit-field select {
    padding: 9px 34px 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font: inherit;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ra__edit-field input:focus,
.ra__edit-field select:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background-color: #fff;
}

/* Crew assignment — two columns.  The assign form must ignore the narrow
   .ra__form width cap so the boxes can fill the card. */
.ra__assign2 { max-width: none; }
.ra__crew {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 20px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(11,30,63,0.08);
    align-items: start;
}
.ra__crew-selected { display: flex; flex-direction: column; }
.ra__crew-title {
    margin: 0 0 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.ra__crew-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-height: min(58vh, 460px);
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: #f6f8fd;
}
.ra__crew-zone { display: flex; flex-direction: column; gap: 8px; }
.ra__crew-zone + .ra__crew-zone { padding-top: 14px; border-top: 1px solid var(--line); }
.ra__crew-zone-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy);
}
.ra__crew-zone-count {
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0;
    text-transform: none;
}
.ra__crew-zone-body { display: flex; flex-direction: column; gap: 8px; }
.ra__crew-slot-empty { margin: 0; color: var(--muted); font-size: 0.82rem; }
.ra__crew-rule { margin: 12px 0 0; font-size: 0.76rem; color: var(--muted); }

/* Selected crew chip */
.ra__chip {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2px 10px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.ra__chip--driver { border-color: var(--royal); box-shadow: 0 0 0 1px var(--royal) inset; }
.ra__chip-tag {
    grid-row: 1 / span 2;
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    background: #eef2fb;
    border-radius: 7px;
}
.ra__chip--driver .ra__chip-tag { color: #fff; background: var(--royal); }
.ra__chip-name { font-weight: 600; color: var(--navy); }
.ra__chip-meta { grid-column: 2; font-size: 0.78rem; color: var(--muted); }
.ra__chip-btn {
    grid-row: 1 / span 2;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ra__chip-btn--rm:hover { border-color: var(--pink); color: var(--pink-text); background: rgba(214,51,85,0.06); }

/* Crew search column */
.ra__crew-search { display: flex; flex-direction: column; }
.ra__crew-searchbar { position: relative; margin-bottom: 10px; }
.ra__crew-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}
.ra__crew-searchbar input {
    width: 100%;
    padding: 11px 12px 11px 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    background: #fbfcff;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ra__crew-searchbar input:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background: #fff;
}
.ra__crew-filters { display: flex; gap: 6px; margin-bottom: 10px; }
.ra__crew-filter {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: #fff;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ra__crew-filter:hover { border-color: var(--royal); color: var(--royal); }
.ra__crew-filter.is-active { background: var(--royal); border-color: var(--royal); color: #fff; }

.ra__crew-listhead,
.ra__crew-item {
    display: grid;
    grid-template-columns: 1.7fr 1fr 0.9fr 1.2fr;
    gap: 10px;
    align-items: center;
}
.ra__crew-listhead {
    padding: 6px 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}
.ra__crew-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    max-height: min(58vh, 460px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.ra__crew-list li + li { border-top: 1px solid var(--line); }
.ra__crew-item {
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
    position: relative;
    transition: background 0.12s;
}
.ra__crew-item:hover { background: #f2f5fc; }
.ra__crew-item.is-driver { background: rgba(39,71,214,0.10); }
.ra__crew-item.is-helper { background: rgba(39,71,214,0.05); }
.ra__crew-item.is-unavailable { cursor: not-allowed; background: #eef1f6; opacity: 0.7; }
.ra__crew-item.is-unavailable:hover { background: #eef1f6; }
.ra__crew-item.is-unavailable .ra__crew-cell { filter: grayscale(1); color: #9aa6bd; }
.ra__crew-item.is-unavailable .ra__crew-name { color: #8f9bb5; font-weight: 600; }
.ra__crew-item.is-unavailable .ra__crew-badge { background: #c4ccdd; color: #fff; }
.ra__crew-name { font-weight: 600; color: var(--navy); }
.ra__crew-role, .ra__crew-dist { font-size: 0.84rem; color: var(--muted); }
.ra__crew-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.ra__crew-badge {
    font-size: 0.72rem;
    color: #fff;
    background: var(--royal);
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}
.ra__crew-noresults { margin: 10px 2px 0; color: var(--muted); font-size: 0.85rem; }
.ra__crew-empty {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px dashed var(--line);
    border-radius: 9px;
    background: #fbfcff;
    color: var(--muted);
    font-size: 0.85rem;
}
.ra__crew-confirm { margin-top: 20px; }

/* Truck picker on the assign form */
.ra__truck {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(11,30,63,0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ra__truck-head { display: flex; align-items: center; gap: 10px; }
.ra__truck-label { font-size: 0.95rem; font-weight: 800; color: var(--navy); }
.ra__truck-chip {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--royal);
    background: rgba(39,71,214,0.10);
    padding: 3px 9px;
    border-radius: var(--radius-pill);
}
.ra__truck-chip--req { color: #b3123b; background: rgba(214,39,71,0.10); }
.ra__truck-sub { margin: 0 0 6px; font-size: 0.82rem; color: var(--muted); }
.ra__truck-field { position: relative; max-width: 440px; }
.ra__truck-ico {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 20px;
    color: var(--royal);
    pointer-events: none;
}
.ra__truck-select {
    width: 100%;
    padding-left: 46px;
}
.ra__truck-empty {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

@media (max-width: 860px) {
    .ra__edit-grid { grid-template-columns: 1fr 1fr; }
    .ra__crew { grid-template-columns: 1fr; }
    .ra__crew-box { min-height: 0; }
    .ra__crew-list { max-height: 60vh; }
}
@media (max-width: 600px) {
    .ra__edit-grid { grid-template-columns: 1fr; }
    .ra__crew-listhead { display: none; }
    .ra__crew-item {
        grid-template-columns: 1fr auto;
        gap: 4px 10px;
    }
    .ra__crew-name { grid-column: 1; }
    .ra__crew-role { grid-column: 2; text-align: right; }
    .ra__crew-dist { grid-column: 1; }
    .ra__crew-badges { grid-column: 2; justify-content: flex-end; }
}


/* ===================================================================
   ROUTE ASSIGNMENT — Market card grid (index page)
   =================================================================== */
.ra__markets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.ra__market-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 16px 22px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--line);
    border-bottom: 4px solid var(--line);
    text-decoration: none;
    color: inherit;
    min-height: 180px;
    text-align: center;
    overflow: hidden;
    transition: border-color 0.18s, border-bottom-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

/* Pink top shimmer */
.ra__market-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 55%; height: 3px;
    background: linear-gradient(90deg, var(--pink) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s;
}
.ra__market-card:hover::before { opacity: 1; }
.ra__market-card:hover {
    border-color: var(--royal-300);
    border-bottom-color: var(--pink);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

/* Pending count badge (top-right) */
.ra__market-badge {
    position: absolute;
    top: -1px; right: 10px;
    background: var(--pink);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 0 0 8px 8px;
    min-width: 22px;
    text-align: center;
    letter-spacing: 0.3px;
}

/* Market logo bubble */
.ra__market-logo {
    width: 76px; height: 76px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--navy) 0%, var(--royal-600) 100%);
    box-shadow: 0 5px 16px rgba(11,30,63,0.22), 0 0 0 3px rgba(214,51,85,0.14);
    transition: transform 0.18s, box-shadow 0.18s;
    flex-shrink: 0;
}
.ra__market-card:hover .ra__market-logo {
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(11,30,63,0.3), 0 0 0 4px rgba(214,51,85,0.22);
}
.ra__market-logo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.ra__market-monogram { font-size: 1.6rem; font-weight: 900; color: #fff; letter-spacing: -0.5px; }

/* Large version for the review page hero */
.ra__market-logo--lg {
    width: 80px; height: 80px;
    border-radius: 22px;
}
.ra__market-logo--lg .ra__market-monogram { font-size: 1.9rem; }

.ra__market-name  { font-size: 0.92rem; font-weight: 800; color: var(--navy); }
.ra__market-loc   { font-size: 0.75rem; color: var(--muted); }

/* All markets running routes today */
.ra__running {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 12px;
}
.ra__running-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--royal);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
}
.ra__running-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ra__running-copy svg { width: 16px; height: 16px; }
.ra__running-copy:hover {
    border-color: var(--royal);
    color: var(--royal);
    background: rgba(39,71,214,0.06);
}
.ra__running-copy.is-copied {
    border-color: #1f9d55;
    color: #1f9d55;
    background: rgba(31,157,85,0.10);
}
.ra__running-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding-right: 36px;
}
.ra__running-market { font-weight: 800; color: var(--navy); }
.ra__running-route { font-size: 0.8rem; font-weight: 700; color: var(--royal); }
.ra__running-area { margin: 0; font-size: 0.85rem; color: var(--muted); }
.ra__running-crew {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
}
.ra__running-crew dt {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}
.ra__running-crew dd { margin: 2px 0 0; font-size: 0.86rem; font-weight: 600; color: var(--navy); }
.ra__running-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 8px 0 0;
    border-top: 1px solid var(--line);
}
.ra__running-stats li {
    font-size: 0.8rem;
    color: var(--navy);
    background: #f2f5fc;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
}
.ra__running-stats li span { color: var(--muted); margin-right: 4px; }

/* Editable last-7-days assignment log */
.ra__log-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}
.ra__log-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.ra__log-searchbar { position: relative; }
.ra__log-searchbar svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--muted);
    pointer-events: none;
}
.ra__log-searchbar input {
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    background: #fbfcff;
    min-width: 240px;
}
.ra__log-searchbar input:focus,
.ra__log-filter:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background-color: #fff;
}
.ra__log-filter {
    padding: 9px 34px 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    color: var(--navy);
    background-color: #fbfcff;
}
.ra__log {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
}
.ra__log-row + .ra__log-row { border-top: 1px solid var(--line); }
.ra__log-summary {
    width: 100%;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.3fr 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: none;
    border: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}
.ra__log-summary:hover { background: #f2f5fc; }
.ra__log-market { font-weight: 700; color: var(--navy); }
.ra__log-route { font-size: 0.85rem; font-weight: 600; color: var(--royal); }
.ra__log-driver { font-size: 0.86rem; color: var(--navy); }
.ra__log-helper { display: block; margin-top: 2px; font-size: 0.76rem; font-weight: 500; color: var(--muted); }
.ra__edit-static {
    margin: 0;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #eef2fb;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.9rem;
}
.ra__log-date { font-size: 0.82rem; color: var(--muted); }
.ra__log-chev { width: 18px; height: 18px; color: var(--muted); transition: transform 0.18s; }
.ra__log-summary.is-open .ra__log-chev { transform: rotate(180deg); }
.ra__log-edit {
    padding: 4px 16px 18px;
    background: #f8fafe;
    border-top: 1px dashed var(--line);
}
.ra__log-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 14px;
}
.ra__log-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}
.ra__log-assigned { font-size: 0.85rem; color: var(--muted); }
.ra__log-assigned strong { color: var(--navy); }
.ra__log-save { padding: 9px 20px; }
.ra__log-noresults { margin: 0; padding: 16px; color: var(--muted); font-size: 0.88rem; text-align: center; }

@media (max-width: 720px) {
    .ra__log-summary { grid-template-columns: 1fr 1fr auto; }
    .ra__log-driver, .ra__log-date { display: none; }
    .ra__log-grid { grid-template-columns: 1fr 1fr; }
}

/* ===================================================================
   ROUTE ASSIGNMENT — Review / market hub page
   =================================================================== */
.ra__market-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 4px 0 8px;
}
.ra__market-hero-text h1 { font-size: 2rem; font-weight: 900; color: var(--navy); letter-spacing: -0.5px; }

/* Intake card */
.ra__intake { border-left: 4px solid var(--pink); }
.ra__intake-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 4px;
}
.ra__intake-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--royal) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.ra__intake-icon svg { width: 20px; height: 20px; }
.ra__intake-form { max-width: 520px; margin-top: 18px; }
.ra__intake-btn { max-width: 260px; }

/* Drag-and-drop dropzone */
.ra__field--file { max-width: 520px; }
.ra__dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 24px;
    border: 2px dashed rgba(39,71,214,0.3);
    border-radius: 14px;
    background: rgba(39,71,214,0.03);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.ra__dropzone:hover, .ra__dropzone.is-over {
    border-color: var(--royal);
    background: rgba(39,71,214,0.06);
}
.ra__dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%; height: 100%;
}
.ra__drop-icon { width: 36px; height: 36px; color: var(--royal); opacity: 0.6; }
.ra__drop-text { font-size: 0.9rem; font-weight: 700; color: var(--navy); }
.ra__drop-link { color: var(--royal); text-decoration: underline; }
.ra__drop-hint { font-size: 0.78rem; color: var(--muted); }

/* Route card header */
.ra__discard-form { margin: 0 0 0 auto; padding: 0; display: flex; }
.ra__discard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: none;
    padding: 0;
    background: var(--navy);
    border: none;
    border-radius: 50%;
    color: var(--pink-text);
    cursor: pointer;
    line-height: 0;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    box-shadow: 0 2px 8px rgba(11, 30, 63, 0.20);
    transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.12s;
}
.ra__discard-icon {
    width: 16px;
    height: 16px;
    flex: none;
    display: block;
}
/* Hover only on real pointer devices so touch doesn't get stuck */
@media (hover: hover) {
    .ra__discard-btn:hover {
        background: var(--pink);
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 5px 16px rgba(214, 51, 85, 0.34);
    }
}
.ra__discard-btn:active {
    background: var(--pink);
    color: #fff;
    transform: scale(0.92);
}
.ra__discard-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(214, 51, 85, 0.35);
}

.ra__route-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 4px;
}
.ra__route-id {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--navy);
}
.ra__route-area {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    background: rgba(11,30,63,0.06);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
}

/* ===================================================================
   EMPLOYEE CONSOLE
   =================================================================== */
.ra__head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ra__emp-link,
.emp__new-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.ra__emp-link svg,
.emp__new-btn svg { width: 16px; height: 16px; flex: none; }

/* ===================================================================
   COMPANY CRM — hub + data tables
   =================================================================== */
.crm__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 10px;
}
.crm__count {
    margin-top: 4px;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--royal);
    line-height: 1;
}

/* Full-width search above the table */
.crm__searchbar {
    position: relative;
    display: flex;
    align-items: center;
}
.crm__search-icon {
    position: absolute;
    left: 16px;
    width: 18px; height: 18px;
    color: var(--muted);
    pointer-events: none;
}
.crm__searchbar input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border-radius: 12px;
    border: 1px solid rgba(11,30,63,0.18);
    background: var(--surface);
    font: inherit;
    box-shadow: var(--shadow-sm);
}
.crm__searchbar input:focus {
    outline: none;
    border-color: var(--royal-300);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.12);
}

/* Data table */
.crm__table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}
.crm__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.crm__table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    border-bottom: 1px solid rgba(11,30,63,0.1);
    white-space: nowrap;
}
.crm__table td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(11,30,63,0.06);
    color: var(--navy);
    vertical-align: middle;
}
.crm__table tbody tr:last-child td { border-bottom: none; }
.crm__table tbody tr:hover { background: var(--bg); }
.crm__cell-primary { font-weight: 800; }

/* Carrier grouping in the markets table — banner headers + tinted rows. */
.crm__group-row th {
    padding: 0;
    border: none;
    border-bottom: 2px solid rgba(255,255,255,0.35);
    background-image: linear-gradient(90deg, var(--group-accent, var(--muted)), var(--group-accent-2, var(--muted)));
    box-shadow: inset 0 -1px 0 rgba(11,30,63,0.12), 0 1px 2px rgba(11,30,63,0.12);
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}
.crm__table--grouped tbody tr:first-child.crm__group-row th { border-top: none; }

.crm__group-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 18px;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: #fff;
    transition: background 0.15s ease;
}
.crm__group-toggle:hover { background: rgba(255,255,255,0.1); }
.crm__group-sign {
    position: relative;
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 1px 3px rgba(11,30,63,0.25);
}
.crm__group-sign::before,
.crm__group-sign::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 2px;
    background: var(--group-accent, var(--muted));
    border-radius: 2px;
    transform: translate(-50%, -50%);
    transition: opacity 0.15s;
}
.crm__group-sign::after { transform: translate(-50%, -50%) rotate(90deg); }
/* Expanded state hides the vertical bar, turning “+” into “−”. */
.crm__group-toggle[aria-expanded="true"] .crm__group-sign::after { opacity: 0; }

.crm__group-name {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 1px rgba(11,30,63,0.18);
}
.crm__group-count {
    display: inline-block;
    min-width: 24px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

/* Child market rows: faint wash of the parent carrier's colour. */
.crm__group-item > td {
    background: var(--group-soft, transparent);
    border-left: 3px solid var(--group-accent, transparent);
}
.crm__group-item > td:not(.crm__cell-primary) { border-left-color: transparent; }
.crm__table--grouped .crm__group-item:hover > td { background: var(--group-soft-hover, var(--bg)); }
.crm__group-item.is-collapsed { display: none; }

/* Palette: tones of blue, reddish and grey (accent, lighter, wash, hover). */
.crm__group--c0 { --group-accent: #2747d6; --group-accent-2: #4968e6; --group-soft: rgba(39,71,214,0.055); --group-soft-hover: rgba(39,71,214,0.11); }
.crm__group--c1 { --group-accent: #c43a56; --group-accent-2: #dc5a72; --group-soft: rgba(196,58,86,0.055); --group-soft-hover: rgba(196,58,86,0.11); }
.crm__group--c2 { --group-accent: #5a6478; --group-accent-2: #767f92; --group-soft: rgba(90,100,120,0.06); --group-soft-hover: rgba(90,100,120,0.12); }
.crm__group--c3 { --group-accent: #1f82c4; --group-accent-2: #3f9bd6; --group-soft: rgba(31,130,196,0.055); --group-soft-hover: rgba(31,130,196,0.11); }
.crm__group--c4 { --group-accent: #b7544a; --group-accent-2: #cc6d63; --group-soft: rgba(183,84,74,0.055); --group-soft-hover: rgba(183,84,74,0.11); }
.crm__group--c5 { --group-accent: #46547e; --group-accent-2: #5e6f9c; --group-soft: rgba(70,84,126,0.055); --group-soft-hover: rgba(70,84,126,0.11); }
.crm__group--cother { --group-accent: #78808f; --group-accent-2: #949cab; --group-soft: rgba(120,128,143,0.06); --group-soft-hover: rgba(120,128,143,0.12); }

.crm__col-action { width: 1%; white-space: nowrap; text-align: right; }
.crm__edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--royal);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.crm__edit:hover {
    border-color: var(--royal-300);
    background: rgba(39,71,214,0.06);
}

.crm__pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}
.crm__pill--on { background: rgba(34,160,90,0.12); color: #17733f; }
.crm__pill--off { background: rgba(214,51,85,0.12); color: var(--pink-text); }

.crm__empty-row td {
    text-align: center;
    color: var(--muted);
    padding: 28px 16px;
    font-size: 0.92rem;
}

@media (max-width: 760px) {
    .crm__grid { grid-template-columns: 1fr; }
}

.emp {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 20px;
    margin-top: 20px;
    align-items: start;
}

/* Search column */
.emp__search-col {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}
.emp__searchbar {
    position: relative;
    display: flex;
    align-items: center;
}
.emp__search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}
.emp__searchbar input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: var(--bg);
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.emp__searchbar input:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background: #fff;
}

.emp__results {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 60vh;
    overflow-y: auto;
}
.emp__result {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 14px;
    text-align: left;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, border-color 0.15s;
}
@media (hover: hover) {
    .emp__result:hover { background: var(--bg); }
}
.emp__result.is-active {
    background: rgba(39,71,214,0.08);
    border-color: var(--royal-300);
}
.emp__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--royal), var(--pink));
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.emp__avatar--lg { width: 54px; height: 54px; font-size: 1.1rem; }
.emp__result-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.emp__result-name { font-weight: 800; color: var(--navy); font-size: 0.95rem; }
.emp__result-meta {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.emp__empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Detail column */
.emp__detail-col {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px 26px;
    min-height: 260px;
}
.emp__detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    height: 100%;
    min-height: 220px;
    color: var(--muted);
    text-align: center;
}
.emp__detail-placeholder svg { width: 46px; height: 46px; color: var(--line); }
.emp__detail-placeholder p { font-size: 0.92rem; max-width: 240px; }

.emp__detail-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}
.emp__detail-head h2 { font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.emp__status {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.emp__status--on { background: rgba(34,160,90,0.12); color: #1c8a4d; }
.emp__status--off { background: rgba(214,51,85,0.12); color: var(--pink-text); }
.emp__detail-table { margin-top: 8px; }

.emp__detail-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}
.emp__edit-btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.emp__edit-btn svg { width: 16px; height: 16px; flex: none; }

.emp__toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--navy);
}
.emp__toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--royal);
    cursor: pointer;
}
.emp__hint {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 6px;
    font-weight: 600;
}

/* Employee form */
.emp__form-card { max-width: 720px; margin-top: 20px; }
.emp__form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
}
.emp__field--full { grid-column: 1 / -1; }
.emp__req { color: var(--pink-text); font-weight: 900; }

/* Onboarding form controls */
.onb__modes { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 6px; }
.onb__radio,
.onb__check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
}
.onb__modules { display: flex; gap: 10px 22px; flex-wrap: wrap; margin-top: 4px; }
.onb__modules-hint { margin: 2px 0 6px; }
.onb__radio input,
.onb__check input { width: 16px; height: 16px; accent-color: var(--pink); }

/* People directory */
.ppl__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 10px 0 18px; }
.ppl__stat {
    display: flex; flex-direction: column; gap: 6px;
    padding: 16px 20px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--navy);
}
.ppl__stat:hover { box-shadow: 0 0 0 2px var(--royal-300); }
.ppl__stat-num { font-size: 1.5rem; font-weight: 900; color: var(--royal); line-height: 1; }
.ppl__stat-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.ppl__filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.ppl__filter--wide { grid-column: 1 / -1; }
.ppl__filter-actions { display: flex; gap: 8px; }
.ppl__count { margin-bottom: 8px; font-size: 0.85rem; }
.ppl__username { font-size: 0.78rem; margin-top: 2px; }
.ppl__chip {
    display: inline-block;
    margin: 2px 6px 2px 0;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(39,71,214,0.08);
    color: var(--royal);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}
.ppl__chip--off { background: rgba(120,128,143,0.12); color: var(--muted); text-decoration: line-through; }
.ppl__pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.ppl__hint { margin: 4px 0 14px; }
.ppl__membership { padding: 16px 0; border-top: 1px solid var(--line); }
.ppl__membership-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--navy); }
.ppl__active-toggle { margin-top: 30px; }
@media (max-width: 760px) {
    .ppl__stats { grid-template-columns: 1fr; }
    .ppl__filters { grid-template-columns: 1fr 1fr; }
}
.emp__select {
    width: 100%;
    padding: 12px 42px 12px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--ink);
    background-color: var(--bg);
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.emp__select:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background-color: #fff;
}
.emp__form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}
.emp__submit { width: auto; }

/* Rate cards — dynamic list of base-rate / admin-% / condition rows */
.rate-cards {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.rate-cards__head { margin-bottom: 14px; }
.rate-cards__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}
.rate-cards__hint {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}
.rate-cards__list { display: flex; flex-direction: column; gap: 12px; }
.rate-card {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr 40px;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcff;
}
.rate-card .field { gap: 4px; }
.rate-card label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}
.rate-card input,
.rate-card select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font: inherit;
    background-color: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.rate-card select { padding-right: 34px; }
.rate-card input:focus,
.rate-card select:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
}
.rate-card__cond { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }
.rate-card__remove {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.rate-card__remove:hover {
    border-color: var(--pink);
    color: var(--pink-text);
    background: rgba(214,51,85,0.06);
}
.rate-cards__add {
    align-self: flex-start;
    margin-top: 14px;
}
@media (max-width: 620px) {
    .rate-card { grid-template-columns: 1fr 1fr; }
    .rate-card__cond-field { grid-column: 1 / -1; }
    .rate-card__remove { grid-column: 1 / -1; width: 100%; }
}

/* Rate cards — detail panel view */
.emp__rates-view { margin-top: 18px; }
.emp__rates-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin: 0 0 8px;
}
.emp__rates-table { width: 100%; }

/* Market badges — form section */
.emp__section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.emp__section-head { margin-bottom: 16px; }
.emp__section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}
.emp__section-sub {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}
.emp__badges { display: flex; flex-direction: column; gap: 10px; }
.emp__badge-row {
    display: grid;
    grid-template-columns: 1fr 200px 40px;
    gap: 10px;
    align-items: center;
}
.emp__badge-row input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    background: #fbfcff;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.emp__badge-row input[type="text"]:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background: #fff;
}
.emp__badge-remove {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.emp__badge-remove:hover {
    border-color: var(--pink);
    color: var(--pink-text);
    background: rgba(214,51,85,0.06);
}
.emp__badge-add {
    align-self: flex-start;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.emp__badge-add svg { width: 16px; height: 16px; }

/* Market badges — detail panel */
.emp__badges-view { margin-top: 18px; }
.emp__badges-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin: 0 0 10px;
}
.emp__badges-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.emp__badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: #fbfcff;
}
.emp__badge-chip-market {
    font-weight: 600;
    color: var(--navy);
    font-size: 0.85rem;
}
.emp__badge-chip-code {
    font-size: 0.8rem;
    color: #fff;
    background: var(--royal);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}
.emp__badges-empty {
    color: var(--muted);
    font-size: 0.88rem;
}

@media (max-width: 760px) {
    .emp { grid-template-columns: 1fr; }
    .emp__form-grid { grid-template-columns: 1fr; }
    .emp__form-actions { flex-direction: column-reverse; }
    .emp__form-actions .btn { width: 100%; }
    .emp__results { max-height: none; }
    .emp__badge-row { grid-template-columns: 1fr 1fr 40px; }
}

/* ===================================================================
   PAYROLL — driver earnings report
   =================================================================== */
.pay__filters { padding: 18px; }
.pay__filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    align-items: end;
}
.pay__field { display: flex; flex-direction: column; gap: 5px; }
.pay__field > span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}
.pay__field select,
.pay__field input[type="date"] {
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font: inherit;
    color: var(--navy);
    background-color: #fbfcff;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.pay__field select { padding-right: 34px; }
.pay__field select:focus,
.pay__field input[type="date"]:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background-color: #fff;
}
.pay__field--action .btn { width: 100%; }
.pay__error { margin: 12px 0 0; color: var(--pink-text); font-size: 0.85rem; font-weight: 600; }

.pay__summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 4px; }
.pay__chip {
    font-size: 0.85rem;
    color: var(--navy);
    background: #f2f5fc;
    border: 1px solid var(--line);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
}
.pay__chip--total { background: var(--navy); border-color: var(--navy); color: #fff; }
.pay__chip--total strong { color: #fff; }

.pay__drivers { padding: 16px 18px; }
.pay__drivers-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.pay__driver-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px 16px;
}
.pay__driver {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--navy);
    cursor: pointer;
}
.pay__driver input { width: 16px; height: 16px; accent-color: var(--royal); }

.pay__day { padding: 14px 16px; }
.pay__day-date { margin: 0 0 10px; font-size: 0.95rem; font-weight: 800; color: var(--navy); }
.pay__day-dow {
    display: inline-block;
    padding: 2px 10px;
    margin-right: 4px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--royal);
    border-radius: var(--radius-pill);
}
.pay__table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pay__table th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
}
.pay__table td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--navy); overflow-wrap: anywhere; word-break: break-word; }
.pay__table tr:last-child td { border-bottom: none; }
.pay__num { text-align: right; }
.pay__grand td {
    font-weight: 800;
    color: var(--navy);
    border-top: 2px solid var(--navy);
    background: #f6f8fd;
}

@media (max-width: 620px) {
    .pay__filter-grid { grid-template-columns: 1fr; }

    /* Chips & driver picker stack cleanly on narrow screens */
    .pay__summary { gap: 8px; }
    .pay__chip { font-size: 0.8rem; }
    .pay__drivers-head { align-items: flex-start; }
    .pay__drivers-head .btn { width: 100%; }
    .pay__driver-list { grid-template-columns: 1fr; }

    /* Transform wide 7-column tables into stacked cards so nothing
       overflows the container on phones. */
    .pay__table { font-size: 0.9rem; }
    .pay__table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }
    .pay__table tr {
        display: block;
        border: 1px solid var(--line);
        border-radius: 10px;
        margin-bottom: 12px;
        background: #fff;
        overflow: hidden;
    }
    .pay__table td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 14px;
        text-align: right;
        padding: 9px 12px;
        border-bottom: 1px solid var(--line);
    }
    .pay__table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        text-align: left;
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--muted);
    }
    .pay__table td:last-child { border-bottom: none; }
    .pay__num { text-align: right; }
    .pay__grand { border-color: var(--navy); }
    .pay__grand td { border-top: none; }
    .pay__grand td:first-child { border-bottom: 1px solid var(--line); }
}

/* ===================================================================
   TRUCKS — employees-covered tag picker
   =================================================================== */
.empcov {
    border: 1px solid var(--line, #d7deea);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}
.empcov__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
    margin-bottom: 10px;
}
.empcov__placeholder {
    color: #8a93a6;
    font-size: 0.9rem;
    align-self: center;
}
.empcov__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    border-radius: 999px;
    background: var(--navy, #0b1e3f);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.4;
}
.empcov__tag-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.empcov__tag-x:hover { background: rgba(255, 255, 255, 0.4); }
.empcov__search {
    position: relative;
    margin-bottom: 8px;
}
.empcov__search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #8a93a6;
    pointer-events: none;
}
.empcov__search input {
    width: 100%;
    padding-left: 32px;
}
.empcov__list-wrap {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--line, #e3e8f1);
    border-radius: 8px;
}
.empcov__list {
    width: 100%;
    border-collapse: collapse;
}
.empcov__row {
    cursor: pointer;
    border-bottom: 1px solid #eef1f7;
}
.empcov__row:last-child { border-bottom: none; }
.empcov__row:hover { background: #f4f7fd; }
.empcov__row-name {
    padding: 9px 12px;
    color: var(--navy, #0b1e3f);
    font-weight: 600;
}
.empcov__row-action {
    padding: 9px 12px;
    text-align: right;
    white-space: nowrap;
}
.empcov__add {
    color: var(--royal, #2563eb);
    font-weight: 700;
    font-size: 0.85rem;
}
.empcov__empty {
    padding: 14px 12px;
    margin: 0;
    color: #8a93a6;
    font-size: 0.9rem;
}

/* Point-of-contact emails — repeatable email entry with chips */
.poc {
    border: 1px solid var(--line, #d7deea);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}
.poc__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
    margin-bottom: 10px;
}
.poc__placeholder {
    color: #8a93a6;
    font-size: 0.9rem;
    align-self: center;
}
.poc__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    border-radius: 999px;
    background: var(--navy, #0b1e3f);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.4;
    max-width: 100%;
}
.poc__tag-name { word-break: break-all; }
.poc__tag-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.poc__tag-x:hover { background: rgba(255, 255, 255, 0.4); }
.poc__entry {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.poc__input { flex: 1; min-width: 0; }
.poc__add { white-space: nowrap; align-self: stretch; }
.poc__error {
    margin: 8px 0 0;
    color: #b3123b;
    font-size: 0.85rem;
    font-weight: 600;
}


/* ===================================================================
   CLAIMS MODULE
   =================================================================== */
/* Textareas share the field look used across the forms. */
.field textarea,
.emp__form textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    background-color: var(--bg);
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    resize: vertical;
    min-height: 92px;
    line-height: 1.5;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.field textarea:focus,
.emp__form textarea:focus {
    outline: none;
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.10);
    background-color: #fff;
}
.btn--sm { padding: 6px 12px; font-size: 0.82rem; box-shadow: none; }
.emp__opt {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
}

/* Gmail connection card */
.clm__conn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.clm__conn-main { display: flex; align-items: center; gap: 16px; min-width: 260px; flex: 1; }
.clm__conn-icon {
    flex-shrink: 0;
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    background: linear-gradient(145deg, var(--navy) 0%, var(--royal) 100%);
    box-shadow: 0 6px 18px rgba(39,71,214,0.26);
}
.clm__conn-icon svg { width: 24px; height: 24px; }
.clm__conn-title { font-size: 1.05rem; font-weight: 800; color: var(--navy); margin: 0; }
.clm__conn-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }
.clm__conn-synced { display: inline-block; margin-left: 8px; color: #8a93a6; font-size: 0.8rem; }
.clm__conn-actions { display: flex; align-items: center; gap: 12px; }
.clm__pill {
    display: inline-flex; align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.74rem; font-weight: 700;
    color: var(--muted); background: rgba(11,30,63,0.07);
    white-space: nowrap;
}
.clm__pill--ok { color: #1f8a4c; background: rgba(31,138,76,0.12); }
.clm__pill--warn { color: #b3123b; background: rgba(214,39,71,0.10); }

/* Latest-email preview (shown under a connected mailbox) */
.clm__latest {
    flex-basis: 100%;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(11,30,63,0.08);
}
.clm__latest-label {
    margin: 0 0 8px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--muted);
}
.clm__latest-mail { display: flex; flex-direction: column; gap: 4px; }
.clm__latest-row {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.clm__latest-subject { font-weight: 700; color: var(--navy); }
.clm__latest-date { flex-shrink: 0; color: #8a93a6; font-size: 0.8rem; }
.clm__latest-from { margin: 0; color: var(--muted); font-size: 0.85rem; }
.clm__latest-snippet { margin: 2px 0 0; color: var(--muted); font-size: 0.88rem; }
.clm__latest-empty { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Summary stats */
.clm__stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-top: 4px;
}
.clm__stat {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-bottom: 4px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px 14px;
    display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
}
.clm__stat-num { font-size: 1.6rem; font-weight: 900; color: var(--navy); line-height: 1; }
.clm__stat-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

/* Claims table + status badges */
.clm__table td, .clm__table th { vertical-align: middle; }
.clm__num { text-align: right; white-space: nowrap; }

/* Claims list toolbar: full-width search + status filter (mirrors .crm__searchbar) */
.clm__count { color: var(--muted); font-weight: 700; }
.clm__toolbar {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin: 0 0 14px;
}
.clm__searchbar {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}
.clm__searchbar .clm__search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}
.clm__searchbar input {
    width: 100%;
    height: 46px;
    padding: 0 16px 0 44px;
    border-radius: 12px;
    border: 1px solid rgba(11,30,63,0.18);
    background-color: var(--surface);
    font: inherit;
    font-size: 0.92rem;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.clm__searchbar input::placeholder { color: #9aa5ba; }
.clm__searchbar input:focus {
    outline: none;
    border-color: var(--royal-300);
    box-shadow: 0 0 0 3px rgba(39,71,214,0.12);
}
/* Only longhand properties so the global select chevron is preserved. */
.clm__status-filter {
    flex: 0 0 200px;
    height: 46px;
    padding-top: 0;
    padding-bottom: 0;
    border-color: rgba(11,30,63,0.18);
}
.clm__toolbar-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 104px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    white-space: nowrap;
}
@media (max-width: 720px) {
    .clm__toolbar { flex-wrap: wrap; }
    .clm__searchbar { flex-basis: 100%; }
    .clm__status-filter { flex: 1 1 auto; }
}

/* Claims pagination */
.clm__pager {
    display: flex; align-items: center; justify-content: center;
    gap: 14px; margin-top: 16px;
}
.clm__pager-info { color: var(--muted); font-size: 0.86rem; font-weight: 700; }
.clm__pager-disabled { opacity: 0.45; pointer-events: none; }
.clm__status {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.02em;
    color: var(--muted); background: rgba(11,30,63,0.07);
}
.clm__status--draft { color: #6b7a99; background: rgba(107,122,153,0.12); }
.clm__status--investigation { color: #9a6a00; background: rgba(214,153,0,0.14); }
.clm__status--settlement { color: var(--royal); background: rgba(39,71,214,0.12); }
.clm__status--closed { color: #44506b; background: rgba(68,80,107,0.12); }

/* Resolution status ("closed as") */
.clm__res {
    display: inline-flex; align-items: center;
    margin-left: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    border: 1.5px solid currentColor;
    font-size: 0.68rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.02em;
    color: var(--muted);
}
.clm__res--released { color: #1f8a4c; }
.clm__res--repaired { color: #0f7f86; }
.clm__res--chargeback { color: #b35a00; }
.clm__res--denied { color: #b3123b; }
.clm__res--canceled { color: #6b7a99; }

/* Claim detail */
.clm__sec { font-size: 1.05rem; font-weight: 800; color: var(--navy); margin: 0 0 12px; }
.clm__sub { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin: 14px 0 4px; }
.clm__text { margin: 0; color: var(--ink); white-space: pre-line; }
.clm__dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 24px;
    margin: 0;
}
.clm__dl dt { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.clm__dl dd { margin: 3px 0 0; font-weight: 600; color: var(--navy); }
.clm__meta-card { padding: 14px 18px; }

@media (max-width: 760px) {
    .clm__stats { grid-template-columns: repeat(2, 1fr); }
    .clm__conn { flex-direction: column; align-items: flex-start; }
}

/* --- Claim types: icons + colours ------------------------------------ */
.clm__stats--6 { grid-template-columns: repeat(6, 1fr); }
.clm-ico { flex: 0 0 auto; display: block; }
.clm-type {
    --clm-type: var(--muted);
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border-radius: 9px;
    color: var(--clm-type);
    background: color-mix(in srgb, var(--clm-type) 13%, transparent);
    flex: 0 0 auto;
}
.clm-type--sm { width: 22px; height: 22px; border-radius: 7px; }
.clm-type--sm .clm-ico { width: 14px; height: 14px; }
.clm-type--cargo, .clm-chip--cargo { --clm-type: #b86e00; }
.clm-type--property, .clm-chip--property { --clm-type: #1f8a4c; }
.clm-type--auto, .clm-chip--auto { --clm-type: #2747d6; }
.clm-type--workers_comp, .clm-chip--workers_comp { --clm-type: #b3123b; }
.clm-type--insurance, .clm-chip--insurance { --clm-type: #5b3cc4; }
.clm-type-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 700; color: var(--navy); }
.clm-type-label { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.clm-type-label .clm-ico { width: 15px; height: 15px; color: #5b3cc4; }
.clm-detail__title { display: flex; align-items: center; gap: 10px; }
.clm-detail__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.clm-btn-icon { display: inline-flex; align-items: center; gap: 8px; }
.clm-btn-icon .clm-ico { width: 16px; height: 16px; }

/* Type filter chips */
.clm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.clm-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--line);
    background: var(--surface);
    font-size: 0.84rem; font-weight: 700; color: var(--navy);
}
.clm-chip--link { --clm-type: var(--navy); text-decoration: none; transition: border-color .15s, background-color .15s; }
.clm-chip--link .clm-ico { width: 16px; height: 16px; color: var(--clm-type); }
.clm-chip--link:hover { border-color: var(--clm-type); }
.clm-chip--link.is-active {
    border-color: var(--clm-type);
    background: color-mix(in srgb, var(--clm-type) 12%, #fff);
    color: var(--clm-type);
}

/* Filters panel */
.clm-filters { padding: 0; margin: 0 0 16px; }
.clm-filters__summary {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 800; color: var(--navy);
    list-style: none;
}
.clm-filters__summary::-webkit-details-marker { display: none; }
.clm-filters__summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.clm-filters[open] .clm-filters__summary::after { transform: rotate(180deg); }
.clm-filters__count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--royal); color: #fff; font-size: 0.72rem;
}
.clm-filters__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 4px 16px;
    padding: 0 18px;
}
.clm-filters .field { margin-bottom: 12px; }
.clm-filters .field > span:first-child {
    display: block; margin-bottom: 6px;
    font-size: 0.78rem; font-weight: 700; color: var(--navy);
}
.clm-filters__actions { display: flex; justify-content: flex-end; padding: 0 18px 16px; }
.clm-filters__actions .btn { width: auto; padding-left: 26px; padding-right: 26px; }

/* Incident-date range slider (two thumbs on one track) */
.clm-range { grid-column: span 2; }
.clm-range__labels { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.clm-range__track { position: relative; height: 34px; }
.clm-range__track::before {
    content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 4px;
    border-radius: 4px; background: var(--line);
}
.clm-range__fill { position: absolute; top: 15px; height: 4px; border-radius: 4px; background: var(--royal); }
.field .clm-range__track input[type="range"] {
    position: absolute; left: 0; top: 7px;
    width: 100%; height: 20px;
    margin: 0; padding: 0;
    border: 0; background: none; box-shadow: none;
    pointer-events: none;
    -webkit-appearance: none; appearance: none;
}
.clm-range__track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 3px solid var(--royal);
    box-shadow: var(--shadow-sm); cursor: pointer; pointer-events: auto;
}
.clm-range__track input[type="range"]::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 3px solid var(--royal);
    cursor: pointer; pointer-events: auto;
}
.clm-range__track input[type="range"]::-moz-range-track { background: none; }

/* Claims table: actions at the end of each row */
.clm__table-wrap { overflow-x: auto; }
.clm__table th, .clm__table td { padding-left: 8px; padding-right: 8px; }
.clm__table td:nth-child(5) { white-space: nowrap; }
.clm__type-col { width: 1%; white-space: nowrap; }
.clm__table .clm__type-col { padding-right: 4px; }
.clm__type-col .clm-type-cell { gap: 4px; }
.clm__type-col .clm-type:not(.clm-type--sm) { width: 28px; height: 28px; border-radius: 8px; }
.clm__id-link {
    display: inline-block;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--navy);
    text-decoration: none;
}
.clm__id-link:hover { color: var(--royal); text-decoration: underline; }
.clm__actions-col { width: 1%; white-space: nowrap; text-align: right; }
.clm-row-actions { display: inline-flex; gap: 6px; }
.clm-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--navy);
    transition: border-color .15s, background-color .15s, color .15s;
}
.clm-icon-btn .clm-ico { width: 17px; height: 17px; }
.clm-icon-btn:hover { border-color: var(--royal); color: var(--royal); background: #f5f7ff; }
.clm-icon-btn--edit:hover { border-color: var(--pink); color: var(--pink-text); background: #fff5f7; }
.clm-icon-btn--escalate:hover,
.clm-icon-btn--ins { color: #5b3cc4; }
.clm-icon-btn--escalate:hover,
.clm-icon-btn--ins:hover { border-color: #5b3cc4; background: #f6f3ff; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Claim form ---------------------------------------------------------- */
.clm-form [hidden] { display: none !important; }
.clm-form__card { max-width: 820px; }
.clm-form__title { font-size: 1.02rem; font-weight: 800; color: var(--navy); margin: 0 0 14px; }
.clm-form__title--section { margin-top: 6px; padding-top: 14px; border-top: 1.5px solid var(--line); }
.clm-form__hint { margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); }
.clm-form__hint--icon { display: flex; align-items: center; gap: 6px; }
.clm-form__hint--icon .clm-ico { color: #5b3cc4; }
.clm-escalate__note { max-width: 820px; margin: 8px 0 0; }
.clm-form .field label > span[data-types] { display: inline; }

.clm-type-picker { display: flex; align-items: center; gap: 12px; }
.clm-type-picker select { flex: 1 1 auto; font-size: 1rem; }
.clm-type-badge {
    --clm-type: var(--muted);
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; flex: 0 0 48px;
    border-radius: 14px;
    color: var(--clm-type);
    background: color-mix(in srgb, var(--clm-type) 13%, transparent);
    font-weight: 900; font-size: 1.2rem;
}
.clm-type-badge .clm-ico { width: 26px; height: 26px; }
.clm-type-badge__icon { display: none; }
.clm-type-badge[data-type=""] .clm-type-badge__icon--none,
.clm-type-badge[data-type="cargo"] .clm-type-badge__icon--cargo,
.clm-type-badge[data-type="property"] .clm-type-badge__icon--property,
.clm-type-badge[data-type="auto"] .clm-type-badge__icon--auto,
.clm-type-badge[data-type="workers_comp"] .clm-type-badge__icon--workers_comp { display: inline-flex; }
.clm-type-badge[data-type="cargo"] { --clm-type: #b86e00; }
.clm-type-badge[data-type="property"] { --clm-type: #1f8a4c; }
.clm-type-badge[data-type="auto"] { --clm-type: #2747d6; }
.clm-type-badge[data-type="workers_comp"] { --clm-type: #b3123b; }

.clm-truck { margin-top: 12px; padding: 14px; border-radius: var(--radius-sm); background: var(--bg); }

/* Employee roster checklist */
.clm-emp { border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.field .clm-emp__search { border: 0; border-bottom: 2px solid var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.clm-emp__list { max-height: 220px; overflow-y: auto; padding: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 8px; }
.field label.clm-emp__item {
    display: flex; align-items: center; gap: 10px;
    margin: 0; padding: 8px 10px;
    border-radius: 10px;
    font-weight: 600; cursor: pointer;
}
.clm-emp__item:hover { background: #fff; }
.clm-emp__item small { color: var(--muted); font-weight: 600; }
.field .clm-emp__item input,
.field .clm-pics__remove input { width: 18px; height: 18px; padding: 0; margin: 0; flex: 0 0 auto; accent-color: var(--royal); }

/* Pictures */
.clm-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.clm-pics__item {
    display: flex; flex-direction: column; gap: 6px;
    padding: 6px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--line); background: var(--surface);
}
.clm-pics__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.clm-pics__remove { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; color: var(--pink-text); }

/* Insurance claim card on the detail page */
.clm-ins-card { border-left: 4px solid #5b3cc4; }
.clm-ins-card .clm-ico { color: #5b3cc4; }
.clm-ins-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clm-ins-card__head .clm-form__title { margin-bottom: 4px; }
.clm-ins-card__hint { margin: 0 0 14px; }
.clm-ins-card__hint strong { color: #5b3cc4; }

/* Escalate to insurance: purple action with the insurance icon */
.clm-form__actions { flex-wrap: wrap; max-width: 820px; }
.btn.clm-escalate-btn {
    width: auto;
    background: #5b3cc4;
    color: #fff;
    box-shadow: 0 5px 0 0 #3b2585;
}
.btn.clm-escalate-btn:hover { box-shadow: 0 7px 0 0 #3b2585; }
.btn.clm-escalate-btn:active { box-shadow: 0 2px 0 0 #3b2585; }
.btn.clm-escalate-btn .clm-ico { width: 18px; height: 18px; color: #fff; }
.clm-esc-link {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 12px;
    border-radius: 10px;
    border: 1.5px solid #5b3cc4;
    background: #f6f3ff;
    color: #5b3cc4;
    font-size: 0.8rem; font-weight: 800;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.clm-esc-link .clm-ico { width: 16px; height: 16px; }
.clm-esc-link:hover { background: #5b3cc4; color: #fff; }

/* Claims table: shrink to fit narrower screens */
@media (max-width: 1000px) {
    .clm__table .clm-esc-link { width: 34px; padding: 0; justify-content: center; }
    .clm__table .clm-esc-link span { display: none; }
}
@media (max-width: 900px) {
    .clm__table-wrap { overflow-x: visible; }
    .clm__table thead { display: none; }
    .clm__table, .clm__table tbody { display: block; }
    .clm__table tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 4px 10px;
        padding: 12px 2px;
        border-bottom: 1px solid rgba(11,30,63,0.08);
    }
    .clm__table tr:last-child { border-bottom: none; }
    .clm__table td { display: block; padding: 0; border: none; min-width: 0; }
    .clm__table td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
    .clm__table .clm-type-cell { flex-direction: column; }
    .clm__table td:nth-child(2) { grid-column: 2; grid-row: 1; }
    .clm__table td:nth-child(8) { grid-column: 3; grid-row: 1; }
    .clm__table td:nth-child(3) { grid-column: 2; grid-row: 2; font-weight: 700; color: var(--navy); }
    .clm__table td:nth-child(7) { grid-column: 3; grid-row: 2; font-weight: 800; color: var(--navy); }
    .clm__table td:nth-child(4) { grid-column: 2; grid-row: 3; font-size: 0.82rem; color: var(--muted); }
    .clm__table td:nth-child(5) { grid-column: 3; grid-row: 3; text-align: right; font-size: 0.82rem; color: var(--muted); }
    .clm__table td:nth-child(6) { grid-column: 2 / 4; grid-row: 4; }
    .clm__id-link { max-width: 100%; font-size: 0.92rem; }
}

@media (max-width: 760px) {
    .clm__stats--6 { grid-template-columns: repeat(2, 1fr); }
    .clm-range { grid-column: auto; }
}

/* ===================================================================
   ACCESSIBILITY — visible keyboard focus + skip link
   =================================================================== */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 3px solid var(--royal);
    outline-offset: 2px;
}
.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--navy);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}
.skip-link:focus { top: 12px; }
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ===================================================================
   SITE FOOTER — business details + legal links
   =================================================================== */
.site-footer {
    padding: 22px 24px 28px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
}
.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}
.site-footer a { color: var(--navy); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.site-footer__biz { margin: 0; }

/* ===================================================================
   COOKIE NOTICE — essential cookies only, informational
   =================================================================== */
.cookie-notice {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 900;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    background: var(--navy);
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; flex: 1; }
.cookie-notice a { color: #fff; font-weight: 800; text-decoration: underline; }
.cookie-notice button {
    flex: none;
    padding: 9px 18px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: var(--navy);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
@media (max-width: 560px) { .cookie-notice { flex-direction: column; align-items: stretch; } }

/* ===================================================================
   LEGAL PAGES + TERMS ACCEPTANCE
   =================================================================== */
.legal { max-width: 860px; margin: 0 auto; padding: 28px 20px 10px; }
.legal__card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 34px 38px;
    color: var(--ink);
    line-height: 1.65;
}
.legal__card h1 { font-size: 1.8rem; font-weight: 900; color: var(--navy); margin-bottom: 4px; }
.legal__card h2 { font-size: 1.1rem; font-weight: 800; color: var(--navy); margin: 26px 0 8px; }
.legal__card p, .legal__card li { margin-bottom: 10px; }
.legal__card ul { padding-left: 22px; margin-bottom: 10px; }
.legal__card a { color: var(--royal); font-weight: 700; }
.legal__meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 18px; }
.legal__note {
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(39,71,214,0.07);
    color: var(--navy);
    font-size: 0.88rem;
    margin-bottom: 18px;
}
.legal__nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 16px; font-size: 0.88rem; }
.legal__nav a { color: var(--navy); font-weight: 700; }
.legal__nav a[aria-current="page"] { color: var(--royal); text-decoration: underline; }
.legal__table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 0.88rem; }
.legal__table th, .legal__table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal__summary { padding-left: 22px; }
.legal__summary li { margin-bottom: 8px; }
.legal__scroll {
    max-height: 55vh;
    overflow-y: auto;
    padding: 4px 22px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    margin: 14px 0 10px;
}
.legal__scroll:focus-visible { outline: 3px solid var(--royal); outline-offset: 2px; }
.legal__end { text-align: center; color: var(--muted); font-weight: 700; margin: 18px 0 6px; }
.legal__scroll-status { font-size: 0.88rem; font-weight: 700; color: var(--pink-text); margin: 0 0 6px; }
.legal__scroll-status--done { color: #17733f; }
.legal__checks:disabled { opacity: 0.55; }
.legal__actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.legal__checks { display: grid; gap: 12px; margin: 18px 0; border: 0; padding: 0; min-width: 0; }
.legal__checks label { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; color: var(--navy); cursor: pointer; }
.legal__checks input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--royal); }
.legal__actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.legal__actions .btn { width: auto; }
.ppl__danger { border: 1px solid rgba(214,51,85,0.35); }
.ppl__danger .rate-cards__title { color: var(--pink-text); }
.btn--danger { background: var(--pink-text); }
.ppl__confirm { display: flex; align-items: flex-start; margin: 14px 0 4px; line-height: 1.45; }
.ppl__confirm input { margin-top: 3px; flex: none; }

/* ===================================================================
   SIDEBAR — left navigation rail
   =================================================================== */
:root { --sb-w: 256px; }
html.sb-collapsed { --sb-w: 78px; }
body:has(.sidebar) { padding-left: var(--sb-w); }
html.sb-ready body:has(.sidebar) { transition: padding-left 0.3s ease; }

.sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: var(--sb-w);
    z-index: 200;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 0 100%, rgba(214,51,85,0.16), rgba(214,51,85,0) 55%),
        linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%);
    color: rgba(255,255,255,0.82);
    box-shadow: 3px 0 0 0 var(--pink), 6px 0 28px rgba(8,23,48,0.22);
    overflow: hidden;
}
html.sb-ready .sidebar { transition: width 0.3s ease, transform 0.3s ease; }

.sidebar__head {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 64px;
    padding: 0 16px 0 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex: none;
}
.sidebar__fold {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    margin-left: -4px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    flex: none;
}
.sidebar__fold:hover { background: rgba(255,255,255,0.07); }
.sidebar__word {
    color: #fff;
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: 0.16em;
    text-decoration: none;
    white-space: nowrap;
}
.sidebar__close {
    display: none;
    margin-left: auto;
    width: 38px; height: 38px;
    border: 0; border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.sidebar__close svg { width: 20px; height: 20px; }

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 12px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.sidebar__section {
    margin: 20px 10px 8px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.58);
    white-space: nowrap;
}
.sidebar__empty { margin: 4px 10px; font-size: 0.82rem; color: rgba(255,255,255,0.62); }
.sidebar__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 0;
    padding: 7px 10px;
    border-radius: 12px;
    color: rgba(255,255,255,0.82);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.sidebar__link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar__link:focus-visible { outline: 3px solid #fff; outline-offset: -1px; }
.sidebar__icon {
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    flex: none;
    transition: background 0.2s, transform 0.2s;
}
.sidebar__icon svg { width: 18px; height: 18px; }
.sidebar__link:hover .sidebar__icon { transform: translateX(1px); }
.sidebar__link.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(39,71,214,0.55), rgba(39,71,214,0.12));
}
.sidebar__link.is-active::before {
    content: "";
    position: absolute;
    left: -12px; top: 9px; bottom: 9px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--pink);
}
.sidebar__link.is-active .sidebar__icon {
    background: linear-gradient(135deg, var(--royal) 0%, var(--pink) 100%);
    box-shadow: 0 4px 12px rgba(214,51,85,0.35);
}
.sidebar__link--soon { color: rgba(255,255,255,0.6); cursor: default; }
.sidebar__link--soon:hover { background: transparent; color: rgba(255,255,255,0.6); }
.sidebar__link--soon .sidebar__icon { background: rgba(255,255,255,0.03); }
.sidebar__text { overflow: hidden; text-overflow: ellipsis; transition: opacity 0.2s; }

/* Folded rail: icons only */
html.sb-collapsed .sidebar__word,
html.sb-collapsed .sidebar__text,
html.sb-collapsed .sidebar__empty { opacity: 0; pointer-events: none; width: 0; }
html.sb-collapsed .sidebar__head { padding: 0 18px; }
html.sb-collapsed .sidebar__section {
    height: 1px;
    margin: 14px 10px;
    overflow: hidden;
    color: transparent;
    background: rgba(255,255,255,0.12);
}
html.sb-collapsed .sidebar__link { justify-content: center; gap: 0; padding: 7px 0; }

/* Top bar adjustments when the sidebar is present */
.topbar__menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 0; border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
}
.topbar__menu svg { width: 22px; height: 22px; }
body:has(.sidebar) .topbar__brand { display: none; }
body:has(.sidebar) .cookie-notice { left: calc(var(--sb-w) + 16px); }

.sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(8,23,48,0.5);
    backdrop-filter: blur(2px);
}
.sidebar-scrim[hidden] { display: none; }

@media (max-width: 900px) {
    body:has(.sidebar) { padding-left: 0; }
    body:has(.sidebar) .cookie-notice { left: 16px; }
    .sidebar { width: 280px; transform: translateX(-105%); }
    html.sb-open .sidebar { transform: none; }
    .sidebar__close { display: inline-grid; place-items: center; }
    .topbar__menu { display: inline-flex; }
    body:has(.sidebar) .topbar__brand { display: inline-flex; }
}
@media (max-width: 640px) {
    .menu__trigger--avatar { display: inline-flex; }
}

/* ===================================================================
   NEURO MARK - a neuron whose axon fires to the right into a network
   (markup: core/templatetags/nadx_ui.py + partials/_neuro.html)
   Hairline circuit traces (royal -> pink), chip-pad nodes and a soma with
   a slowly turning orbit. One calm 12s cycle: the soma swells, a soft
   signal glides across one layer every 1.68s (14%), and each pad warms as
   it arrives. Every keyframe eases in and out and loops seamlessly, so
   nothing ever jumps.
   =================================================================== */
.neuro { display: block; overflow: visible; flex: none; }
.neuro--mark { width: 38px; height: 38px; }
.topbar__mark { width: 30px; height: 30px; }
.neuro__link, .neuro__stub, .neuro__pulse { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.neuro__link {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    opacity: 0.62;
    transition:
        stroke-dashoffset 0.7s cubic-bezier(0.45, 0, 0.25, 1) calc(var(--d) * 1.6 + 0.1s),
        opacity 0.5s ease calc(var(--d) * 1.6 + 0.1s);
}
.neuro__stub { opacity: 0.55; }
.neuro__tip { fill: #6f86ec; opacity: 0.8; }

.neuro__node {
    transform-box: fill-box;
    transform-origin: center;
    transition:
        transform 0.7s cubic-bezier(0.45, 0, 0.25, 1) calc(var(--d) * 1.6 + 0.15s),
        opacity 0.5s ease calc(var(--d) * 1.6 + 0.15s);
}
.neuro__pad { fill: #0a1834; stroke: #6f86ec; stroke-opacity: 0.85; }
.neuro__core {
    fill: #f27a93;
    filter: drop-shadow(0 0 1.2px rgba(242,122,147,0.85));
    animation: neuro-warm 12s ease-in-out var(--w) infinite;
}

.neuro__soma {
    transform-box: fill-box;
    transform-origin: center;
    filter: drop-shadow(0 0 2.5px rgba(214,51,85,0.85));
    animation: neuro-breath 12s ease-in-out infinite;
}
.neuro__orbit {
    fill: none;
    stroke: #9fb0ff;
    stroke-opacity: 0.55;
    transform-box: fill-box;
    transform-origin: center;
    animation: neuro-orbit 48s linear infinite;
}
.neuro__orbit { stroke-dasharray: 3 2.4; }
.neuro--hero .neuro__orbit { stroke-dasharray: 6 5; }
.neuro__halo {
    fill: none;
    stroke: #f27a93;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: neuro-ripple 12s ease-out infinite;
}
.neuro__pulse {
    stroke: #ffd9e2;
    stroke-dasharray: 0.12 0.88;
    stroke-dashoffset: 1;
    opacity: 0;
    filter: drop-shadow(0 0 2px rgba(242,122,147,0.9)) drop-shadow(0 0 4px rgba(111,134,236,0.6));
    animation: neuro-signal 12s linear var(--w) infinite;
}

/* Soma swells and settles in one long breath; peak = the moment it fires. */
@keyframes neuro-breath {
    0%, 100% { transform: scale(1.08); filter: drop-shadow(0 0 5px rgba(242,122,147,0.95)); }
    50%      { transform: scale(0.96); filter: drop-shadow(0 0 2px rgba(214,51,85,0.6)); }
}
@keyframes neuro-orbit { to { transform: rotate(360deg); } }
@keyframes neuro-ripple {
    0%   { transform: scale(1); opacity: 0; }
    4%   { transform: scale(1.15); opacity: 0.4; }
    40%  { transform: scale(2.6); opacity: 0; }
    100% { transform: scale(2.6); opacity: 0; }
}
/* Constant-speed glide (linear) with soft fade in/out at the ends. */
@keyframes neuro-signal {
    0%   { stroke-dashoffset: 1; opacity: 0; }
    3%   { opacity: 0.9; }
    12%  { opacity: 0.9; }
    14%  { stroke-dashoffset: 0; opacity: 0; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}
/* Pad core warms gradually as the signal arrives, then cools slowly. */
@keyframes neuro-warm {
    0%, 100% { fill: #e5677f; filter: drop-shadow(0 0 1px rgba(242,122,147,0.6)); }
    5%       { fill: #ffd3dd; filter: drop-shadow(0 0 4px rgba(255,211,221,0.9)) drop-shadow(0 0 7px rgba(242,122,147,0.6)); }
    30%      { fill: #e5677f; filter: drop-shadow(0 0 1px rgba(242,122,147,0.6)); }
}

/* Folded sidebar: the network eases back right-to-left into the soma, then
   the neuron glides to the centre of the rail. */
html:not(.sb-ready) .sidebar .neuro,
html:not(.sb-ready) .sidebar .neuro * { transition: none !important; }
.sidebar .neuro__web { transition: transform 0.6s cubic-bezier(0.45, 0, 0.25, 1), filter 0.6s ease; }
html.sb-collapsed .sidebar .neuro__web { transform: translateX(var(--shift)); transition-delay: 0.35s, 0s; }
html.sb-collapsed .sidebar .neuro__link { stroke-dashoffset: 1; opacity: 0; transition-delay: calc(var(--dr) * 1.6); }
html.sb-collapsed .sidebar .neuro__node {
    transform: translate(var(--tx), var(--ty)) scale(0.3);
    opacity: 0;
    transition-delay: calc(var(--dr) * 1.6);
}
html.sb-collapsed .sidebar .neuro__pulse { opacity: 0; animation-play-state: paused; }
.sidebar__fold:hover .neuro__web { filter: brightness(1.2) drop-shadow(0 0 2px rgba(159,176,255,0.45)); }

/* Hero: on load the axon unfurls to the right and the network draws itself
   in, layer by layer, before the calm cycle begins. */
.neuro--hero { width: 100%; height: auto; }
.neuro--intro .neuro__soma, .neuro--intro .neuro__orbit {
    opacity: 0;
    animation-name: neuro-fade, neuro-breath;
    animation-duration: 1.4s, 12s;
    animation-timing-function: ease-out, ease-in-out;
    animation-delay: 0s, 3.6s;
    animation-iteration-count: 1, infinite;
    animation-fill-mode: forwards, none;
}
.neuro--intro .neuro__orbit { animation-name: neuro-fade, neuro-orbit; animation-duration: 1.4s, 48s; animation-timing-function: ease-out, linear; animation-delay: 0.3s, 0s; }
.neuro--intro .neuro__halo { animation-delay: 3.6s; }
.neuro--intro .neuro__stub, .neuro--intro .neuro__tip { opacity: 0; animation: neuro-fade 1.2s ease-out 0.5s forwards; }
.neuro--intro .neuro__stub { --to: 0.55; }
.neuro--intro .neuro__link {
    stroke-dashoffset: 1;
    opacity: 0.62;
    transition: none;
    animation: neuro-draw 1.6s cubic-bezier(0.45, 0, 0.25, 1) calc(var(--d) * 2.6 + 0.7s) forwards;
}
.neuro--intro .neuro__node {
    opacity: 0;
    transition: none;
    animation: neuro-fade 1.2s ease-out calc(var(--d) * 2.6 + 1.2s) forwards;
}
.neuro--intro .neuro__core { animation-delay: calc(var(--w) + 3.6s); }
.neuro--intro .neuro__pulse { animation-delay: calc(var(--w) + 3.6s); }
@keyframes neuro-fade { from { opacity: 0; } to { opacity: var(--to, 1); } }
@keyframes neuro-draw { to { stroke-dashoffset: 0; } }

.sidebar--flash { animation: sidebar-flash 1.8s ease-in-out; }
@keyframes sidebar-flash {
    40% { box-shadow: 3px 0 0 0 var(--pink), 0 0 0 3px rgba(242,122,147,0.45), 12px 0 48px rgba(214,51,85,0.45); }
}

/* ===================================================================
   LANDING - full-bleed, the dashboard after sign-in
   =================================================================== */
body.is-landing {
    background-color: #061226;
    background-image:
        radial-gradient(ellipse 70% 60% at 22% 38%, rgba(39,71,214,0.32), transparent 62%),
        radial-gradient(ellipse 45% 40% at 82% 72%, rgba(214,51,85,0.16), transparent 62%),
        linear-gradient(180deg, #0b1e3f 0%, #071530 55%, #050f22 100%);
    background-size: auto;
    background-attachment: fixed;
    color: #fff;
}
body.is-landing .topbar { background: transparent; box-shadow: 0 1px 0 rgba(255,255,255,0.06); }
body.is-landing .site-footer { color: rgba(255,255,255,0.6); }
body.is-landing .site-footer a { color: rgba(255,255,255,0.88); }
body.is-landing .cookie-notice { border: 1px solid rgba(255,255,255,0.14); }

.page--landing { max-width: none; padding: 0; }
.landing {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px - 110px);
    min-height: calc(100dvh - 64px - 110px);
    padding: 12px 32px 36px;
    color: #fff;
}
.landing__glow {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 9% 46%, rgba(214,51,85,0.32), transparent 22%),
        radial-gradient(ellipse 55% 45% at 50% 45%, rgba(79,107,240,0.18), transparent 70%);
    animation: landing-breathe 16s ease-in-out infinite;
}
.landing__grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(159,176,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(159,176,255,0.06) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 60% 55% at 45% 45%, #000 20%, transparent 80%);
    mask-image: radial-gradient(ellipse 60% 55% at 45% 45%, #000 20%, transparent 80%);
    animation: landing-drift 90s linear infinite;
}
@keyframes landing-breathe { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes landing-drift { to { background-position: 44px 0, 44px 0; } }

.landing__net {
    width: min(100%, 1080px, 128vh);
    margin: 0 auto -4px;
    -webkit-mask-image: linear-gradient(90deg, #000 93%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 93%, transparent 100%);
}
.landing__copy { position: relative; text-align: center; }
.landing__copy > * { opacity: 0; animation: landing-rise 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }
.landing__hello { animation-delay: 1.5s !important; }
.landing__tag   { animation-delay: 6.8s !important; }
.landing__hint  { animation-delay: 3.2s !important; }
@keyframes landing-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.landing__hello {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.66);
}
.landing__title {
    margin: 10px 0 6px;
    padding-left: 0.16em;
    font-size: clamp(1.15rem, 3.2vw, 2.5rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fff;
    filter: drop-shadow(0 4px 24px rgba(63,95,240,0.5));
    animation: landing-rise 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) 1.65s forwards;
}
/* Colour lives on each letter (gradient text on the heading would keep
   painting the letters that fold away). */
.lt__r { color: rgba(255,255,255,0.86); }
.lt__k {
    color: transparent;
    background: linear-gradient(180deg, #ffffff 0%, #e4e9ff 55%, #f6a3b5 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
/* Once folded, NADX glows softly in time with the firing cycle. */
.is-folded .lt__k { animation: lt-glow 12s ease-in-out infinite; }
@keyframes lt-glow {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(242,122,147,0)); }
    20%      { filter: drop-shadow(0 0 14px rgba(242,122,147,0.45)); }
}
.landing__tag { font-size: clamp(1rem, 2.3vw, 1.3rem); font-weight: 600; color: rgba(255,255,255,0.86); }

.landing__hint {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding: 9px 18px 9px 10px;
    border: 1px solid rgba(159,176,255,0.3);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.landing__hint:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(242,122,147,0.7);
    box-shadow: 0 0 0 4px rgba(242,122,147,0.12), 0 0 24px rgba(242,122,147,0.25);
}
.landing__hint:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.landing__hint-arrow {
    display: grid;
    place-items: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--royal), var(--pink));
    box-shadow: 0 0 14px rgba(214,51,85,0.55);
    animation: hint-nudge 8s ease-in-out infinite;
}
.landing__hint-arrow svg { width: 16px; height: 16px; }
@keyframes hint-nudge { 0%, 50%, 100% { transform: translateX(0); } 75% { transform: translateX(-5px); } }
.landing__hint-mobile { display: none; }

@media (max-width: 900px) {
    .landing__hint-desk { display: none; }
    .landing__hint-mobile { display: inline; }
}
@media (max-width: 640px) {
    .landing {
        min-height: calc(100vh - 64px - 170px);
        min-height: calc(100dvh - 64px - 170px);
        padding: 8px 12px 28px;
    }
    .landing__net { width: 112%; margin-left: -6%; }
    .landing__title { letter-spacing: 0.1em; padding-left: 0.1em; }
    .is-folding .lt__k, .is-folded .lt__k { font-size: 3em; }
    .landing__hello { font-size: 0.7rem; letter-spacing: 0.14em; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar, body:has(.sidebar), .neuro, .neuro * { transition: none !important; }
    .neuro *, .neuro__web, .landing__glow, .landing__grid, .landing__hint-arrow, .landing__title { animation: none !important; }
    .neuro--intro .neuro__link { stroke-dashoffset: 0; }
    .neuro--intro .neuro__node, .neuro--intro .neuro__stub, .neuro--intro .neuro__tip, .neuro--intro .neuro__soma, .neuro--intro .neuro__orbit { opacity: 1; transform: none; }
    .landing__copy > * { opacity: 1; animation: none !important; }
}

/* ===================================================================
   PHONE POLISH (keep last so it wins over module-specific grids)
   =================================================================== */
.clm-filters__grid { grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); }
@media (max-width: 760px) {
    .clm__stats, .clm__stats--6 { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
}
@media (max-width: 640px) {
    .page { padding: 24px 14px 40px; }
    .topbar { gap: 8px; }
    .topbar__left { gap: 6px; min-width: 0; }
    .topbar__right { gap: 8px; }
    /* Phones: the neuron mark alone is the brand; leaves room for the avatar. */
    .topbar__brand .brand__word { display: none; }
    .landing__hint { max-width: 100%; font-size: 0.85rem; text-align: left; }
    .site-footer { padding: 18px 14px 24px; }
    .cookie-notice { left: 10px; right: 10px; bottom: 10px; padding: 14px 16px; }
}
@media (max-width: 380px) {
    .topbar { padding: 0 10px; }
    .topbar__back, .topbar__menu { width: 34px; height: 34px; }
    .clm-filters__grid { padding: 0 10px; }
}
@media (max-width: 640px) {
    .ppl__filters { grid-template-columns: 1fr; }
    .ppl__filters > * { min-width: 0; }
}
.ra__card--scroll { overflow-x: auto; }
@media (max-width: 640px) {
    .legal { padding: 16px 10px 6px; }
    .legal__card { padding: 24px 18px; }
    .legal__table { display: block; overflow-x: auto; }
}

/* Title: "The New Age Domain Experience" folds into "NADX" */
.lt { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: baseline; row-gap: 0.1em; }
.lt__w {
    display: inline-flex;
    align-items: baseline;
    margin: 0 0.3em;
    transition: margin 2s cubic-bezier(0.45, 0, 0.25, 1);
}
.lt__k, .lt__r { display: inline-block; }
.lt__k { font-size: 1em; transition: font-size 2s cubic-bezier(0.45, 0, 0.25, 1); }
.lt__r {
    overflow: hidden;
    white-space: pre;
    vertical-align: bottom;
    transition: max-width 2s cubic-bezier(0.45, 0, 0.25, 1), opacity 1.4s ease;
}
.is-folding .lt__r, .is-folded .lt__r { max-width: 0 !important; opacity: 0; }
.is-folding .lt__w, .is-folded .lt__w { margin: 0 0.06em; }
.is-folding .lt__w--gone, .is-folded .lt__w--gone { margin: 0; }
.is-folding .lt__k, .is-folded .lt__k { font-size: 2.5em; line-height: 1; }
.is-folded .lt { flex-wrap: nowrap; }

/* Stacked "New Age Domain / Experience" wordmark (sidebar, top bar, legal) */
.wordmark { display: inline-flex; flex-direction: column; gap: 3px; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.wordmark__line { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.14em; color: rgba(255,255,255,0.7); }
.wordmark__line--sub { font-size: 0.6rem; letter-spacing: 0.46em; color: rgba(255,255,255,0.55); }
.wordmark b { font-weight: 900; color: #fff; }
.wordmark__line--sub b { color: #f27a93; }
.sidebar__word { font-size: inherit; letter-spacing: normal; }
@media (max-width: 640px) { .topbar__brand .wordmark { display: none; } }
@media (max-width: 640px) { .is-folding .lt__k, .is-folded .lt__k { font-size: 3em; } }

/* ===================================================================
   SIGN IN - full-bleed navy, neural network hero, frosted-glass card
   (reuses the landing background, glow and grid)
   =================================================================== */
body.is-auth { height: auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.is-auth .site-footer { padding-top: 8px; }
.signin {
    position: relative;
    isolation: isolate;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}
.signin__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px clamp(18px, 4vw, 48px) 0;
}
.signin__brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.signin__brand .wordmark__line { font-size: 0.8rem; }
.signin__brand .wordmark__line--sub { font-size: 0.64rem; }

.signin__main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 420px);
    align-items: center;
    gap: clamp(24px, 4vw, 64px);
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px clamp(18px, 4vw, 48px) 40px;
}

.signin__hero { position: relative; }
.signin__net {
    margin-left: -2%;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
}
.signin__eyebrow {
    margin: 4px 0 0 7%;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(159,176,255,0.75);
    opacity: 0;
    animation: landing-rise 1.4s cubic-bezier(0.25, 0.1, 0.25, 1) 2.2s forwards;
}
.signin__motto {
    margin: 10px 0 0 7%;
    font-size: clamp(1.7rem, 3.4vw, 2.9rem);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: #fff;
    opacity: 0;
    animation: landing-rise 1.4s cubic-bezier(0.25, 0.1, 0.25, 1) 2.6s forwards;
}
.signin__motto span {
    color: transparent;
    background: linear-gradient(90deg, #9fb0ff 0%, #f27a93 70%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Frosted-glass card */
.signin__card {
    position: relative;
    padding: 38px 34px 28px;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
    border: 1px solid rgba(159,176,255,0.18);
    box-shadow: 0 30px 80px rgba(2,8,23,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    color: #fff;
    opacity: 0;
    animation: landing-rise 1.4s cubic-bezier(0.25, 0.1, 0.25, 1) 0.6s forwards;
}
/* A slow light travelling around the card's border. */
.signin__card-edge {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--edge, 0deg), transparent 0deg, rgba(242,122,147,0.9) 40deg, rgba(111,134,236,0.9) 90deg, transparent 140deg, transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0.55;
    pointer-events: none;
    animation: signin-edge 14s linear infinite;
}
@property --edge { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes signin-edge { to { --edge: 360deg; } }

.signin__card h1 { font-size: 1.75rem; font-weight: 900; letter-spacing: -0.01em; }
.signin__sub { margin: 6px 0 24px; font-size: 0.9rem; color: rgba(255,255,255,0.7); }

.signin__msgs { list-style: none; margin: 0 0 14px; padding: 0; }
.signin__msg {
    margin-bottom: 14px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 600;
    background: rgba(159,176,255,0.12);
    border: 1px solid rgba(159,176,255,0.25);
}
.signin__msg--error { background: rgba(214,51,85,0.16); border-color: rgba(242,122,147,0.45); color: #ffd3dd; }

.signin__form { display: grid; gap: 16px; }
.signin__field { position: relative; }
.signin__field input {
    width: 100%;
    padding: 24px 46px 10px 16px;
    border-radius: 14px;
    border: 1px solid rgba(159,176,255,0.22);
    background: rgba(6,18,38,0.55);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}
.signin__field input:focus {
    outline: none;
    border-color: rgba(242,122,147,0.75);
    background: rgba(6,18,38,0.75);
    box-shadow: 0 0 0 4px rgba(242,122,147,0.14), 0 0 24px rgba(111,134,236,0.18);
}
.signin__field label {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    pointer-events: none;
    transition: top 0.35s ease, font-size 0.35s ease, color 0.35s ease, letter-spacing 0.35s ease;
}
.signin__field input:focus + label,
.signin__field input:not(:placeholder-shown) + label {
    top: 15px;
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(159,176,255,0.95);
}
.signin__field input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 40px #0c1c3d inset;
    caret-color: #fff;
}
.signin__field input:-webkit-autofill + label { top: 15px; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; }
.signin__peek {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: color 0.3s, background 0.3s;
}
.signin__peek:hover, .signin__peek[aria-pressed="true"] { color: #fff; background: rgba(255,255,255,0.08); }
.signin__peek svg { width: 19px; height: 19px; }

.signin__submit {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    padding: 15px 20px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(100deg, #2747d6 0%, #4d5fe0 45%, #d63355 100%);
    background-size: 200% 100%;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(39,71,214,0.35);
    transition: background-position 0.8s ease, box-shadow 0.5s ease, transform 0.3s ease;
}
.signin__submit svg { width: 18px; height: 18px; transition: transform 0.5s ease; }
.signin__submit:hover { background-position: 100% 0; box-shadow: 0 12px 36px rgba(214,51,85,0.35); }
.signin__submit:hover svg { transform: translateX(4px); }
.signin__submit:active { transform: translateY(1px); }
.signin__submit:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.signin__secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    font-size: 0.74rem;
    color: rgba(255,255,255,0.55);
}
.signin__secure svg { width: 14px; height: 14px; }

/* Language switch on the dark background */
.signin__lang .lang { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); }

/* Tablet: stack the network above the card */
@media (max-width: 960px) {
    .signin__main { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; justify-items: center; padding-top: 4px; gap: 0; }
    .signin__hero { width: min(100%, 640px); text-align: center; }
    .signin__net { margin: 0; }
    .signin__eyebrow, .signin__motto { margin-left: 0; }
    .signin__motto { font-size: clamp(1.4rem, 4.6vw, 2rem); }
    .signin__card { width: min(100%, 420px); margin-top: 22px; }
}
/* Phone: network becomes a soft backdrop behind the card */
@media (max-width: 600px) {
    .signin__bar { padding-top: 16px; }
    .signin__brand .wordmark { display: none; }
    .signin__main { padding: 0 14px 24px; }
    .signin__hero { margin-bottom: 0; }
    .signin__net { width: 118%; margin-left: 0; opacity: 0.8; }
    .signin__motto { display: none; }
    .signin__eyebrow { margin-top: 2px; font-size: 0.6rem; letter-spacing: 0.22em; }
    .signin__card { padding: 28px 22px 22px; border-radius: 20px; margin-top: 18px; }
    .signin__secure { text-align: center; }
    .signin__card h1 { font-size: 1.5rem; }
    /* 16px stops iOS zooming into the fields */
    .signin__field input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .signin__card, .signin__eyebrow, .signin__motto { opacity: 1; animation: none; }
    .signin__card-edge { animation: none; }
}
