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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f6fa;
    color: #222;
    min-height: 100vh;
}

/* ===== Form Guard — loading spinner ===== */
@keyframes fg-spin { to { transform: rotate(360deg); } }
.fg-spinner {
    display: inline-block;
    width: .85em; height: .85em;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fg-spin .65s linear infinite;
    margin-right: .45em;
    vertical-align: middle;
}

/* ===== Nav ===== */
nav {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 55%, #222222 100%);
    color: #fff;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0,0,0,.55);
    gap: .75rem;
}

/* Logo + brand text block */
.nav-brand-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-brand-link:hover { opacity: .9; }
.nav-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);   /* white-on-dark logo */
}
.nav-logo-icon {
    height: 38px;
    width: 38px;
    object-fit: contain;
    filter: none;       /* icon has its own metallic silver + navy colors */
    border-radius: 5px;
}
.nav-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}
.nav-brand-name {
    font-size: 1.08rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .01em;
    white-space: nowrap;
}
.nav-brand-tag {
    font-size: .7rem;
    color: rgba(255,255,255,.6);
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Nav links */
nav .nav-links { display: flex; gap: .75rem; align-items: center; flex-wrap: nowrap; }
nav a { color: rgba(255,255,255,.85); text-decoration: none; font-size: .93rem; }
nav a:hover { color: #fff; }
nav .nav-user-info {
    font-size: .87rem;
    color: rgba(255,255,255,.8);
    display: flex;
    align-items: center;
    gap: .45rem;
    padding-right: .5rem;
    border-right: 1px solid rgba(255,255,255,.2);
    white-space: nowrap;
}
nav .btn-nav {
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 7px;
    padding: .4rem .9rem;
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}
nav .btn-nav:hover { background: rgba(255,255,255,.24); }
nav .btn-nav-warn  { border-color: rgba(253,224,71,.5); background: rgba(253,224,71,.12); }
nav .btn-nav-warn:hover { background: rgba(253,224,71,.22); }
nav .btn-nav-launch { border-color: rgba(134,239,172,.4); background: rgba(134,239,172,.1); }
nav .btn-nav-launch:hover { background: rgba(134,239,172,.2); }
nav .btn-nav-logout { background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.4); }
nav .btn-nav-logout:hover { background: rgba(239,68,68,.28); }

/* Hamburger — hidden on desktop */
.nav-hamburger {
    display: none;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 6px;
    color: #fff;
    font-size: 1.2rem;
    padding: .25rem .55rem;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    margin-left: auto;
}

/* ── Mobile nav ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    nav { height: auto; min-height: 72px; flex-wrap: wrap; padding: .6rem 1rem; }
    .nav-logo { height: 36px; }
    .nav-logo-icon { height: 40px; width: 40px; }
    .nav-brand-name { font-size: .9rem; }
    .nav-brand-tag  { display: none; }
    .nav-hamburger  { display: block; }
    nav .nav-links  {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: .4rem;
        padding: .5rem 0 .25rem;
        border-top: 1px solid rgba(255,255,255,.15);
    }
    nav .nav-links.nav-open { display: flex; }
    nav .btn-nav { width: 100%; text-align: left; }
    nav .nav-user-info { border-right: none; padding-right: 0; }
}

/* ===== Main container ===== */
.container {
    width: 96%;
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ===== Page heading ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: .55rem 1.2rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn-primary { background: #1a56db; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #222; }

/* ===== Public booking / SEO landing page ===== */
.public-booking-page {
    background: #f4f7fb;
    color: #172033;
}
.public-booking-header {
    min-height: 72px;
    padding: .75rem max(1.25rem, calc((100% - 1180px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #0d2340;
    box-shadow: 0 3px 18px rgba(13,35,64,.16);
}
.public-booking-brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: #fff;
    text-decoration: none;
}
.public-booking-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 6px;
}
.public-booking-brand strong,
.public-booking-brand small {
    display: block;
}
.public-booking-brand strong {
    font-size: .98rem;
    letter-spacing: .01em;
}
.public-booking-brand small {
    margin-top: .18rem;
    color: #b8c8dc;
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.public-booking-header-link {
    padding: .62rem 1rem;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 7px;
    color: #fff;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
}
.public-booking-header-link:hover { background: rgba(255,255,255,.12); }
.public-booking-page main {
    width: min(1180px, calc(100% - 2.5rem));
    margin: 0 auto;
}
.public-booking-breadcrumb {
    display: flex;
    gap: .55rem;
    padding: 1.2rem 0 .5rem;
    color: #63738a;
    font-size: .82rem;
}
.public-booking-breadcrumb a {
    color: #245aa6;
    text-decoration: none;
}
.public-booking-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    gap: clamp(2rem, 6vw, 5.5rem);
    align-items: center;
    padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(4rem, 8vw, 6.5rem);
}
.public-booking-eyebrow {
    margin-bottom: .85rem;
    color: #a66f00;
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.public-booking-hero h1 {
    max-width: 720px;
    margin-bottom: 1.25rem;
    color: #102d50;
    font-size: clamp(2.25rem, 5vw, 4.3rem);
    line-height: 1.08;
    letter-spacing: -.035em;
}
.public-booking-lede {
    max-width: 680px;
    color: #4b5d74;
    font-size: clamp(1.04rem, 1.7vw, 1.24rem);
    line-height: 1.7;
}
.public-booking-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 2rem;
}
.public-booking-button,
.public-booking-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: .8rem 1.25rem;
    border-radius: 7px;
    font-size: .94rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.public-booking-button {
    background: #c18b16;
    color: #fff;
    box-shadow: 0 5px 14px rgba(145,95,0,.2);
}
.public-booking-button:hover {
    background: #a9750e;
    box-shadow: 0 7px 18px rgba(145,95,0,.28);
    transform: translateY(-1px);
}
.public-booking-secondary-button {
    border: 1px solid #b8c5d5;
    background: #fff;
    color: #24466e;
}
.public-booking-secondary-button:hover { background: #edf3fa; }
.public-booking-response-note {
    max-width: 620px;
    margin-top: 1rem;
    color: #718096;
    font-size: .84rem;
    line-height: 1.55;
}
.public-booking-trust-card {
    padding: clamp(1.5rem, 4vw, 2.4rem);
    border: 1px solid #dce5f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(24,57,93,.1);
}
.public-booking-check {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin-bottom: 1.25rem;
    border-radius: 50%;
    background: #e9f5ed;
    color: #167445;
    font-size: 1.5rem;
    font-weight: 900;
}
.public-booking-trust-card h2,
.public-booking-section h2,
.public-booking-bottom-cta h2 {
    color: #102d50;
    line-height: 1.18;
}
.public-booking-trust-card h2 { font-size: 1.5rem; }
.public-booking-trust-card p {
    margin-top: .8rem;
    color: #607187;
    line-height: 1.6;
}
.public-booking-trust-card ul {
    display: grid;
    gap: .7rem;
    margin-top: 1.35rem;
    padding: 1.2rem 0 0 1.2rem;
    border-top: 1px solid #e7edf4;
    color: #314861;
    font-size: .9rem;
    line-height: 1.4;
}
.public-booking-section {
    padding: clamp(3.5rem, 7vw, 5.5rem) 0;
    border-top: 1px solid #dce5ef;
}
.public-booking-section > div:first-child { max-width: 680px; }
.public-booking-section h2,
.public-booking-bottom-cta h2 {
    font-size: clamp(1.8rem, 3vw, 2.65rem);
}
.public-booking-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}
.public-booking-info-card {
    padding: 1.5rem;
    border: 1px solid #dce5f0;
    border-radius: 10px;
    background: #fff;
}
.public-booking-card-number {
    color: #b17c0f;
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .1em;
}
.public-booking-info-card h3 {
    margin: 1.4rem 0 .6rem;
    color: #193b61;
    font-size: 1.1rem;
}
.public-booking-info-card p {
    color: #607187;
    font-size: .92rem;
    line-height: 1.6;
}
.public-booking-bottom-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin: 0 0 4rem;
    padding: clamp(1.75rem, 5vw, 3.25rem);
    border-radius: 14px;
    background: #102d50;
    color: #fff;
}
.public-booking-bottom-cta h2 { color: #fff; }
.public-booking-bottom-cta p:last-child {
    max-width: 660px;
    margin-top: .85rem;
    color: #c7d5e5;
    line-height: 1.6;
}
.public-booking-bottom-cta .public-booking-eyebrow { color: #e3b44a; }
.public-booking-bottom-cta .public-booking-button {
    flex-shrink: 0;
    background: #d49a1a;
}
.public-booking-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .55rem;
    padding: 1.4rem 1.25rem;
    background: #e8eef5;
    color: #53677e;
    font-size: .8rem;
    text-align: center;
}
.public-booking-footer a {
    color: #245a9f;
    text-decoration: none;
}
@media (max-width: 760px) {
    .public-booking-header { padding: .75rem 1rem; }
    .public-booking-header-link { padding: .55rem .7rem; font-size: .78rem; }
    .public-booking-page main { width: min(100% - 2rem, 1180px); }
    .public-booking-hero {
        grid-template-columns: 1fr;
        padding-top: 2.8rem;
    }
    .public-booking-card-grid { grid-template-columns: 1fr; }
    .public-booking-bottom-cta {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 2.5rem;
    }
}
@media (max-width: 440px) {
    .public-booking-brand strong { font-size: .83rem; }
    .public-booking-brand small { font-size: .58rem; }
    .public-booking-brand img { width: 36px; height: 36px; }
    .public-booking-header-link { font-size: 0; }
    .public-booking-header-link::after {
        content: "Request";
        font-size: .78rem;
    }
    .public-booking-actions a { width: 100%; }
}

/* ===== Flash messages ===== */
.flash-list { list-style: none; margin-bottom: 1rem; }
.flash-list li {
    background: #fef3cd;
    border: 1px solid #f0c040;
    border-radius: 8px;
    padding: .65rem 1rem;
    margin-bottom: .5rem;
    font-size: .9rem;
    color: #7a5c00;
}
.flash-success {
    background: #d1fae5;
    border-color: #34d399;
    color: #065f46;
}

/* ===== Login page ===== */
.login-body {
    background: linear-gradient(160deg, #0f2d5e 0%, #1a4fa0 45%, #1e5fa8 100%);
    min-height: 100vh;
}
.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    gap: 1rem;
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,.28);
}
.login-logo-wrap {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f2f5;
}
.login-logo {
    max-width: 200px;
    height: auto;
    display: inline-block;
}
.login-logo-icon {
    width: 96px;
    height: 96px;
    object-fit: contain;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.35));
}
.login-tagline {
    text-align: center;
    font-size: .82rem;
    color: #64748b;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1.75rem;
}
.login-submit-btn {
    width: 100%;
    margin-top: .5rem;
    padding: .7rem 1.2rem;
    font-size: .95rem;
}
.login-footer-copy {
    font-size: .75rem;
    color: rgba(255,255,255,.85);
    text-align: center;
    letter-spacing: .04em;
}

/* ===== Site footer ===== */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom));
    border-top: 1px solid #e2e8f0;
    margin-top: 2.5rem;
    background: #fff;
    text-align: center;
}
.footer-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    flex-wrap: nowrap;
}
.footer-logo {
    height: 36px;
    width: auto;
    max-width: 40px;
    object-fit: contain;
    opacity: .7;
}
.footer-logo-icon {
    height: 36px;
    width: 36px;
    object-fit: contain;
    opacity: .8;
    filter: none;
}
.footer-copy {
    font-size: .75rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: .02em;
    white-space: normal;
}
.footer-sep {
    font-size: .75rem;
    color: #cbd5e1;
}
.footer-tagline {
    font-size: .72rem;
    color: #64748b;
    font-style: italic;
}
.footer-version {
    font-size: .68rem;
    color: #cbd5e1;
    letter-spacing: .01em;
    pointer-events: none;
    user-select: none;
    white-space: normal;
}
.hide-mobile { display: inline; }
@media (max-width: 600px) {
    .site-footer {
        flex-direction: column;
        gap: .35rem;
        padding: 1rem .75rem calc(1rem + env(safe-area-inset-bottom));
    }
    .hide-mobile { display: none; }
    .footer-version {
        display: block;
        width: 100%;
        text-align: center;
        line-height: 1.4;
    }
}
@media (max-width: 480px) {
    .login-logo { max-width: 160px; }
}

/* ===== Forms ===== */
.form-card {
    background: #fff;
    border-radius: 14px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .35rem;
    color: #444;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .6rem .85rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: .95rem;
    color: #222;
    background: #fff;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-group input[type="file"] {
    border: 1px dashed #d1d5db;
    padding: .5rem;
    background: #fafafa;
    cursor: pointer;
}
.form-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ===== Section labels (form sections) ===== */
.section-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #1a56db;
    margin: 1.5rem 0 .75rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid #e5e7eb;
}
.section-hint {
    font-size: .82rem; color: #64748b; margin: -.4rem 0 .75rem;
}
.form-row-divider {
    text-align: center; font-size: .8rem; color: #64748b;
    margin: .25rem 0 .75rem; letter-spacing: .05em;
}
.field-opt {
    font-size: .75rem; font-weight: 400; color: #64748b; margin-left: .2rem;
}

/* ===== Table ===== */
.table-wrap {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    overflow: hidden;
}
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #888;
    font-size: .95rem;
}
table { width: 100%; border-collapse: collapse; }
thead th {
    background: #f9fafb;
    text-align: left;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #555;
    padding: .85rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}
tbody tr {
    border-bottom: 1px solid #f0f1f3;
    transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f5f8ff; }
tbody td { padding: .8rem 1rem; font-size: .9rem; vertical-align: middle; }
tbody td a { color: #1a56db; text-decoration: none; font-weight: 500; }
tbody td a:hover { text-decoration: underline; }

/* ===== Condition badges ===== */
.badge {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}
.badge-good  { background: #d1fae5; color: #065f46; }
.badge-fair  { background: #fef3cd; color: #7a5c00; }
.badge-poor  { background: #fee2e2; color: #991b1b; }

/* ===== Detail view ===== */
.detail-card {
    background: #fff;
    border-radius: 14px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
    margin-bottom: 1.5rem;
}
.detail-field label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    display: block;
    margin-bottom: .2rem;
}
.detail-field p { font-size: .95rem; color: #222; word-break: break-word; }
.detail-notes { margin-top: 1rem; }
.detail-notes label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    display: block;
    margin-bottom: .35rem;
}
.detail-notes p {
    background: #f9fafb;
    border-radius: 8px;
    padding: .85rem 1rem;
    font-size: .92rem;
    line-height: 1.6;
    white-space: pre-wrap;
    color: #444;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: .75rem;
}
.photo-grid img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.no-photos { color: #aaa; font-size: .9rem; font-style: italic; }

/* ===== Activity timeline ===== */
.activity-timeline {
    list-style: none;
    position: relative;
    padding: .25rem 0 0 0;
    margin: 0;
}
.activity-timeline::before {
    content: '';
    position: absolute;
    top: 10px; bottom: 10px;
    left: 7px;
    width: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: .55rem 0;
    position: relative;
}
.activity-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: .15rem;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e2e8f0;
    z-index: 1;
    background: #94a3b8;
}
.activity-dot.dot-milestone        { background: #1a56db; box-shadow: 0 0 0 2px #bfdbfe; }
.activity-dot.dot-sendgrid         { background: #6366f1; box-shadow: 0 0 0 2px #e0e7ff; }
.activity-dot.dot-internal         { background: #0d9488; box-shadow: 0 0 0 2px #ccfbf1; }
.activity-dot.dot-failed           { background: #ef4444; box-shadow: 0 0 0 2px #fee2e2; }
/* customer = booking confirmation — teal brand blue */
.activity-dot.dot-customer         { background: #0284c7; box-shadow: 0 0 0 2px #bae6fd; }
/* reminder sent — amber */
.activity-dot.dot-reminder         { background: #d97706; box-shadow: 0 0 0 2px #fde68a; }
/* reminder pending (scheduled, not yet fired) — amber dashed ring */
.activity-dot.dot-reminder-pending {
    background: #fef9c3;
    border: 2px dashed #d97706;
    box-shadow: none;
}
/* Pending reminder row — muted italic text */
.activity-dot.dot-reminder-pending ~ .activity-body .activity-event {
    font-style: italic;
    color: #92400e;
}
.activity-dot.dot-reminder-pending ~ .activity-body .activity-detail {
    color: #b45309;
    font-size: .68rem;
}
/* review sent — gold star */
.activity-dot.dot-review         { background: #ca8a04; box-shadow: 0 0 0 2px #fef9c3; }
/* review pending delivery — gold dashed ring */
.activity-dot.dot-review-pending {
    background: #fefce8;
    border: 2px dashed #ca8a04;
    box-shadow: none;
}
.activity-dot.dot-review-pending ~ .activity-body .activity-event {
    font-style: italic;
    color: #713f12;
}
.activity-dot.dot-review-pending ~ .activity-body .activity-detail {
    color: #92400e;
    font-size: .68rem;
}
.activity-body { flex: 1; min-width: 0; }
.activity-time {
    font-size: .72rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    margin-bottom: .1rem;
}
.activity-event {
    font-size: .88rem;
    font-weight: 600;
    color: #1e293b;
}
.activity-detail {
    font-size: .78rem;
    color: #64748b;
    margin-top: .05rem;
}

/* ===== PPAI Dashboard ===== */
.ppai-dash { margin-top: 1.5rem; }
.ppai-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.ppai-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}
.ppai-title-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.2));
}
.ppai-sub   { font-size: .8rem; color: #64748b; margin: .2rem 0 0; }
.ppai-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.ppai-date  { font-size: .78rem; color: #64748b; font-weight: 600; }

/* KPI Bar */
.kpi-bar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
@media (max-width: 480px) { .kpi-bar { grid-template-columns: repeat(2, 1fr); } }
.kpi-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem .75rem;
    text-align: center;
}
.kpi-revenue   { background: #f0fdf4; border-color: #bbf7d0; }
.kpi-rate-card { background: #eff6ff; border-color: #bfdbfe; }
.kpi-num { font-size: 1.55rem; font-weight: 800; color: #1e293b; line-height: 1.1; }
.kpi-lbl { font-size: .68rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .05em; margin-top: .25rem; }
.kpi-sub { font-size: .72rem; color: #64748b; margin-top: .15rem; }

/* Dashboard card */
.dash-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.dash-card-hd {
    font-size: .8rem;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dash-card-link { font-size: .75rem; color: #1a56db; text-decoration: none; font-weight: 600; text-transform: none; letter-spacing: 0; }
.dash-card-link:hover { text-decoration: underline; }
.dash-empty { font-size: .85rem; color: #64748b; font-style: italic; margin: 0; }

/* Two-column layout */
.dash-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 700px) { .dash-two-col { grid-template-columns: 1fr; } }

/* Pipeline tracker */
.pt-track {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: .5rem 0 .6rem;
}
.pt-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    flex: 1;
    min-width: 68px;
}
.pt-bubble {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}
.pt-lead      { background: #94a3b8; }
.pt-scheduled { background: #3b82f6; }
.pt-completed { background: #22c55e; }
.pt-report    { background: #8b5cf6; }
.pt-followedup{ background: #f59e0b; }
.pt-reviewed  { background: #14b8a6; }
.pt-lbl {
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.3;
}
.pt-arrow { font-size: 1.4rem; color: #e2e8f0; flex-shrink: 0; margin-bottom: 1.4rem; padding: 0 .15rem; }
.pt-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-top: .6rem; background: #f1f5f9; }
.pt-seg { height: 100%; }

/* Activity feed */
.activity-feed-list { list-style: none; margin: 0; padding: 0; }
.af-item {
    display: flex;
    gap: .7rem;
    padding: .6rem 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: flex-start;
}
.af-item:last-child { border-bottom: none; }
.af-dot { width: 8px; height: 8px; border-radius: 50%; background: #1a56db; flex-shrink: 0; margin-top: .4rem; }
.af-body { flex: 1; min-width: 0; }
.af-name { font-weight: 600; font-size: .86rem; color: #1e293b; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.af-name a { color: #1a56db; text-decoration: none; }
.af-name a:hover { text-decoration: underline; }
.af-vehicle { font-size: .75rem; color: #64748b; margin-top: .1rem; }
.af-time    { font-size: .7rem;  color: #64748b; margin-top: .12rem; }

/* Email delivery log */
.email-log-list { list-style: none; margin: 0; padding: 0; }
.el-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.el-item:last-child { border-bottom: none; }
.el-status { font-size: .67rem; font-weight: 800; padding: .2rem .45rem; border-radius: 5px; flex-shrink: 0; letter-spacing: .04em; }
.el-ok   { background: #dcfce7; color: #166534; }
.el-fail { background: #fee2e2; color: #991b1b; }
.el-body { flex: 1; min-width: 0; }
.el-type { font-size: .82rem; font-weight: 600; color: #1e293b; }
.el-meta { font-size: .72rem; color: #64748b; margin-top: .04rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Check icons in customer status table */
.chk-icon     { font-size: .95rem; }
.chk-icon-on  { color: #16a34a; }
.chk-icon-off { color: #cbd5e1; }

/* ===== Inspection list — name + vehicle stacked ===== */
.ins-name-link { font-weight: 600; color: #1a56db; text-decoration: none; display: block; }
.ins-name-link:hover { text-decoration: underline; }
.ins-vehicle { font-size: .75rem; color: #64748b; margin-top: .1rem; }

/* ===== Status checklist column ===== */
.status-checks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .18rem;
}
.status-checks li {
    font-size: .73rem;
    font-weight: 600;
    padding-left: 1.1rem;
    position: relative;
    white-space: nowrap;
}
.status-checks li::before {
    position: absolute;
    left: 0;
    font-size: .78rem;
}
.chk-on  { color: #16a34a; }
.chk-on::before  { content: '✔'; }
.chk-off { color: #cbd5e1; }
.chk-off::before { content: '○'; }

/* ===== Price editor ===== */
.price-editor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: .75rem 1rem;
    margin-bottom: .5rem;
}
.price-editor-form {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}
.price-editor-label {
    font-size: .82rem;
    font-weight: 700;
    color: #166534;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.price-editor-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #86efac;
    border-radius: 7px;
    background: #fff;
    overflow: hidden;
}
.price-dollar {
    padding: 0 .4rem 0 .6rem;
    font-weight: 700;
    font-size: .95rem;
    color: #166534;
    line-height: 1;
}
.price-input {
    border: none;
    outline: none;
    width: 72px;
    padding: .35rem .4rem;
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    background: transparent;
}
.price-input::-webkit-inner-spin-button,
.price-input::-webkit-outer-spin-button { opacity: .5; }
.price-each {
    font-size: .82rem;
    color: #15803d;
    font-weight: 600;
}
.price-save-btn {
    padding: .35rem .8rem;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.price-save-btn:hover { background: #15803d; }
.price-formula {
    font-size: .78rem;
    color: #166534;
    font-style: italic;
}
.price-formula strong { font-style: normal; color: #14532d; }
.pkg-select {
    padding: .35rem .6rem;
    border: 1.5px solid #86efac;
    border-radius: 7px;
    background: #fff;
    font-size: .9rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    outline: none;
    min-width: 220px;
}
.pkg-select:focus { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }

/* ===== Package Price badge (New Inspection form) ===== */
.pkg-price-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .35rem;
    color: #444;
}
.pkg-price-badge {
    display: inline-flex;
    align-items: center;
    background: #1d4ed8;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 8px;
    width: fit-content;
    letter-spacing: .01em;
}

/* ===== Customer Status Table toolbar ===== */
.cst-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: .85rem;
}
.cst-toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.cst-filter-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
}
.cst-input {
    height: 32px;
    padding: 0 .5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .8rem;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.cst-input:focus { border-color: #1a56db; }
.cst-select { padding-right: 1.6rem; }
.cst-filter-sep { font-size: .75rem; color: #64748b; }
.cst-btn {
    height: 32px;
    padding: 0 .75rem;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: background .15s;
}
.cst-btn-apply  { background: #1a56db; color: #fff; }
.cst-btn-apply:hover  { background: #1447c0; }
.cst-btn-clear  { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.cst-btn-clear:hover  { background: #e2e8f0; }
.cst-btn-export { background: #064e3b; color: #fff; }
.cst-btn-export:hover { background: #065f46; }
.cst-filter-active {
    font-size: .78rem;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: .4rem .75rem;
    margin-bottom: .75rem;
}
/* Clickable rows */
.cst-row { cursor: pointer; transition: background .1s; }
.cst-row:hover { background: #f0f7ff !important; }
/* Inspector + price columns */
.cst-inspector { font-size: .78rem; color: #64748b; }
.cst-price { font-size: .82rem; font-weight: 700; color: #166534; white-space: nowrap; }
/* New KPI card variants */
.kpi-scheduled { border-top: 3px solid #3b82f6; }
.kpi-completed  { border-top: 3px solid #22c55e; }
.kpi-reviews    { border-top: 3px solid #ca8a04; background: #fefce8; border-color: #fef08a; }

/* ── Google Review URL editor row ───────────────────────────────── */
.review-url-row {
    background: #fefce8;
    border-color: #fef08a;
}
.review-url-row .price-editor-label { color: #713f12; }
.review-url-input {
    border: 1.5px solid #fde047;
    border-radius: 7px;
    padding: .35rem .7rem;
    font-size: .88rem;
    color: #1e293b;
    background: #fff;
    min-width: 280px;
    max-width: 420px;
    outline: none;
    transition: border-color .15s;
}
.review-url-input:focus { border-color: #ca8a04; }

/* ── Review pending badge in Review column ───────────────────────── */
.review-pending-badge {
    display: inline-block;
    font-size: .8rem;
    color: #92400e;
    background: #fef9c3;
    border: 1.5px solid #fde047;
    border-radius: 4px;
    padding: 0 .3rem;
    line-height: 1.6;
    cursor: default;
}

/* ===== Payment panel (inspection detail) ===== */
.payment-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.payment-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}
.payment-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .75rem;
    border-radius: 99px;
    font-size: .82rem;
    font-weight: 700;
    margin-right: .75rem;
}
.payment-paid      { background: #dcfce7; color: #166534; }
.payment-sent      { background: #fff7ed; color: #9a3412; }
.payment-unpaid    { background: #fee2e2; color: #991b1b; }
.payment-failed    { background: #fef2f2; color: #7f1d1d; }
.payment-refunded  { background: #f3f4f6; color: #4b5563; }
.payment-amount {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
}
.payment-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.btn-pay {
    padding: .35rem .85rem;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-pay-ok     { background: #16a34a; color: #fff; }
.btn-pay-ok:hover     { background: #15803d; }
.btn-pay-undo   { background: #e5e7eb; color: #374151; }
.btn-pay-undo:hover   { background: #d1d5db; }
.btn-pay-resend { background: #1a56db; color: #fff; }
.btn-pay-resend:hover { background: #1447c0; }
.payment-link-row {
    margin-top: .6rem;
    font-size: .75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.payment-link-label { font-weight: 600; white-space: nowrap; }
.payment-link-url   { color: #1a56db; text-decoration: none; word-break: break-all; }
.payment-link-url:hover { text-decoration: underline; }
/* Stripe test-mode badge in nav */
.stripe-test-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .65rem;
    background: #fef08a;
    color: #854d0e;
    border: 1.5px solid #fbbf24;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .03em;
    white-space: nowrap;
    margin-left: .5rem;
}
.stripe-live-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .75rem;
    background: #dcfce7;
    color: #14532d;
    border: 1.5px solid #4ade80;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    white-space: nowrap;
    margin-left: .5rem;
    animation: live-pulse 2.5s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,.45); }
    50%       { box-shadow: 0 0 0 5px rgba(74,222,128,0); }
}
/* Payment dot in activity timeline */
.dot-payment { background: #16a34a !important; }
/* ── Payment amount line ─────────────────────────────────────────────── */
.pay-amount-line {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -.01em;
    margin-bottom: .2rem;
}

.pay-cell { vertical-align: middle; }
.pay-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    gap: .2rem;
}
/* green */
.pay-paid     { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
/* orange */
.pay-sent     { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
/* red */
.pay-unpaid   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
/* dark red */
.pay-failed   { background: #fef2f2; color: #7f1d1d; border: 1px solid #fca5a5; }
/* gray */
.pay-refunded { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }

.pay-ts {
    font-size: .72rem;
    color: #64748b;
    margin-top: .18rem;
    white-space: nowrap;
}

/* ── Row action column ────────────────────────────────────────── */
.row-actions-th {
    white-space: nowrap;
    min-width: 44px;
    width: 44px;
}
.row-actions-td {
    vertical-align: middle;
    padding: .35rem .5rem !important;
    text-align: center;
}

/* ── Payment action dropdown menu ────────────────────────────── */
.pay-menu {
    position: relative;
    display: inline-block;
}
.pay-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: background .12s, border-color .12s;
    font-family: inherit;
    letter-spacing: .05em;
}
.pay-menu-trigger:hover {
    background: #e2e8f0;
    border-color: #64748b;
    color: #1e293b;
}
.pay-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 200px;
    z-index: 200;
    padding: .3rem;
    overflow: hidden;
}
.pay-menu:hover .pay-menu-dropdown,
.pay-menu:focus-within .pay-menu-dropdown {
    display: block;
}
.pay-menu-form { display: contents; }
.pay-menu-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .55rem .85rem;
    border: none;
    border-radius: 6px;
    background: none;
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background .1s;
    font-family: inherit;
}
.pay-menu-item:hover { background: #f1f5f9; color: #1e293b; }
.pay-menu-sep {
    height: 1px;
    background: #f1f5f9;
    margin: .2rem .5rem;
}

/* Menu item colours */
.pmi-send    { color: #065f46; }
.pmi-send:hover { background: #f0fdf4; }
.pmi-resend  { color: #1e40af; }
.pmi-resend:hover { background: #eff6ff; }
.pmi-copy    { color: #475569; }
.pmi-copy:hover  { background: #f8fafc; }
.pmi-markpaid   { color: #15803d; }
.pmi-markpaid:hover   { background: #f0fdf4; }
.pmi-markunpaid { color: #92400e; }
.pmi-markunpaid:hover { background: #fffbeb; }
.pmi-invoice    { color: #0f766e; text-decoration: none; }
.pmi-invoice:hover  { background: #f0fdfa; }

/* Keep ra-btn-copied for clipboard JS feedback */
.ra-btn-copied  { background: #dcfce7 !important; color: #166534 !important; border-color: #86efac !important; }

/* Responsive: on narrow screens, hide the action column */
@media (max-width: 900px) {
    .row-actions-th, .row-actions-td { display: none; }
}

/* ===== Payment Summary Card ===== */
.pay-summary-card {
    padding: 1.1rem 1.25rem 1.25rem;
}
.pay-sum-hd {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.pay-sum-sub {
    font-size: .72rem;
    color: #64748b;
    font-weight: 500;
}

/* 4-column grid: label col + 3 time-period cols */
.pay-sum-grid {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) repeat(3, minmax(90px, 1.4fr));
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.pay-sum-col-hd {
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
    padding: .55rem .8rem;
    font-size: .7rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-align: center;
}
.pay-sum-col-hd:first-child { border-left: none; }

.pay-sum-label {
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
    padding: .55rem .8rem;
}

.pay-sum-row-label {
    display: flex;
    align-items: center;
    padding: .65rem .9rem;
    font-size: .78rem;
    font-weight: 700;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
}
.pay-sum-row-label:last-of-type { border-bottom: none; }

.pay-sum-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .65rem .8rem;
    font-size: .9rem;
    font-weight: 700;
    border-left: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    letter-spacing: -.02em;
}
/* Remove bottom border on last row (4 cells per row, 1 label + 3 data) */
.pay-sum-grid > div:nth-last-child(-n+4) { border-bottom: none; }

/* Colour variants */
.pay-cell-billed    { color: #1e3a5f; }
.pay-cell-collected { color: #15803d; background: #f0fdf4; }
.pay-cell-zero      { color: #64748b; }
.pay-cell-unpaid    { color: #b91c1c; background: #fff5f5; }

/* Rate cells */
.pay-sum-rate { font-size: .92rem; font-weight: 800; letter-spacing: -.02em; }
.rate-high    { color: #15803d; background: #f0fdf4; }
.rate-mid     { color: #92400e; background: #fffbeb; }
.rate-low     { color: #b91c1c; background: #fff5f5; }

@media (max-width: 600px) {
    .pay-sum-grid {
        grid-template-columns: minmax(90px, 1fr) repeat(3, 1fr);
    }
    .pay-sum-cell, .pay-sum-row-label, .pay-sum-col-hd { padding: .5rem .45rem; font-size: .72rem; }
}

/* ===== Payment Aging Dashboard Section ===================================== */
.aging-card { padding: 0; overflow: hidden; }

.aging-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 1.1rem 1.4rem .9rem;
    border-bottom: 1px solid #e2e8f0;
}
.aging-sub {
    display: block;
    font-size: .78rem;
    color: #64748b;
    margin-top: .2rem;
    font-weight: 400;
}
.aging-risk-flag {
    font-size: .78rem;
    font-weight: 700;
    color: #991b1b;
    background: #fff1f2;
    border: 1.5px solid #fca5a5;
    border-radius: 6px;
    padding: .3rem .75rem;
    white-space: nowrap;
    animation: risk-pulse 2s ease-in-out infinite;
}
@keyframes risk-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.3); }
    50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Bucket cards row */
.aging-buckets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-bottom: 1px solid #e2e8f0;
}
.aging-bucket {
    position: relative;
    padding: 1.1rem 1.25rem .9rem;
    border-right: 1px solid #e2e8f0;
    overflow: hidden;
    transition: background .15s;
}
.aging-bucket:last-child { border-right: none; }
.aging-bucket-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .45rem;
    color: #64748b;
}
.aging-amt {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: .3rem;
    letter-spacing: -.03em;
}
.aging-cnt {
    font-size: .73rem;
    font-weight: 500;
}
/* Bottom progress bar inside each bucket */
.aging-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0;
    transition: width .4s ease;
}

/* Bucket color themes */
.age-fresh  { background: #f8fafc; }
.age-fresh .aging-amt  { color: #334155; }
.age-fresh .aging-cnt  { color: #64748b; }
.age-bar-fresh  { background: #94a3b8; }

.age-warn   { background: #fffbeb; }
.age-warn .aging-amt   { color: #92400e; }
.age-warn .aging-cnt   { color: #a16207; }
.age-bar-warn   { background: #f59e0b; }

.age-risk   { background: #fff7ed; }
.age-risk .aging-amt   { color: #9a3412; }
.age-risk .aging-cnt   { color: #c2410c; }
.age-bar-risk   { background: #f97316; }

.age-critical  { background: #fafafa; }
.age-critical .aging-amt  { color: #64748b; }
.age-critical .aging-cnt  { color: #64748b; }
.age-bar-critical  { background: #cbd5e1; }

/* Critical bucket when it actually has accounts */
.age-critical-active   { background: #fff1f2; }
.age-critical-active .aging-bucket-label { color: #991b1b; }
.age-critical-active .aging-amt          { color: #b91c1c; }
.age-critical-active .aging-cnt          { color: #dc2626; }
.age-bar-critical      { background: #ef4444; }

/* Stacked proportion bar */
.aging-stacked-bar {
    display: flex;
    height: 6px;
    overflow: hidden;
}
.asb-seg { transition: flex .4s ease; }
.asb-fresh { background: #94a3b8; }
.asb-warn  { background: #f59e0b; }
.asb-risk  { background: #f97316; }
.asb-crit  { background: #ef4444; }

/* High-risk table */
.aging-risk-section { padding: .9rem 1.25rem 1.1rem; }
.aging-risk-hd {
    font-size: .78rem;
    font-weight: 700;
    color: #991b1b;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .65rem;
}
.aging-risk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.aging-risk-table th {
    text-align: left;
    padding: .4rem .6rem;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
}
.aging-risk-row { border-bottom: 1px solid #f1f5f9; }
.aging-risk-row:last-child { border-bottom: none; }
.aging-risk-row td { padding: .55rem .6rem; vertical-align: middle; }
.aging-risk-row:hover { background: #fff8f8; }
.aging-cust-name a { color: #1e3a5f; font-weight: 600; text-decoration: none; }
.aging-cust-name a:hover { text-decoration: underline; }
.aging-cust-email { font-size: .72rem; color: #64748b; margin-top: .1rem; }
.aging-col-amt  { text-align: right; }
.aging-row-amt  { font-weight: 700; color: #b91c1c; }
.aging-days-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 800;
}
.age-badge-warn     { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.age-badge-critical { background: #fff1f2; color: #991b1b; border: 1px solid #fecaca; }
.aging-actions { text-align: right; white-space: nowrap; }
.aging-btn-view, .aging-btn-pay {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 5px;
    text-decoration: none;
    margin-left: .3rem;
}
.aging-btn-view { background: #f1f5f9; color: #334155; }
.aging-btn-view:hover { background: #e2e8f0; }
.aging-btn-pay  { background: #1e3a5f; color: #fff; }
.aging-btn-pay:hover { background: #1a3356; }

/* Responsive */
@media (max-width: 640px) {
    .aging-buckets { grid-template-columns: repeat(2, 1fr); }
    .aging-bucket  { border-bottom: 1px solid #e2e8f0; }
    .aging-bucket:nth-child(2) { border-right: none; }
    .aging-risk-table th:nth-child(3),
    .aging-risk-table td:nth-child(3) { display: none; }
}
@media (max-width: 400px) {
    .aging-buckets { grid-template-columns: 1fr 1fr; }
}

/* ===== SendGrid status page ===== */
.sg-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
@media (max-width: 600px) { .sg-summary-grid { grid-template-columns: repeat(2, 1fr); } }
.sg-card {
    border-radius: 10px;
    padding: 1.1rem 1rem;
    text-align: center;
    border: 1px solid transparent;
}
.sg-sent      { background: #f0f9ff; border-color: #bae6fd; }
.sg-delivered { background: #f0fdf4; border-color: #bbf7d0; }
.sg-failed    { background: #fff1f2; border-color: #fecdd3; }
.sg-rate      { background: #faf5ff; border-color: #e9d5ff; }
.sg-num {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: #1e293b;
}
.sg-lbl { font-size: .78rem; font-weight: 600; color: #64748b; margin-top: .3rem; text-transform: uppercase; letter-spacing: .04em; }
.sg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.sg-table th {
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    border-bottom: 2px solid #e5e7eb;
    padding: .5rem .6rem;
}
.sg-table td {
    padding: .55rem .6rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.sg-table tbody tr:hover { background: #f8fafc; }
.ta-r { text-align: right; }
.ta-c { text-align: center; }
.sg-rate-pill {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 700;
}
.pill-ok   { background: #dcfce7; color: #166534; }
.pill-warn { background: #fef9c3; color: #854d0e; }
.pill-fail { background: #fee2e2; color: #991b1b; }
.sg-status-ok {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 700;
    background: #dcfce7;
    color: #166534;
}
.sg-status-fail {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 700;
    background: #fee2e2;
    color: #991b1b;
}

/* ===== Stats grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.stats-group {
    display: contents;
}
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.stat-card .stat-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #64748b;
}
.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
}
.stat-card .stat-sub {
    font-size: .75rem;
    color: #64748b;
    margin-top: .1rem;
}
.stat-card.stat-accent { border-top: 3px solid #1a56db; }
.stat-card.stat-green  { border-top: 3px solid #10b981; }
.stat-card.stat-amber  { border-top: 3px solid #f59e0b; }
.stat-card.stat-violet { border-top: 3px solid #8b5cf6; }
/* ===== Pipeline strip ===== */
.pipeline-strip {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 1.75rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    overflow: hidden;
}
.pipeline-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: .9rem .5rem;
    position: relative;
    cursor: default;
    border-right: 1px solid #f0f1f3;
    text-decoration: none;
    transition: background .15s;
}
.pipeline-stage:last-child { border-right: none; }
.pipeline-stage:hover { background: #f8faff; }
.pipeline-stage .ps-count {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}
.pipeline-stage .ps-pct {
    font-size: .72rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1;
    margin-top: .15rem;
}
.pipeline-stage .ps-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    margin-top: .25rem;
    text-align: center;
    white-space: nowrap;
}
.pipeline-stage .ps-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
}
.ps-bar-lead       { background: #94a3b8; }
.ps-bar-scheduled  { background: #1a56db; }
.ps-bar-completed  { background: #0d9488; }
.ps-bar-report     { background: #6366f1; }
.ps-bar-followedup { background: #d97706; }
.ps-bar-reviewed   { background: #16a34a; }

/* ===== Pipeline status badges ===== */
.badge-lead            { background: #f1f5f9; color: #64748b; }
.badge-new-order       { background: #ede9fe; color: #6d28d9; }
.badge-pending-assign  { background: #e0f2fe; color: #0369a1; }
.badge-scheduled       { background: #dbeafe; color: #1e40af; }
.badge-accepted        { background: #e0f2fe; color: #0c4a6e; }
.badge-enroute         { background: #fef9c3; color: #713f12; }
.badge-inprogress      { background: #d1fae5; color: #14532d; }
.badge-pending-review  { background: #fef3c7; color: #92400e; }
.badge-returned        { background: #fee2e2; color: #b91c1c; }
.badge-approved        { background: #d1fae5; color: #065f46; }
.badge-completed       { background: #ccfbf1; color: #0f766e; }
.badge-report          { background: #e0e7ff; color: #4338ca; }
.badge-followedup      { background: #fef3c7; color: #92400e; }
.badge-reviewed        { background: #dcfce7; color: #15803d; }
.badge-quo-new         { background: #ede9fe; color: #6d28d9; }
.badge-quo-contacted   { background: #dbeafe; color: #1e40af; }
.badge-quo-quote       { background: #fef3c7; color: #92400e; }
.badge-quo-ready       { background: #d1fae5; color: #065f46; }
.badge-quo-booked      { background: #ccfbf1; color: #0f766e; }
.badge-quo-lost        { background: #fee2e2; color: #991b1b; }

.stats-section-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #64748b;
    margin: .5rem 0 .4rem;
    grid-column: 1 / -1;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 1.2rem; }
    table { font-size: .82rem; }
    thead th, tbody td { padding: .65rem .6rem; }
    /* Hide less critical columns on small screens */
    .col-email, .col-inspector { display: none; }
}

/* ==========================================================================
   INSPECTION DETAIL PAGE
   ========================================================================== */

/* ── Page Header ─────────────────────────────────────────────────────── */
.id-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.id-header-left { flex: 1; min-width: 0; }
.id-header-right { flex-shrink: 0; display: flex; align-items: flex-start; gap: .5rem; margin-top: .25rem; }

.id-back {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    margin-bottom: .5rem;
    letter-spacing: .01em;
}
.id-back:hover { color: #1a56db; }

.id-title-row {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.id-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    line-height: 1.15;
}
.id-num {
    font-size: .8rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

/* Status chips */
.id-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.id-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .65rem;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
.chip-lead       { background: #f1f5f9; color: #64748b; }
.chip-scheduled  { background: #eff6ff; color: #2563eb; }
.chip-completed  { background: #f0fdf4; color: #15803d; }
.chip-report     { background: #faf5ff; color: #7c3aed; }
.chip-followedup { background: #fff7ed; color: #c2410c; }
.chip-reviewed   { background: #fefce8; color: #92400e; }
.chip-paid       { background: #dcfce7; color: #15803d; }
.chip-paysent    { background: #eff6ff; color: #1d4ed8; }
.chip-payfailed  { background: #fef2f2; color: #b91c1c; }
.chip-refunded   { background: #f1f5f9; color: #475569; }
.chip-unpaid     { background: #fff7ed; color: #b45309; }

/* ── Shared card ─────────────────────────────────────────────────────── */
.id-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.id-card-hd {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #64748b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.id-card-cnt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #475569;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 99px;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .35rem;
    letter-spacing: 0;
    text-transform: none;
}

/* ── Quick Actions panel ─────────────────────────────────────────────── */
.id-actions-card { padding-bottom: 1.1rem; }
.id-actions-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}
.id-action-form { display: contents; }
.id-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .72rem 1rem;
    border: 1.5px solid transparent;
    border-radius: 10px;
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
    background: #334155;
    color: #fff;
    border-color: #1e293b;
    transition: all .15s;
    min-width: 108px;
    flex: 1;
    max-width: 160px;
    text-align: center;
    white-space: normal;
    word-break: break-word;
}
.id-action-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.id-action-icon { font-size: 1.25rem; line-height: 1; display: block; }
.id-action-label { line-height: 1.25; display: block; }

/* Solid-background, high-contrast action button variants */
.id-action-blue   { background: #1d4ed8; color: #fff; border-color: #1e40af; }
.id-action-blue:hover { background: #1e40af; }
.id-action-indigo { background: #4338ca; color: #fff; border-color: #3730a3; }
.id-action-indigo:hover { background: #3730a3; }
.id-action-green  { background: #15803d; color: #fff; border-color: #166534; }
.id-action-green:hover { background: #166534; }
.id-action-gray   { background: #475569; color: #fff; border-color: #334155; }
.id-action-gray:hover { background: #334155; }
.id-action-gold   { background: #b45309; color: #fff; border-color: #92400e; }
.id-action-gold:hover { background: #92400e; }
.id-action-teal   { background: #0f766e; color: #fff; border-color: #0d6b64; }
.id-action-teal:hover { background: #115e59; }
.id-action-link   { text-decoration: none; display: flex; }


.id-stage-form {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .25rem;
    padding-top: .75rem;
    border-top: 1px solid #f1f5f9;
}
.id-stage-label { font-size: .8rem; font-weight: 600; color: #444; white-space: nowrap; }
.id-stage-select {
    padding: .4rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .875rem;
    color: #222;
    background: #fff;
}

/* ── Two-column layout ───────────────────────────────────────────────── */
.id-cols {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: start;
}
.id-col-main { min-width: 0; }
.id-col-side  { min-width: 0; }

/* ── Field grids ─────────────────────────────────────────────────────── */
.id-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem 1.25rem;
}
.id-fields-3 {
    grid-template-columns: repeat(3, 1fr);
}
.id-field-full { grid-column: 1 / -1; }
.id-field-lbl {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #64748b;
    margin-bottom: .2rem;
}
.id-field-val {
    font-size: .9rem;
    color: #1e293b;
    font-weight: 500;
}
.id-field-strong { font-weight: 700; }
.id-field-mono   { font-family: monospace; font-size: .82rem; color: #374151; }
.id-email-link   { color: #1a56db; text-decoration: none; }
.id-email-link:hover { text-decoration: underline; }
.id-price-val    { font-size: 1.1rem; font-weight: 700; color: #15803d; }

/* ── Notes ───────────────────────────────────────────────────────────── */
.id-notes {
    font-size: .9rem;
    color: #374151;
    line-height: 1.65;
    white-space: pre-wrap;
    background: #f8fafc;
    border-radius: 8px;
    padding: .85rem 1rem;
    margin: 0;
    border-left: 3px solid #cbd5e1;
}

/* ── Payment side card ───────────────────────────────────────────────── */
.id-pay-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
}
.id-pay-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -.02em;
}
.id-pay-ts {
    font-size: .73rem;
    color: #64748b;
    margin-bottom: .5rem;
}
.id-pay-link-row {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px solid #f1f5f9;
}
.id-pay-link-lbl { font-size: .67rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .07em; }
.id-pay-link-url { font-size: .73rem; color: #1a56db; word-break: break-all; text-decoration: none; }
.id-pay-link-url:hover { text-decoration: underline; }

/* ── Email automations ───────────────────────────────────────────────── */
.id-auto-list { display: flex; flex-direction: column; gap: .55rem; }
.id-auto-row {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.id-auto-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.auto-dot-on      { background: #10b981; }
.auto-dot-off     { background: #e2e8f0; }
.auto-dot-pending { background: #94a3b8; }
.auto-dot-hold    { background: #fbbf24; }
.id-auto-label { font-size: .83rem; color: #374151; font-weight: 500; flex: 1; }
.id-auto-badge {
    font-size: .68rem;
    font-weight: 700;
    padding: .15rem .55rem;
    border-radius: 99px;
    white-space: nowrap;
}
.auto-badge-sent    { background: #dcfce7; color: #15803d; }
.auto-badge-pending { background: #f1f5f9; color: #64748b; }
.auto-badge-hold    { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .id-cols { grid-template-columns: 1fr; }
    .id-col-side { order: -1; }
    .id-fields-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .id-header { flex-direction: column; }
    .id-header-right { width: 100%; }
    .id-header-right .btn { width: 100%; text-align: center; }
    .id-title { font-size: 1.25rem; }
    .id-actions-row { flex-direction: column; }
    .id-action-btn { max-width: 100%; flex-direction: row; justify-content: center; min-width: 0; }
    .id-fields, .id-fields-3 { grid-template-columns: 1fr; }
    .id-field-full { grid-column: auto; }
    .id-card { padding: 1rem; }
}

/* ── Customer History ─────────────────────────────────────────────── */
.ch-card { padding: 0; overflow: hidden; }

.ch-toolbar {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

/* filter bar */
.ch-filter-bar {
    display: flex;
    gap: 4px;
    align-items: center;
}
.ch-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 500;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.ch-filter-btn:hover { background: #e2e8f0; }
.ch-filter-active {
    background: #1a3a5c !important;
    color: #fff !important;
    border-color: #1a3a5c !important;
}
.ch-filter-cnt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.12);
    border-radius: 10px;
    min-width: 18px;
    padding: 0 5px;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.5;
}
.ch-filter-active .ch-filter-cnt { background: rgba(255,255,255,.25); }
.ch-filter-repeat { color: #4338ca; border-color: #c7d2fe; background: #eef2ff; }
.ch-filter-repeat:hover { background: #e0e7ff; }
.ch-filter-new    { color: #0f766e; border-color: #99f6e4; background: #f0fdfa; }
.ch-filter-new:hover    { background: #ccfbf1; }

/* table */
.ch-table-wrap { overflow-x: auto; }
.ch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.ch-th {
    padding: 9px 14px;
    text-align: left;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.ch-th-center { text-align: center; }
.ch-row:hover { background: #f8fafc; }
.ch-row + .ch-row { border-top: 1px solid #f1f5f9; }
.ch-td { padding: 11px 14px; color: #1e293b; vertical-align: middle; }
.ch-td-center { text-align: center; }

/* customer name + email */
.ch-cust-name { font-weight: 600; color: #0f172a; font-size: .9rem; }
.ch-cust-email { font-size: .78rem; color: #64748b; margin-top: 1px; }

/* numeric cells */
.ch-insp-count {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 12px;
    padding: 2px 10px;
    font-weight: 700;
    font-size: .85rem;
}
.ch-spent { font-weight: 600; color: #15803d; font-size: .9rem; }
.ch-last-date { color: #475569; font-size: .83rem; }

/* badges */
.ch-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.ch-badge-repeat {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}
.ch-badge-new {
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

@media (max-width: 640px) {
    .ch-toolbar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .ch-filter-bar { flex-wrap: wrap; }
    .ch-th, .ch-td { padding: 8px 10px; }
}

/* ── Inspector Performance ────────────────────────────────────────── */
.ip-card { padding: 0; overflow: hidden; }
.ip-card .dash-card-hd { padding: 1.1rem 1.4rem 0.9rem; border-bottom: 1px solid #e2e8f0; margin: 0; }

.ip-table-wrap { overflow-x: auto; }
.ip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.ip-th {
    padding: 9px 14px;
    text-align: left;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.ip-th-center { text-align: center; }
.ip-row + .ip-row { border-top: 1px solid #f1f5f9; }
.ip-row:hover { background: #f8fafc; }
.ip-td { padding: 12px 14px; color: #1e293b; vertical-align: middle; }
.ip-td-center { text-align: center; }

/* avatar + name */
.ip-td-name { display: flex; align-items: center; gap: 10px; }
.ip-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #1a3a5c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
    flex-shrink: 0;
}
.ip-username { font-weight: 600; color: #0f172a; }

/* count pills */
.ip-num {
    display: inline-block;
    background: #f1f5f9;
    color: #334155;
    border-radius: 12px;
    padding: 2px 11px;
    font-weight: 700;
    font-size: .85rem;
}
.ip-num-done {
    background: #f0fdf4;
    color: #15803d;
}

/* completion rate */
.ip-rate-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}
.ip-rate-bar {
    width: 80px;
    height: 7px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.ip-rate-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .4s ease;
}
.ip-rate-high { background: #22c55e; }
.ip-rate-mid  { background: #f59e0b; }
.ip-rate-low  { background: #ef4444; }
.ip-rate-pct  { font-size: .8rem; font-weight: 700; width: 34px; text-align: right; }
.ip-pct-high  { color: #15803d; }
.ip-pct-mid   { color: #92400e; }
.ip-pct-low   { color: #b91c1c; }

/* revenue */
.ip-revenue { font-weight: 600; color: #1d4ed8; font-size: .9rem; }

/* turnaround badges */
.ip-turn {
    display: inline-block;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: .78rem;
    font-weight: 600;
}
.ip-turn-fast { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.ip-turn-ok   { background: #fefce8; color: #92400e; border: 1px solid #fde68a; }
.ip-turn-slow { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.ip-turn-none { color: #64748b; }

/* footnote */
.ip-footnote {
    font-size: .74rem;
    color: #64748b;
    padding: .6rem 1.4rem .8rem;
    margin: 0;
    border-top: 1px solid #f1f5f9;
}

@media (max-width: 700px) {
    .ip-rate-bar { width: 50px; }
    .ip-th, .ip-td { padding: 8px 10px; }
    .ip-td-name { gap: 7px; }
    .ip-avatar { width: 28px; height: 28px; font-size: .8rem; }
}

/* ─── Report Access Gate ─────────────────────────────────────────────────── */

/* Locked PDF button in header */
.btn-locked {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem 1.1rem;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
    border: 1.5px solid #cbd5e1;
    cursor: not-allowed;
    user-select: none;
}

/* Payment gate banner (inspector view — red) */
.pay-gate-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

/* Admin-flavour banner (amber) */
.pay-gate-banner.pay-gate-admin {
    background: #fffbeb;
    border-color: #fde68a;
}

.pay-gate-banner-left {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}

.pay-gate-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.pay-gate-title {
    font-size: .95rem;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: .2rem;
}
.pay-gate-admin .pay-gate-title { color: #92400e; }

.pay-gate-sub {
    font-size: .82rem;
    color: #b91c1c;
    line-height: 1.45;
}
.pay-gate-admin .pay-gate-sub { color: #78350f; }

/* Unlock CTA button */
.unlock-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem 1.4rem;
    border-radius: 7px;
    font-size: .9rem;
    font-weight: 700;
    background: #16a34a;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(22,163,74,.3);
    transition: background .15s;
}
.unlock-btn:hover { background: #15803d; color: #fff; }

.unlock-btn.unlock-btn-admin {
    background: #d97706;
    box-shadow: 0 2px 8px rgba(217,119,6,.3);
}
.unlock-btn.unlock-btn-admin:hover { background: #b45309; }

/* Blurred content wrapper */
.report-gate-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.report-blurred {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

/* Overlay that sits on top of blurred content */
.report-gate-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(248,250,252,0.55) 0%,
        rgba(248,250,252,0.92) 60%,
        rgba(248,250,252,1) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.report-gate-overlay-inner {
    text-align: center;
    padding: 1.5rem;
}

.rgo-lock {
    font-size: 2rem;
    margin-bottom: .5rem;
}

.rgo-label {
    font-size: .88rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: .85rem;
}

.rgo-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .55rem 1.25rem;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 700;
    background: #16a34a;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(22,163,74,.3);
    transition: background .15s;
}
.rgo-btn:hover { background: #15803d; color: #fff; }

@media (max-width: 640px) {
    .pay-gate-banner { flex-direction: column; }
    .unlock-btn { width: 100%; justify-content: center; }
}

/* ─── Collection KPI Bar ─────────────────────────────────────────────────── */

.coll-kpi-bar {
    display: grid;
    grid-template-columns: auto repeat(4, 1fr);
    align-items: start;
    gap: .75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.coll-kpi-hd {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    padding: .25rem 0;
    align-self: center;
}

.coll-kpi-card {
    text-align: center;
    padding: .75rem .5rem .6rem;
    border-left: 1px solid #f1f5f9;
}

.coll-kpi-num {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: .3rem;
}

/* Colour variants */
.ckpi-green  { color: #16a34a; }
.ckpi-amber  { color: #d97706; }
.ckpi-red    { color: #dc2626; }
.ckpi-blue   { color: #2563eb; }
.ckpi-purple { color: #7c3aed; }
.coll-kpi-na { color: #cbd5e1; }

.coll-kpi-lbl {
    font-size: .78rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: .2rem;
}

.coll-kpi-sub {
    font-size: .7rem;
    color: #64748b;
    line-height: 1.4;
}

.coll-kpi-note {
    grid-column: 1 / -1;
    font-size: .7rem;
    color: #64748b;
    text-align: right;
    padding-top: .25rem;
    border-top: 1px solid #f1f5f9;
}

@media (max-width: 800px) {
    .coll-kpi-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .coll-kpi-hd { writing-mode: horizontal-tb; transform: none; grid-column: 1 / -1; }
    .coll-kpi-card { border-left: none; border-top: 1px solid #f1f5f9; }
    .coll-kpi-note { grid-column: 1 / -1; }
}

/* ─── Lead Source Badge ──────────────────────────────────────────────────── */

.lead-source-badge {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.ls-google   { background: #dbeafe; color: #1e40af; }
.ls-referral { background: #dcfce7; color: #166534; }
.ls-dealer   { background: #fef9c3; color: #854d0e; }
.ls-website  { background: #f3e8ff; color: #6b21a8; }
.ls-other    { background: #f1f5f9; color: #475569; }
.ls-unknown  { background: #f1f5f9; color: #64748b; }

/* ─── Revenue by Source Table ───────────────────────────────────────────── */

.rbs-card { padding: 0; }

.rbs-table-wrap { overflow-x: auto; }

.rbs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}

.rbs-th {
    padding: .55rem 1rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.rbs-th-r   { text-align: right; }
.rbs-th-bar { text-align: left; min-width: 140px; }

.rbs-tr:hover { background: #f8fafc; }

.rbs-td {
    padding: .65rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}
.rbs-td-r   { text-align: right; }
.rbs-td-bar { min-width: 140px; }

.rbs-billed    { font-weight: 600; color: #1e293b; }
.rbs-collected { color: #16a34a; font-weight: 600; }

.rbs-rate {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 4px;
    font-size: .78rem;
    font-weight: 700;
}
.rbs-rate-hi  { background: #dcfce7; color: #166534; }
.rbs-rate-mid { background: #fef9c3; color: #854d0e; }
.rbs-rate-lo  { background: #fee2e2; color: #991b1b; }

/* Revenue bar */
.rbs-bar-track {
    display: inline-block;
    width: 90px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: .45rem;
    overflow: hidden;
}
.rbs-bar-fill {
    height: 100%;
    border-radius: 3px;
}
/* Source-coloured bars */
.ls-bar-google   { background: #3b82f6; }
.ls-bar-referral { background: #22c55e; }
.ls-bar-dealer   { background: #eab308; }
.ls-bar-website  { background: #a855f7; }
.ls-bar-other    { background: #94a3b8; }
.ls-bar-unknown  { background: #cbd5e1; }

.rbs-bar-pct {
    font-size: .72rem;
    color: #64748b;
    vertical-align: middle;
}

/* =========================================================
   Role badges (navbar + user management)
   ========================================================= */
.nav-user-info {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    opacity: .9;
}
.role-badge {
    display: inline-flex;
    align-items: center;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .15em .55em;
    border-radius: 999px;
    line-height: 1.4;
}
.role-badge-admin {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}
.role-badge-franchise {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
}
.role-badge-inspector {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

/* =========================================================
   User Management page
   ========================================================= */
/* User table */
.um-table-wrap { overflow-x: auto; margin-top: .25rem; }
.um-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .87rem;
}
.um-th {
    background: #f1f5f9;
    padding: .6rem .9rem;
    text-align: left;
    font-size: .75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid #e2e8f0;
}
.um-th-actions { text-align: right; }
.um-td {
    padding: .7rem .9rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
}
.um-td-id { color: #64748b; font-size: .8rem; width: 2.5rem; }
.um-td-username { font-weight: 600; }
.um-td-actions { text-align: right; white-space: nowrap; }
.um-row-self { background: #fffbeb; }

.um-you-badge {
    font-size: .68rem;
    font-weight: 700;
    background: #fef9c3;
    color: #a16207;
    border: 1px solid #fde047;
    border-radius: 999px;
    padding: .1em .5em;
    margin-left: .35rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.um-edit-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: .35rem .75rem;
    font-size: .8rem;
    cursor: pointer;
    color: #334155;
    font-weight: 600;
    transition: background .15s;
    margin-right: .4rem;
}
.um-edit-btn:hover { background: #e2e8f0; }

.um-delete-form { display: inline; }
.um-delete-btn {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: .35rem .75rem;
    font-size: .8rem;
    cursor: pointer;
    color: #dc2626;
    font-weight: 600;
    transition: background .15s;
}
.um-delete-btn:hover { background: #fee2e2; }

/* Create form */
.um-create-card { margin-top: 1.5rem; }
.um-create-form { margin-top: .5rem; }
.um-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}
.um-form-group {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    flex: 1;
    min-width: 160px;
}
.um-label {
    font-size: .8rem;
    font-weight: 600;
    color: #475569;
}
.um-hint { font-weight: 400; color: #64748b; font-size: .75rem; }
.um-input {
    padding: .5rem .75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: .88rem;
    color: #1e293b;
    background: #fff;
    transition: border .15s, box-shadow .15s;
}
.um-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.um-select { cursor: pointer; }
.um-form-submit { display: flex; align-items: flex-end; }
.um-create-btn {
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.um-create-btn:hover { background: #0f172a; }
.um-cancel-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: .5rem;
    transition: background .15s;
}
.um-cancel-btn:hover { background: #e2e8f0; }

/* Modal */
.um-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.um-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    padding: 1.75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    position: relative;
}
.um-modal-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.25rem;
}
.um-modal-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #64748b;
    padding: .2rem .4rem;
    border-radius: 4px;
    line-height: 1;
}
.um-modal-close:hover { background: #f1f5f9; color: #1e293b; }
.um-modal-form { display: flex; flex-direction: column; gap: .9rem; }
.um-modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: .5rem;
}

/* Back button */
.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: .55rem 1.1rem;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}
.btn-secondary:hover { background: #e2e8f0; }

/* =========================================================
   Payment Gate — Extended Styles
   ========================================================= */

/* Paid banner (green) */
.pay-gate-banner.pay-gate-paid {
    background: #f0fdf4;
    border-color: #86efac;
}
.pay-gate-paid .pay-gate-title { color: #15803d; }
.pay-gate-paid .pay-gate-sub   { color: #166534; }

/* Paid download CTA */
.unlock-btn.unlock-btn-paid {
    background: #15803d;
    box-shadow: 0 2px 8px rgba(21,128,61,.3);
}
.unlock-btn.unlock-btn-paid:hover { background: #166534; }

/* CTA group (allows multiple buttons stacked) */
.pay-gate-cta-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    flex-shrink: 0;
}

/* Fallback when no Stripe link is configured */
.pay-gate-no-link {
    font-size: .82rem;
    color: #64748b;
    font-style: italic;
    white-space: nowrap;
}

/* ── Notes teaser layout ──────────────────────────────── */
.report-notes-teaser {
    -webkit-mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
    max-height: 110px;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

/* Gradient strip between teaser and CTA */
.report-blur-strip {
    height: 2px;
    background: linear-gradient(to right, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
    margin: .5rem 0;
}

/* Override: bottom-anchored overlay (not full-absolute) */
.report-gate-overlay.report-gate-overlay-bottom {
    position: static;
    background: #f8fafc;
    border-radius: 0 0 6px 6px;
    padding: .75rem 1rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Smaller rgo-lock for inline teaser gate */
.report-gate-overlay-bottom .rgo-lock {
    font-size: 1.4rem;
    margin-bottom: .3rem;
}
.report-gate-overlay-bottom .rgo-label {
    font-size: .8rem;
    margin-bottom: .6rem;
}

/* No-link fallback in overlay */
.rgo-no-link {
    display: inline-block;
    font-size: .8rem;
    color: #64748b;
    font-style: italic;
    padding: .4rem .75rem;
    background: #f1f5f9;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
}

/* =========================================================
   ZIP Code Routing — New Inspection form preview widget
   ========================================================= */

.zip-preview-col { display: flex; flex-direction: column; }

.zip-routing-preview {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .6rem .9rem;
    border-radius: 7px;
    font-size: .85rem;
    font-weight: 500;
    border: 1.5px solid transparent;
    min-height: 2.5rem;
    transition: background .2s, border-color .2s;
}

.zip-routing-empty {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.zip-routing-loading {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.zip-routing-found {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.zip-routing-missing {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.zip-routing-icon { font-size: 1rem; flex-shrink: 0; }

/* ZIP routing overridden by manual technician selection */
.zip-routing-override {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
    font-style: italic;
}

/* ── Technician Assignment Card (New Inspection form) ───────────────── */
.tech-assign-card {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .75rem 1rem;
    border-radius: 8px;
    border: 1.5px solid transparent;
    font-size: .85rem;
    font-weight: 500;
    transition: background .2s, border-color .2s;
    min-height: 3rem;
}
.tech-assign-card.tech-assign-auto {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}
.tech-assign-card.tech-assign-manual {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}
.tech-assign-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.tech-assign-title {
    font-weight: 700;
    margin-bottom: 2px;
}
.tech-assign-sub {
    font-size: .8rem;
    font-weight: 400;
    opacity: .85;
}

.form-hint {
    margin: .3rem 0 0;
    font-size: .78rem;
    color: #64748b;
}

/* =========================================================
   ZIP Code Routing — Admin management page
   ========================================================= */

.zr-intro {
    color: #475569;
    font-size: .92rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.zr-add-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.4rem 1.6rem 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.zr-add-hd {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.zr-add-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.zr-add-row .form-group { flex: 1; min-width: 160px; }
.zr-btn-col { flex: 0 0 auto; }

.zr-zip-input { font-size: 1.1rem; letter-spacing: .1em; font-weight: 600; }

.zr-no-inspectors {
    margin-top: .75rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: .5rem .9rem;
    font-size: .85rem;
}

.zr-table-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.zr-table-hd {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.zr-count {
    background: #e2e8f0;
    color: #475569;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 600;
    padding: .1rem .5rem;
}

.zr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.zr-table th {
    text-align: left;
    padding: .65rem 1.2rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.zr-table td {
    padding: .7rem 1.2rem;
    vertical-align: middle;
    border-bottom: 1px solid #f8fafc;
}

.zr-table tr:last-child td { border-bottom: none; }
.zr-row-group-start td { border-top: 1px solid #f1f5f9; }

.zr-inspector-name {
    font-weight: 600;
    color: #1e293b;
}
.zr-inspector-cont { color: #cbd5e1; font-size: .8rem; }

.zr-zip-badge {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    font-size: .82rem;
    font-weight: 700;
    padding: .15rem .55rem;
    letter-spacing: .05em;
    font-family: monospace;
    margin: .1rem .15rem;
}

.zr-date { color: #64748b; font-size: .8rem; }

.zr-actions { text-align: right; }

.zr-remove-btn {
    background: none;
    border: 1px solid #fca5a5;
    color: #dc2626;
    font-size: .78rem;
    font-weight: 600;
    padding: .25rem .65rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background .15s;
}
.zr-remove-btn:hover { background: #fef2f2; }

.zr-legend {
    padding: .8rem 1.2rem;
    font-size: .8rem;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    gap: .5rem;
    align-items: flex-start;
}
.zr-legend-icon { flex-shrink: 0; }

.zr-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #64748b;
}
.zr-empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.zr-empty-text { font-weight: 600; font-size: 1rem; color: #64748b; margin-bottom: .35rem; }
.zr-empty-sub  { font-size: .85rem; }

.zr-zip-list { display: flex; flex-wrap: wrap; gap: .2rem; }
.zr-no-zips  { color: #64748b; font-size: .82rem; font-style: italic; }
.zr-count-cell { text-align: center; font-weight: 700; color: #475569; }

/* =========================================================
   Inspector Scorecard — Performance Table additions
   ========================================================= */

.ip-jobcount {
    font-size: .72rem;
    color: #64748b;
    margin-top: .15rem;
}

.ip-star-row {
    display: flex;
    justify-content: center;
    gap: .05rem;
    font-size: 1.1rem;
    line-height: 1;
}
.ip-star-on  { color: #f59e0b; }
.ip-star-off { color: #e2e8f0; }

.ip-rating-sub {
    font-size: .72rem;
    color: #64748b;
    margin-top: .2rem;
    text-align: center;
}

/* Quality badge */
.qs-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 20px;
    letter-spacing: .03em;
    white-space: nowrap;
}
.qs-excellent { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.qs-good      { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.qs-fair      { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.qs-poor      { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Larger badge for scorecard */
.qs-lg { font-size: .9rem; padding: .3rem .85rem; }

/* =========================================================
   Inspector Personal Scorecard (my_stats)
   ========================================================= */

.my-scorecard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.my-sc-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.2rem 1rem 1rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.my-sc-val {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
    margin-bottom: .4rem;
}
.my-sc-val.my-sc-empty { color: #cbd5e1; }

.my-sc-stars {
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    gap: .05rem;
}
.my-star-on  { color: #f59e0b; }
.my-star-off { color: #e2e8f0; }

.my-sc-fast { color: #15803d; }
.my-sc-ok   { color: #0369a1; }
.my-sc-slow { color: #dc2626; }

.my-sc-lbl {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    margin-bottom: .25rem;
}
.my-sc-sub {
    font-size: .75rem;
    color: #64748b;
}

/* =========================================================
   Inspection Detail — Customer Rating setter
   ========================================================= */

.id-rating-bar {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.id-rating-lbl {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .85rem;
    font-weight: 600;
    color: #475569;
}
.id-current-rating { font-size: .82rem; color: #64748b; font-weight: 400; }
.id-rating-unset   { font-size: .78rem; color: #64748b; font-weight: 400; font-style: italic; }
.id-star-on  { color: #f59e0b; }
.id-star-off { color: #e2e8f0; }

.id-rating-form {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.id-star-setter {
    display: flex;
    gap: .1rem;
}
.id-star-opt { cursor: pointer; }
.id-star-opt input { display: none; }
.id-star-ico {
    font-size: 1.5rem;
    color: #e2e8f0;
    transition: color .12s, transform .1s;
    display: inline-block;
}
.id-star-opt:hover .id-star-ico,
.id-star-ico.id-star-on {
    color: #f59e0b;
    transform: scale(1.1);
}

.id-rating-btns { display: flex; gap: .4rem; }

.id-rating-link-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.id-rating-link-lbl  { font-size: .78rem; color: #64748b; white-space: nowrap; }
.id-rating-link-code {
    font-size: .72rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: .2rem .5rem;
    color: #334155;
    font-family: monospace;
    word-break: break-all;
}
.id-copy-btn {
    font-size: .72rem;
    padding: .2rem .6rem;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.id-copy-btn:hover { background: #f1f5f9; }

/* =========================================================
   Public Customer Rating Page
   ========================================================= */

.rate-page-body {
    min-height: 100vh;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.rate-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.1);
    padding: 2.5rem 2rem 2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.rate-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1.25rem;
}

.rate-vehicle {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.rate-customer { font-size: .85rem; font-weight: 400; color: #64748b; }

/* Thank-you / already-rated state */
.rate-thank { padding: 1rem 0; }
.rate-thank-stars {
    font-size: 2.5rem;
    color: #f59e0b;
    display: flex;
    justify-content: center;
    gap: .1rem;
    margin-bottom: 1rem;
}
.rate-star-on  { color: #f59e0b; }
.rate-star-off { color: #e2e8f0; }
.rate-thank-msg { font-size: 1.2rem; font-weight: 700; color: #1e293b; margin-bottom: .5rem; }
.rate-thank-sub { font-size: .88rem; color: #64748b; }

/* Rating form */
.rate-heading { font-size: 1.15rem; font-weight: 700; color: #1e293b; margin-bottom: .4rem; }
.rate-sub     { font-size: .88rem; color: #64748b; margin-bottom: 1.5rem; }
.rate-error   { color: #dc2626; font-size: .85rem; margin-bottom: 1rem; }

.rate-form { display: flex; flex-direction: column; align-items: center; gap: 1rem; }

.rate-stars-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.rate-stars-legend {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.rate-stars-row {
    display: flex;
    gap: .4rem;
    font-size: 3rem;
    cursor: pointer;
}
.rate-star-label { cursor: pointer; }
.rate-star-label input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
}
.rate-star-ico {
    display: block;
    color: #e2e8f0;
    transition: color .12s, transform .12s;
    user-select: none;
}
.rate-star-label input:focus-visible + .rate-star-ico {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
    border-radius: 4px;
}
.rate-star-ico:hover,
.rate-star-ico.rate-star-on { color: #f59e0b; transform: scale(1.15); }
.rate-star-ico.rate-star-off { color: #e2e8f0; transform: none; }

.rate-hint-text {
    font-size: .85rem;
    color: #64748b;
    min-height: 1.2rem;
    transition: color .15s;
}

.rate-submit-btn {
    background: #2563eb;
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    padding: .75rem 2.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    margin-top: .5rem;
}
.rate-submit-btn:hover { background: #1d4ed8; }

/* =========================================================
   Inspection Checklist Card
   ========================================================= */

.cl-card { padding-bottom: 1.25rem; }

.cl-hd-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.cl-score-pill {
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .7rem;
    border-radius: 20px;
    white-space: nowrap;
}
.cl-score-done { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.cl-score-good { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.cl-score-fair { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.cl-score-low  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.cl-bar-wrap { margin: .75rem 0 1rem; }
.cl-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.cl-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .4s ease;
}
.cl-bar-done { background: #22c55e; }
.cl-bar-good { background: #3b82f6; }
.cl-bar-fair { background: #f59e0b; }
.cl-bar-low  { background: #ef4444; }

.cl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .1rem 1rem;
}
@media (max-width: 600px) { .cl-list { grid-template-columns: 1fr; } }

.cl-item {
    border-radius: 6px;
    transition: background .15s;
}
.cl-item-done .cl-text { color: #64748b; }
.cl-item-done .cl-icon { color: #22c55e; }

.cl-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .5rem;
    cursor: pointer;
    border-radius: 6px;
    user-select: none;
}
.cl-label:hover { background: #f8fafc; }

.cl-check { width: 16px; height: 16px; flex-shrink: 0; accent-color: #2563eb; cursor: pointer; }
.cl-icon   { font-size: 1rem; width: 1.1rem; text-align: center; color: #cbd5e1; flex-shrink: 0; transition: color .15s; }
.cl-text   { font-size: .84rem; color: #334155; transition: color .15s; }

.cl-status {
    font-size: .75rem;
    margin-top: .75rem;
    padding: .25rem .5rem;
    border-radius: 5px;
    display: inline-block;
    min-height: 1.4rem;
    transition: opacity .3s;
}
.cl-saving   { background: #fef9c3; color: #92400e; }
.cl-saved    { background: #dcfce7; color: #166534; }
.cl-save-err { background: #fee2e2; color: #991b1b; }

/* =========================================================
   Audit Panel (Inspection Detail page)
   ========================================================= */

.audit-panel { }

.audit-panel-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.audit-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .65rem;
    border-radius: 20px;
    letter-spacing: .02em;
}
.audit-pending { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.audit-pass    { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.audit-fail    { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.audit-none    { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

.audit-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .75rem 0;
    font-size: .82rem;
}
.audit-meta-lbl { color: #64748b; font-weight: 600; }
.audit-meta-val { color: #334155; }
.audit-notes-disp {
    width: 100%;
    padding: .5rem .75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .82rem;
    color: #475569;
    font-style: italic;
}

.audit-result-form { margin-top: .75rem; display: flex; flex-direction: column; gap: .6rem; }
.audit-notes-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: .5rem .75rem;
    font-size: .82rem;
    color: #334155;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}
.audit-notes-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

.audit-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.audit-pass-btn { background: #dcfce7 !important; color: #166534 !important; border-color: #86efac !important; }
.audit-pass-btn:hover { background: #bbf7d0 !important; }
.audit-fail-btn { background: #fee2e2 !important; color: #991b1b !important; border-color: #fca5a5 !important; }
.audit-fail-btn:hover { background: #fecaca !important; }

.audit-empty {
    font-size: .84rem;
    color: #64748b;
    font-style: italic;
    margin: .5rem 0 .75rem;
}

/* =========================================================
   Audit Queue (Dashboard)
   ========================================================= */

.audit-queue-card { }

.audit-queue-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.audit-run-form {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.audit-count-sel {
    font-size: .82rem;
    padding: .3rem .5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #334155;
}

.audit-table-wrap { overflow-x: auto; margin-top: 1rem; }
.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}
.audit-th {
    padding: .6rem .75rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.audit-th-c { text-align: center; }

.audit-row { border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.audit-row:hover { background: #f8fafc; }
.audit-row-pass { background: #f0fdf4; }
.audit-row-pass:hover { background: #dcfce7; }
.audit-row-fail { background: #fef2f2; }
.audit-row-fail:hover { background: #fee2e2; }

.audit-td { padding: .65rem .75rem; vertical-align: middle; color: #334155; }
.audit-td-c { text-align: center; }

.audit-insp-link {
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    font-size: .84rem;
}
.audit-insp-link:hover { text-decoration: underline; }
.audit-cust { font-size: .75rem; color: #64748b; margin-top: .15rem; }
.audit-insp-name { font-weight: 500; }
.audit-notes-td { color: #64748b; font-style: italic; max-width: 200px; }

.audit-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
}
.audit-empty-ico  { font-size: 2.5rem; margin-bottom: .75rem; opacity: .4; }
.audit-empty-msg  { font-size: .95rem; font-weight: 600; color: #475569; margin-bottom: .35rem; }
.audit-empty-sub  { font-size: .82rem; color: #64748b; }

/* =========================================================
   Inspector Perf Table — Checklist Avg column
   ========================================================= */

.ip-cl-bar-wrap { margin: .25rem 0; }
.ip-cl-bar {
    width: 64px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin: 0 auto;
}
.ip-cl-fill { height: 100%; border-radius: 999px; }
.ip-cl-done { background: #22c55e; }
.ip-cl-good { background: #3b82f6; }
.ip-cl-fair { background: #f59e0b; }
.ip-cl-low  { background: #ef4444; }

/* =========================================================
   Territory Score System
   ========================================================= */

/* Status badges */
.ts-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    padding: .22rem .65rem;
    border-radius: 20px;
    letter-spacing: .02em;
    white-space: nowrap;
}
.ts-healthy       { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.ts-at-risk       { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.ts-underperformer{ background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.ts-provisional   { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }

/* Row highlighting in tables */
.ts-row-danger { background: #fff5f5; }
.ts-row-danger:hover { background: #fee2e2 !important; }
.ts-row-risk   { background: #fffbeb; }
.ts-row-risk:hover   { background: #fef9c3 !important; }

/* Score bar in ZIP Routes page */
.ts-score-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    justify-content: center;
}
.ts-score-bar {
    width: 72px;
    height: 7px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.ts-score-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .4s ease;
}
.ts-healthy-fill       { background: #22c55e; }
.ts-at-risk-fill       { background: #f59e0b; }
.ts-underperformer-fill{ background: #ef4444; }
.ts-provisional-fill   { background: #94a3b8; }
.ts-score-num { font-size: .8rem; color: #64748b; font-weight: 600; white-space: nowrap; }

/* Alert banners */
.ts-alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: 8px;
    font-size: .84rem;
    line-height: 1.5;
    border: 1px solid;
}
.ts-alert-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #7f1d1d;
}
.ts-alert-warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #78350f;
}
.ts-alert-ico { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.ts-alert-body { flex: 1; }

/* Quick-remove buttons */
.ts-remove-danger-btn {
    font-size: .78rem;
    font-weight: 700;
    padding: .35rem .85rem;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    background: #fee2e2;
    color: #991b1b;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.ts-remove-danger-btn:hover { background: #fecaca; }

.ts-remove-btn {
    font-size: .78rem;
    padding: .3rem .75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.ts-remove-btn:hover { background: #f1f5f9; }

.ts-remove-sm-btn {
    font-size: .72rem;
    font-weight: 700;
    padding: .25rem .6rem;
    border: 1px solid #fca5a5;
    border-radius: 5px;
    background: #fee2e2;
    color: #991b1b;
    cursor: pointer;
    white-space: nowrap;
}
.ts-remove-sm-btn:hover { background: #fecaca; }

/* Inspector sub-label in territory table */
.ts-insp-name { font-weight: 600; font-size: .87rem; color: #1e293b; }
.ts-insp-sub  { font-size: .73rem; color: #64748b; margin-top: .1rem; }

/* ZIP Routes table center columns */
.zr-th-c  { text-align: center; }
.zr-td-c  { text-align: center; vertical-align: middle; padding: .75rem .5rem; }

/* =========================================================
   Admin Territories Page
   ========================================================= */

/* Page header */
.section-header { margin-bottom: 1.5rem; }

/* ── Banner / report header overrides — all blue banners → black ───────── */
.report-banner,
.section-header,
.pdf-header,
.email-header,
.email-banner,
.email-section-title,
.report-title-bar,
.report-footer-bar {
  background-color: #000000 !important;
  color: #FFFFFF !important;
}

.report-banner *,
.section-header *,
.pdf-header *,
.email-header *,
.email-banner *,
.email-section-title *,
.report-title-bar *,
.report-footer-bar * {
  color: #FFFFFF !important;
}

.report-banner small,
.section-header small,
.pdf-header small,
.email-header small,
.email-banner small {
  color: #E5E5E5 !important;
}

.section-header,
.report-banner,
.email-section-title {
  border-bottom: 1px solid #333333 !important;
}
.section-title  { font-size: 1.35rem; font-weight: 700; color: #1e293b; margin: 0 0 .3rem; }
.section-sub    { font-size: .85rem; color: #64748b; margin: 0; }

/* Create panel */
.terr-create-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}
.terr-create-title {
  font-size: .92rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 1rem;
  letter-spacing: .01em;
}
.terr-create-form { }
.terr-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
}
.terr-form-col         { flex: 1; min-width: 140px; }
.terr-form-col-wide    { flex: 2; min-width: 220px; }
.terr-form-col-btn     { flex: 0 0 auto; }
.terr-form-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.terr-req { color: #ef4444; }
.terr-form-input,
.terr-form-select {
  width: 100%;
  box-sizing: border-box;
  padding: .55rem .75rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: .9rem;
  background: #fff;
  color: #1e293b;
  outline: none;
  transition: border-color .15s;
}
.terr-form-input:focus,
.terr-form-select:focus { border-color: #3b82f6; }
.terr-create-btn {
  padding: .6rem 1.35rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.terr-create-btn:hover { background: #1d4ed8; }

/* Count bar */
.terr-count-bar {
  font-size: .82rem;
  color: #64748b;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* Empty state */
.terr-empty {
  text-align: center;
  padding: 3.5rem 2rem;
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.terr-empty-icon  { font-size: 2.5rem; margin-bottom: .75rem; }
.terr-empty-title { font-size: 1.05rem; font-weight: 700; color: #334155; margin-bottom: .4rem; }
.terr-empty-sub   { font-size: .87rem; color: #64748b; }

/* Territory cards grid */
.terr-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 1.25rem;
}
@media (max-width: 640px) { .terr-cards { grid-template-columns: 1fr; } }

.terr-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.35rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: box-shadow .2s;
}
.terr-card:hover       { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.terr-card-danger      { border-color: #fca5a5; background: #fff8f8; }
.terr-card-warn        { border-color: #fde68a; background: #fffdf0; }

/* Card header */
.terr-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.terr-card-header-left { flex: 1; }
.terr-card-header-right { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; }
.terr-card-name  { font-size: 1.05rem; font-weight: 700; color: #1e293b; }
.terr-card-desc  { font-size: .8rem; color: #64748b; margin-top: .15rem; }

.terr-edit-toggle-btn {
  font-size: .78rem;
  padding: .3rem .7rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}
.terr-edit-toggle-btn:hover { background: #e2e8f0; }
.terr-delete-btn {
  font-size: .78rem;
  padding: .3rem .7rem;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
  cursor: pointer;
  white-space: nowrap;
}
.terr-delete-btn:hover { background: #fecaca; }

/* Inspector assignment row */
.terr-card-inspector {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .65rem .85rem;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .85rem;
}
.terr-insp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.terr-insp-name    { font-weight: 600; color: #1e293b; }
.terr-insp-unassigned { color: #64748b; font-style: italic; }
.terr-score-num { font-size: .78rem; color: #64748b; font-weight: 600; }
.terr-score-bar {
  width: 60px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.terr-score-fill {
  height: 100%;
  border-radius: 999px;
}
.ts-healthy-fill       { background: #22c55e; }
.ts-at-risk-fill       { background: #f59e0b; }
.ts-underperformer-fill{ background: #ef4444; }
.ts-provisional-fill   { background: #94a3b8; }

.terr-unassign-btn {
  font-size: .75rem;
  padding: .25rem .65rem;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}
.terr-unassign-btn:hover { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

.terr-assign-form   { display: flex; gap: .5rem; align-items: center; flex: 1; }
.terr-assign-select { padding: .35rem .6rem; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .82rem; flex: 1; }
.terr-assign-btn    {
  padding: .35rem .8rem;
  background: #2563eb; color: #fff;
  border: none; border-radius: 6px;
  font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.terr-assign-btn:hover { background: #1d4ed8; }

/* Performance alert within card */
.terr-perf-alert {
  font-size: .82rem;
  padding: .55rem .8rem;
  border-radius: 7px;
  margin-bottom: .85rem;
  line-height: 1.45;
}
.terr-perf-alert-danger { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }
.terr-perf-alert-warn   { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }

/* ZIP codes section */
.terr-zips-section { margin-top: .5rem; }
.terr-zips-label {
  font-size: .73rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .55rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.terr-zip-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 .4rem;
  background: #e2e8f0;
  color: #475569;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 999px;
}
.terr-zips-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.terr-zip-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .28rem .6rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: #1d4ed8;
  white-space: nowrap;
}
.terr-zip-remove {
  background: none;
  border: none;
  color: #93c5fd;
  font-size: .85rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color .1s;
}
.terr-zip-remove:hover { color: #ef4444; }
.terr-zip-empty { font-size: .82rem; color: #cbd5e1; font-style: italic; }

.terr-add-zip-form {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.terr-add-zip-input {
  width: 130px;
  padding: .42rem .7rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: .88rem;
  letter-spacing: .05em;
}
.terr-add-zip-input:focus { outline: none; border-color: #3b82f6; }
.terr-add-zip-btn {
  padding: .42rem .9rem;
  background: #f0f9ff;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
  color: #0369a1;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.terr-add-zip-btn:hover { background: #e0f2fe; }

/* Inline edit form */
.terr-edit-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.terr-edit-inner { }

/* =========================================================
   Inspector Dashboard — My Territory Widget
   ========================================================= */

.my-territory-wrap {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.5rem;
}
.my-territory-wrap.my-territory-none {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
  font-size: .87rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.my-territory-header {
  font-size: .8rem;
  font-weight: 700;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .85rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.my-territory-icon { font-size: 1rem; }
.my-territory-card {
  background: #fff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: .85rem 1rem;
  margin-bottom: .7rem;
}
.my-territory-card:last-child { margin-bottom: 0; }
.my-territory-name { font-size: .97rem; font-weight: 700; color: #1e293b; margin-bottom: .2rem; }
.my-territory-desc { font-size: .8rem; color: #64748b; margin-bottom: .55rem; }
.my-territory-zips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .45rem; }
.my-territory-zip {
  display: inline-block;
  padding: .22rem .55rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  font-size: .8rem;
  font-weight: 600;
  color: #1d4ed8;
}
.my-territory-zip-empty { font-size: .82rem; color: #cbd5e1; font-style: italic; }
.my-territory-sub  { font-size: .75rem; color: #64748b; }

/* =========================================================
   ZIP Code Routing Page — Enhanced Schema
   ========================================================= */

.zr-page-title { font-size: 1.3rem; font-weight: 700; color: #1e293b; margin: 0 0 .3rem; }
.zr-page-sub   { font-size: .85rem; color: #64748b; margin: 0 0 1.5rem; line-height: 1.5; }
.zr-page-sub a { color: #2563eb; }

/* Add panel */
.zr-add-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.75rem;
}
.zr-add-title {
  font-size: .88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: .9rem;
}
.zr-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: flex-end;
}
.zr-add-col       { flex: 1; min-width: 120px; }
.zr-add-col-sm    { flex: 0 0 76px; }
.zr-add-col-check { flex: 0 0 90px; }
.zr-add-col-btn   { flex: 0 0 auto; }
.zr-add-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .28rem;
}
.zr-add-input,
.zr-add-select {
  width: 100%;
  box-sizing: border-box;
  padding: .5rem .65rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: .88rem;
  background: #fff;
  color: #1e293b;
  outline: none;
}
.zr-add-input:focus, .zr-add-select:focus { border-color: #3b82f6; }
.zr-add-zip { font-family: monospace; font-size: .95rem; letter-spacing: .06em; width: 100%; }
.zr-add-num { text-align: center; }
.zr-toggle-wrap { display: flex; align-items: center; gap: .4rem; padding-top: .4rem; }
.zr-toggle-check { width: 16px; height: 16px; cursor: pointer; }
.zr-toggle-txt  { font-size: .85rem; color: #475569; }
.zr-add-btn {
  padding: .55rem 1.2rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.zr-add-btn:hover { background: #1d4ed8; }

/* Table wrap */
.zr-table-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.zr-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.zr-table-title { font-size: .92rem; font-weight: 700; color: #1e293b; }
.zr-table-count { font-size: .8rem; color: #64748b; font-weight: 500; }
.zr-table-link  { font-size: .82rem; color: #2563eb; text-decoration: none; font-weight: 600; }
.zr-table-link:hover { text-decoration: underline; }

.zr-empty {
  padding: 2rem;
  text-align: center;
  font-size: .87rem;
  color: #64748b;
}
.zr-hint {
  padding: .55rem 1.1rem;
  font-size: .78rem;
  color: #64748b;
  background: #fffbeb;
  border-bottom: 1px solid #fef9c3;
}

/* Table */
.zr-table { width: 100%; border-collapse: collapse; }
.zr-th {
  padding: .65rem 1rem;
  font-size: .72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  text-align: left;
}
.zr-th-c { text-align: center; }
.zr-td   { padding: .7rem 1rem; font-size: .87rem; color: #1e293b; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.zr-td-c { text-align: center; }
.zr-td-date { color: #64748b; font-size: .78rem; }

/* Row states */
.zr-row:hover { background: #f8fafc; }
.zr-row-overlap { background: #fffbeb; }
.zr-row-overlap:hover { background: #fef9c3 !important; }
.zr-row-inactive { opacity: .5; }
.zr-row-inactive:hover { opacity: .7; }

/* ZIP cell */
.zr-td-zip { vertical-align: top; padding-top: .9rem; }
.zr-zip-code {
  display: block;
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #1d4ed8;
}
.zr-overlap-badge {
  display: inline-block;
  margin-top: .2rem;
  padding: .15rem .45rem;
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 5px;
  font-size: .7rem;
  font-weight: 700;
  color: #78350f;
  white-space: nowrap;
}

/* City/State */
.zr-city { font-weight: 500; color: #1e293b; }
.zr-state-sep { color: #64748b; }
.zr-state { font-weight: 600; color: #475569; }
.zr-city-empty { color: #cbd5e1; font-style: italic; }

/* Inspector cell */
.zr-insp-name  { font-weight: 600; color: #1e293b; font-size: .87rem; }
.zr-insp-badge { font-size: .7rem; margin-top: .15rem; display: inline-block; }

/* Priority inline edit */
.zr-priority-form {
  display: flex;
  align-items: center;
  gap: .3rem;
  justify-content: center;
}
.zr-priority-input {
  width: 46px;
  padding: .3rem .35rem;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: .88rem;
  text-align: center;
  outline: none;
}
.zr-priority-input:focus { border-color: #3b82f6; }
.zr-priority-btn {
  width: 24px;
  height: 24px;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 5px;
  color: #166534;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.zr-priority-btn:hover { background: #bbf7d0; }

/* Active toggle button */
.zr-active-btn {
  font-size: .75rem;
  font-weight: 700;
  padding: .28rem .7rem;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.zr-active-btn:hover { opacity: .8; }
.zr-active-on  { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.zr-active-off { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }

/* Remove button */
.zr-remove-btn {
  font-size: .75rem;
  font-weight: 600;
  padding: .28rem .65rem;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  background: #fee2e2;
  color: #991b1b;
  cursor: pointer;
  white-space: nowrap;
}
.zr-remove-btn:hover { background: #fecaca; }

/* ================================================================
   Inspector Profile Page (inspector_profile.html)
   ================================================================ */

/* ── Page Header ──────────────────────────────────────────────── */
.ip-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  background: #fff; border-radius: 12px; border: 1px solid #e2e8f0;
  padding: 1.5rem; margin-bottom: 1.25rem;
}
.ip-page-header-left { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.ip-page-header-right { display: flex; align-items: center; gap: .6rem; }

.ip-back-link {
  display: block; color: #6366f1; text-decoration: none; font-size: .85rem;
  padding: .35rem .7rem; border: 1px solid #c7d2fe; border-radius: 8px;
  background: #f0f0ff; transition: background .15s;
}
.ip-back-link:hover { background: #e0e7ff; }

.ip-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem; font-weight: 700;
  flex-shrink: 0;
}
.ip-title-block { display: flex; flex-direction: column; gap: .2rem; }
.ip-name  { font-size: 1.3rem; font-weight: 700; color: #1e293b; }
.ip-username { font-size: .85rem; color: #64748b; }
.ip-status-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .15rem; }

.ip-status-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .6rem; border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.ip-status-active   { background: #dcfce7; color: #15803d; }
.ip-status-inactive { background: #f1f5f9; color: #64748b; }

.ip-role-badge {
  background: #ede9fe; color: #6d28d9; padding: .18rem .55rem;
  border-radius: 20px; font-size: .73rem; font-weight: 600;
}

.ip-edit-toggle-btn {
  padding: .5rem 1.1rem; border-radius: 8px; font-size: .85rem; font-weight: 600;
  background: #6366f1; color: #fff; border: none; cursor: pointer; transition: background .15s;
}
.ip-edit-toggle-btn:hover { background: #4f46e5; }

/* ── Stats Row ───────────────────────────────────────────────── */
.ip-stats-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) { .ip-stats-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .ip-stats-row { grid-template-columns: repeat(2, 1fr); } }

.ip-stat-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: .9rem; text-align: center;
}
.ip-stat-val  { font-size: 1.5rem; font-weight: 700; color: #1e293b; line-height: 1; margin-bottom: .2rem; }
.ip-stat-lbl  { font-size: .75rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ip-stat-sub  { font-size: .72rem; color: #64748b; margin-top: .2rem; }
.ip-stat-empty { color: #cbd5e1; }
.ip-stat-stars { display: flex; justify-content: center; gap: .15rem; font-size: 1.15rem; }
.ip-star-on  { color: #f59e0b; }
.ip-star-off { color: #e2e8f0; }
.ip-stat-fast { color: #16a34a; }
.ip-stat-ok   { color: #d97706; }
.ip-stat-slow { color: #dc2626; }
.ip-territory-badge { font-size: .8rem; }

/* ── Body layout ─────────────────────────────────────────────── */
.ip-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start;
}
@media (max-width: 800px) { .ip-body { grid-template-columns: 1fr; } }
.ip-left  { display: flex; flex-direction: column; gap: 1rem; }
.ip-right { display: flex; flex-direction: column; gap: 1rem; }

/* ── Section card ────────────────────────────────────────────── */
.ip-section {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 1.1rem;
}
.ip-section-title {
  font-size: .85rem; font-weight: 700; color: #475569; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: .85rem; display: flex; justify-content: space-between;
  align-items: center;
}
.ip-section-link { font-size: .78rem; color: #6366f1; text-decoration: none; text-transform: none; font-weight: 600; }
.ip-section-link:hover { text-decoration: underline; }
.ip-empty-note  { font-size: .84rem; color: #64748b; padding: .4rem 0; }
.ip-link { color: #6366f1; text-decoration: none; }
.ip-link:hover { text-decoration: underline; }

/* ── Info grid ───────────────────────────────────────────────── */
.ip-info-grid  { display: flex; flex-direction: column; gap: .55rem; }
.ip-info-row   { display: flex; gap: .75rem; align-items: flex-start; }
.ip-info-lbl   { flex-shrink: 0; width: 9rem; font-size: .8rem; color: #64748b; font-weight: 600; }
.ip-info-val   { font-size: .86rem; color: #1e293b; }

/* ── Territory chips ─────────────────────────────────────────── */
.ip-terr-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.ip-terr-chip {
  display: flex; align-items: center; gap: .5rem;
  background: #f0f0ff; border: 1px solid #c7d2fe; border-radius: 20px;
  padding: .3rem .75rem;
}
.ip-terr-name { font-size: .83rem; font-weight: 600; color: #4f46e5; }
.ip-terr-zips { font-size: .73rem; color: #6366f1; }

/* ── ZIP table ───────────────────────────────────────────────── */
.ip-zip-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.ip-zip-th    { text-align: left; padding: .4rem .5rem; color: #64748b; font-weight: 600;
                font-size: .73rem; text-transform: uppercase; letter-spacing: .04em;
                border-bottom: 1px solid #e2e8f0; }
.ip-zip-th-c  { text-align: center; }
.ip-zip-td    { padding: .4rem .5rem; border-bottom: 1px solid #f1f5f9; color: #1e293b; }
.ip-zip-td-c  { text-align: center; }
.ip-zip-code  { font-weight: 700; font-family: monospace; color: #4f46e5; }
.ip-zip-inactive { opacity: .5; }
.ip-zip-active      { font-size: .75rem; color: #16a34a; font-weight: 600; }
.ip-zip-inactive-lbl { font-size: .75rem; color: #64748b; }

/* ── Edit section ────────────────────────────────────────────── */
.ip-edit-section { border-color: #c7d2fe; background: #f5f5ff; }
.ip-edit-form    { display: flex; flex-direction: column; gap: .75rem; }
.ip-field        { display: flex; flex-direction: column; gap: .3rem; }
.ip-field-lbl    { font-size: .8rem; font-weight: 600; color: #475569; }
.ip-field-hint   { font-weight: 400; color: #64748b; font-size: .73rem; }
.ip-field-input  {
  padding: .45rem .7rem; border-radius: 7px; border: 1px solid #c7d2fe;
  font-size: .88rem; color: #1e293b; background: #fff; outline: none;
  width: 100%; box-sizing: border-box;
}
.ip-field-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.ip-field-select { padding: .43rem .7rem; border-radius: 7px; border: 1px solid #c7d2fe;
                   font-size: .88rem; color: #1e293b; background: #fff; width: 100%; }
.ip-field-num    { max-width: 120px; }
.ip-field-actions { display: flex; gap: .6rem; margin-top: .25rem; }
.ip-save-btn {
  padding: .5rem 1.3rem; background: #6366f1; color: #fff; border: none;
  border-radius: 8px; cursor: pointer; font-size: .88rem; font-weight: 600;
}
.ip-save-btn:hover { background: #4f46e5; }
.ip-cancel-btn {
  padding: .5rem 1rem; background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  border-radius: 8px; cursor: pointer; font-size: .88rem;
}
.ip-cancel-btn:hover { background: #e2e8f0; }

/* ── Recent inspections list ─────────────────────────────────── */
.ip-recent-list { display: flex; flex-direction: column; gap: .5rem; }
.ip-recent-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: .75rem; padding: .6rem .75rem; border-radius: 8px; background: #f8fafc;
  border: 1px solid #e2e8f0; text-decoration: none; transition: background .15s;
  flex-wrap: wrap;
}
.ip-recent-item:hover { background: #f0f0ff; border-color: #c7d2fe; }
.ip-recent-main { display: flex; flex-direction: column; gap: .1rem; }
.ip-recent-name    { font-size: .86rem; font-weight: 600; color: #1e293b; }
.ip-recent-vehicle { font-size: .78rem; color: #64748b; }
.ip-recent-right   { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ip-recent-rating  { font-size: .78rem; color: #f59e0b; font-weight: 700; }
.ip-recent-date    { font-size: .75rem; color: #64748b; }

/* ================================================================
   Admin Users page — new profile-field styles
   ================================================================ */
.um-th-c   { text-align: center; }
.um-td-c   { text-align: center; }

.um-profile-link {
  color: #6366f1; text-decoration: none; font-weight: 700;
}
.um-profile-link:hover { text-decoration: underline; }

.um-display-name  { font-weight: 600; font-size: .86rem; color: #1e293b; }
.um-contact-line  { font-size: .78rem; color: #64748b; margin-top: .1rem; }
.um-contact-link  { color: #6366f1; text-decoration: none; }
.um-contact-link:hover { text-decoration: underline; }
.um-no-contact    { color: #cbd5e1; font-size: .82rem; }
.um-limit-note    { font-size: .72rem; color: #64748b; margin-top: .2rem; }

.um-profile-btn {
  display: inline-block; padding: .3rem .65rem; border-radius: 7px; font-size: .78rem;
  font-weight: 600; background: #f0f0ff; color: #6366f1; border: 1px solid #c7d2fe;
  text-decoration: none; cursor: pointer; transition: background .15s; white-space: nowrap;
}
.um-profile-btn:hover { background: #e0e7ff; }

.um-row-inactive { opacity: .65; }

.um-modal-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .25rem;
}
@media (max-width: 540px) { .um-modal-row { grid-template-columns: 1fr; } }

/* ================================================================
   Public Booking Pages  (book_inspection.html / _success.html)
   ================================================================ */

/* ── Page shell ──────────────────────────────────────────────── */
.bk-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #0f172a 0%, #1a3a5c 60%, #1e5fa8 100%);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 2rem 1rem 3rem;
  box-sizing: border-box;
}
.bk-wrap {
  width: 100%; max-width: 680px;
  display: flex; flex-direction: column; gap: 1.25rem;
}

/* ── Brand header ─────────────────────────────────────────────── */
.bk-brand {
  display: flex; align-items: center; gap: .85rem; padding: .25rem 0;
}
.bk-brand-logo {
  font-size: 2rem; line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}
.bk-brand-name    { font-size: 1.05rem; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.bk-brand-tagline { font-size: .8rem;  color: #94b8d8; font-style: italic; }

/* ── Main card ────────────────────────────────────────────────── */
.bk-card {
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
  overflow: hidden;
}
.bk-card-hd {
  background: linear-gradient(135deg, #1a3a5c 0%, #1e5fa8 100%);
  padding: 1.75rem 2rem 1.5rem;
}
.bk-title    { margin: 0 0 .4rem; font-size: 1.55rem; font-weight: 800; color: #fff; }
.bk-subtitle { margin: 0; font-size: .92rem; color: #94b8d8; line-height: 1.55; }

/* ── Form body ────────────────────────────────────────────────── */
.bk-form { padding: 1.75rem 2rem 2rem; }

@media (max-width: 540px) {
  .bk-card-hd { padding: 1.4rem 1.25rem 1.2rem; }
  .bk-form     { padding: 1.25rem; }
  .bk-title    { font-size: 1.25rem; }
}

/* ── Section labels ───────────────────────────────────────────── */
.bk-section-label {
  font-size: .73rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .07em;
  margin: 1.4rem 0 .7rem; border-bottom: 1px solid #f1f5f9; padding-bottom: .4rem;
}
.bk-form .bk-section-label:first-child { margin-top: 0; }
.bk-vehicle-hint {
  font-size: .82rem; color: #64748b; margin: -.4rem 0 .75rem;
}
.bk-or-divider {
  text-align: center; font-size: .8rem; color: #64748b;
  margin: .1rem 0 .75rem; letter-spacing: .05em;
}
.bk-opt {
  font-size: .75rem; font-weight: 400; color: #64748b; margin-left: .2rem;
}
.bk-field-err {
  color: #dc2626; font-size: .82rem; margin: .2rem 0 .5rem;
}

/* ── Field rows ───────────────────────────────────────────────── */
.bk-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin-bottom: .85rem;
}
.bk-row-three { grid-template-columns: 1fr 1fr 1fr; }
.bk-field-full { grid-column: 1 / -1; }
.bk-field-zip  { min-width: 140px; max-width: 200px; }
.bk-field-grow { flex: 1; }

@media (max-width: 540px) {
  .bk-row, .bk-row-three { grid-template-columns: 1fr; }
  .bk-field-zip { max-width: 100%; }
}

/* ── Labels & inputs ──────────────────────────────────────────── */
.bk-label    { display: block; font-size: .8rem; font-weight: 600; color: #475569; margin-bottom: .3rem; }
.bk-required { color: #ef4444; }

.bk-input, .bk-textarea {
  width: 100%; box-sizing: border-box;
  padding: .6rem .8rem; border-radius: 9px;
  border: 1.5px solid #e2e8f0; font-size: .93rem; color: #1e293b;
  background: #f8fafc; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.bk-input:focus, .bk-textarea:focus {
  border-color: #1e5fa8; background: #fff;
  box-shadow: 0 0 0 3px rgba(30,95,168,.12);
}
.bk-input-err { border-color: #ef4444; background: #fff5f5; }
.bk-input-zip { font-size: 1.1rem; font-weight: 700; letter-spacing: .06em; }
.bk-textarea  { resize: vertical; min-height: 72px; }

/* ── ZIP hint ─────────────────────────────────────────────────── */
.bk-zip-hint { font-size: .78rem; margin-top: .35rem; min-height: 1.1em; }
.bk-zip-ok   { color: #16a34a; font-weight: 600; }
.bk-zip-warn { color: #d97706; }

/* ── Validation errors ────────────────────────────────────────── */
.bk-errors {
  display: flex; gap: .75rem; align-items: flex-start;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px;
  padding: 1rem 1.1rem; margin: 1.25rem 2rem .25rem;
}
.bk-errors-icon   { font-size: 1.25rem; flex-shrink: 0; color: #ef4444; }
.bk-errors-title  { font-size: .88rem; font-weight: 700; color: #991b1b; margin-bottom: .3rem; }
.bk-errors-list   { margin: 0; padding-left: 1.1rem; font-size: .84rem; color: #b91c1c; }
.bk-errors-list li { margin-bottom: .15rem; }

@media (max-width: 540px) {
  .bk-errors { margin: 1rem 1.25rem .1rem; }
}

/* ── Trust bar ────────────────────────────────────────────────── */
.bk-trust {
  display: flex; flex-wrap: wrap; gap: .5rem .9rem;
  margin: 1.25rem 0 1.4rem; padding: .9rem 1rem;
  background: #f0f7ff; border-radius: 10px; border: 1px solid #bfdbfe;
}
.bk-trust-item { font-size: .8rem; color: #1e5fa8; font-weight: 600; }

/* ── Submit button ────────────────────────────────────────────── */
.bk-submit {
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  width: 100%; padding: .9rem 1.5rem; border-radius: 11px;
  background: linear-gradient(135deg, #1a3a5c 0%, #1e5fa8 100%);
  color: #fff; font-size: 1.05rem; font-weight: 700; border: none;
  cursor: pointer; transition: opacity .15s, transform .1s;
  box-shadow: 0 3px 12px rgba(30,95,168,.35);
}
.bk-submit:hover  { opacity: .92; }
.bk-submit:active { transform: scale(.98); }
.bk-submit-icon   { font-size: 1.1rem; }

/* ── Footer note inside form ──────────────────────────────────── */
.bk-footer-note { margin: 1rem 0 0; font-size: .82rem; color: #64748b; text-align: center; }
.bk-link { color: #1e5fa8; text-decoration: none; font-weight: 600; }
.bk-link:hover { text-decoration: underline; }

/* ── Page footer ──────────────────────────────────────────────── */
.bk-page-footer {
  text-align: center; font-size: .78rem; color: rgba(255,255,255,.85);
  padding-bottom: .5rem;
}
.bk-page-footer .bk-link { color: rgba(255,255,255,.6); }

/* ================================================================
   Success page additions
   ================================================================ */
.bk-success-card { padding: 2.5rem 2rem; text-align: center; }

.bk-success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff; font-size: 2rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 18px rgba(22,163,74,.35);
}
.bk-success-title  { font-size: 1.6rem; font-weight: 800; color: #1e293b; margin: 0 0 .6rem; }
.bk-success-body   { font-size: .96rem; color: #64748b; line-height: 1.6; margin: 0 0 1.5rem; }

.bk-success-details {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 1.25rem 1.5rem;
  text-align: left; margin-bottom: 1.5rem;
}
.bk-success-ref {
  font-size: .83rem; color: #64748b; margin-bottom: .9rem;
  padding-bottom: .75rem; border-bottom: 1px solid #e2e8f0;
}

.bk-success-steps  { display: flex; flex-direction: column; gap: .85rem; }
.bk-step           { display: flex; gap: .9rem; align-items: flex-start; }
.bk-step-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #1a3a5c, #1e5fa8);
  color: #fff; font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.bk-step-title { font-size: .88rem; font-weight: 700; color: #1e293b; margin-bottom: .15rem; }
.bk-step-desc  { font-size: .8rem;  color: #64748b; line-height: 1.45; }

.bk-success-actions {
  display: flex; gap: .75rem; justify-content: center;
  flex-wrap: wrap; margin-bottom: 1.25rem;
}
.bk-success-btn-sec {
  padding: .55rem 1.4rem; border-radius: 9px; font-size: .9rem; font-weight: 600;
  border: 1.5px solid #1e5fa8; color: #1e5fa8; background: #f0f7ff;
  text-decoration: none; transition: background .15s;
}
.bk-success-btn-sec:hover { background: #dbeafe; }

.bk-success-contact { font-size: .8rem; color: #64748b; margin: 0; }

@media (max-width: 480px) {
  .bk-success-card { padding: 1.75rem 1.25rem; }
  .bk-success-title { font-size: 1.3rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   INSPECTOR DASHBOARD — role-gated view
═══════════════════════════════════════════════════════════════════════ */

.insp-dash { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* Header */
.insp-dash-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem;
}
.insp-dash-title { font-size: 1.6rem; font-weight: 800; color: #1e293b; margin: 0; }
.insp-dash-sub   { font-size: .95rem; color: #64748b; margin: .2rem 0 0; }
.insp-dash-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Pipeline bar */
.insp-pipeline-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .75rem; margin-bottom: 1.5rem;
}
.insp-pipe-card {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px;
  padding: 1rem .85rem; text-align: center;
  transition: border-color .15s, box-shadow .15s;
  cursor: default;
}
.insp-pipe-card:hover { border-color: #64748b; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.insp-pipe-num { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: .3rem; }
.insp-pipe-lbl { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }

.insp-pipe-all  .insp-pipe-num { color: #1e293b; }
.insp-pipe-lead .insp-pipe-num { color: #d97706; }
.insp-pipe-sched .insp-pipe-num { color: #2563eb; }
.insp-pipe-comp  .insp-pipe-num { color: #16a34a; }
.insp-pipe-done  .insp-pipe-num { color: #7c3aed; }

.insp-pipe-lead  { border-color: #fde68a; background: #fffbeb; }
.insp-pipe-sched { border-color: #bfdbfe; background: #eff6ff; }
.insp-pipe-comp  { border-color: #bbf7d0; background: #f0fdf4; }
.insp-pipe-done  { border-color: #e9d5ff; background: #faf5ff; }

/* Scorecard section label */
.insp-scorecard-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #64748b; margin-bottom: .6rem;
}

/* Jobs section */
.insp-jobs-section { margin-top: 1.5rem; }
.insp-jobs-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .6rem; margin-bottom: .85rem;
}
.insp-jobs-title {
  font-size: 1.05rem; font-weight: 700; color: #1e293b;
}

/* Tab bar */
.insp-tab-bar { display: flex; gap: .4rem; flex-wrap: wrap; }
.insp-tab {
  padding: .35rem .9rem; border-radius: 8px; font-size: .8rem; font-weight: 600;
  border: 1.5px solid #e2e8f0; background: #f8fafc; color: #64748b;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.insp-tab:hover { background: #f1f5f9; border-color: #64748b; color: #1e293b; }
.insp-tab.active { background: #1e3a5c; border-color: #1e3a5c; color: #fff; }
.insp-tab-action.active { background: #d97706; border-color: #d97706; }
.insp-tab-ct {
  background: rgba(255,255,255,.25); border-radius: 20px;
  padding: .05rem .45rem; font-size: .72rem; font-weight: 700;
}
.insp-tab:not(.active) .insp-tab-ct { background: #e2e8f0; color: #475569; }

/* ZIP pill in table */
.insp-zip-pill {
  display: inline-block; padding: .15rem .5rem; border-radius: 6px;
  background: #f1f5f9; color: #475569; font-size: .78rem; font-weight: 600;
  font-family: 'Courier New', monospace;
}

@media (max-width: 640px) {
  .insp-dash-header { flex-direction: column; align-items: flex-start; }
  .insp-pipeline-bar { grid-template-columns: repeat(2, 1fr); }
  .insp-jobs-header { flex-direction: column; align-items: flex-start; }
}

/* Inspector dashboard — job cards (replaces table for mobile-first UX) */
.idash-job-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: .25rem;
}
.idash-job-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.idash-job-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
}
.idash-job-info { flex: 1; min-width: 0; }
.idash-job-name {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}
.idash-job-vehicle {
  font-size: 13px;
  color: #475569;
  margin-bottom: 2px;
}
.idash-job-date {
  font-size: 12px;
  color: #64748b;
}
.idash-job-btns {
  display: flex;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid #f1f5f9;
}
.idash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  touch-action: manipulation;
  flex: 1;
  text-align: center;
  transition: opacity .15s;
  white-space: nowrap;
}
.idash-btn:active { opacity: .8; }
.idash-btn-primary { background: #1e5fa8; color: #fff; }
.idash-btn-primary:hover { background: #1a4f8c; }
.idash-btn-secondary { background: #f1f5f9; color: #334155; border: 1.5px solid #e2e8f0; }
.idash-btn-secondary:hover { background: #e2e8f0; }

/* ═══════════════════════════════════════════════════════════════════
   INSPECTOR LEADERBOARD CARD
═══════════════════════════════════════════════════════════════════════ */

.lb-card { padding: 1.25rem 1.5rem; }

.lb-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.lb-title  { font-size: 1.05rem; font-weight: 700; color: #1e293b; }
.lb-api-link {
  font-size: .75rem; font-weight: 700; color: #1e5fa8;
  background: #eff6ff; border: 1px solid #bfdbfe;
  padding: .25rem .65rem; border-radius: 6px;
  text-decoration: none; transition: background .12s;
  font-family: 'Courier New', monospace;
}
.lb-api-link:hover { background: #dbeafe; }

.lb-table-wrap { overflow-x: auto; }
.lb-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.lb-th {
  padding: .55rem .75rem; text-align: left; font-size: .72rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #64748b; border-bottom: 1.5px solid #e2e8f0; white-space: nowrap;
}
.lb-th-rank { width: 48px; text-align: center; }
.lb-th-c    { text-align: center; }

.lb-row { border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.lb-row:hover { background: #f8fafc; }
.lb-row:last-child { border-bottom: none; }
.lb-row-gold   { background: #fffdf0; }
.lb-row-silver { background: #fafafa; }
.lb-row-bronze { background: #fff8f5; }
.lb-row-gold:hover   { background: #fef9c3; }
.lb-row-silver:hover { background: #f1f5f9; }
.lb-row-bronze:hover { background: #fff1ec; }

.lb-td { padding: .7rem .75rem; vertical-align: middle; }
.lb-td-rank { text-align: center; }
.lb-td-c    { text-align: center; }
.lb-td-name { display: flex; align-items: center; gap: .65rem; }

/* Rank medal */
.lb-medal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; font-size: .85rem;
  font-weight: 800;
}
.lb-gold   { background: #fef08a; color: #854d0e; font-size: 1.1rem; }
.lb-silver { background: #e2e8f0; color: #475569; }
.lb-bronze { background: #fed7aa; color: #9a3412; }
.lb-rank-num { font-size: .85rem; font-weight: 700; color: #64748b; }

/* Avatar circle */
.lb-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: #1e3a5c; color: #fff; font-size: .95rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.lb-avatar-gold   { background: linear-gradient(135deg, #d97706, #f59e0b); }
.lb-avatar-silver { background: linear-gradient(135deg, #64748b, #94a3b8); }
.lb-avatar-bronze { background: linear-gradient(135deg, #b45309, #d97706); }

.lb-name-link {
  font-weight: 600; color: #1e3a5c; text-decoration: none; font-size: .9rem;
}
.lb-name-link:hover { text-decoration: underline; color: #1e5fa8; }
.lb-id-sub { font-size: .72rem; color: #64748b; margin-top: .1rem; }
.lb-inactive-badge {
  display: inline-block; background: #fee2e2; color: #dc2626;
  font-size: .65rem; font-weight: 700; border-radius: 4px;
  padding: .1rem .35rem; margin-left: .3rem;
}

/* Numbers */
.lb-big    { font-size: 1.3rem; font-weight: 800; line-height: 1; display: block; }
.lb-num-hi  { color: #16a34a; }
.lb-num-mid { color: #d97706; }
.lb-num-lo  { color: #dc2626; }
.lb-sub     { font-size: .7rem; color: #64748b; margin-top: .15rem; }
.lb-empty   { color: #cbd5e1; font-size: .85rem; }
.lb-date    { font-size: .82rem; font-weight: 600; color: #475569; }

/* Stars */
.lb-stars   { display: flex; justify-content: center; gap: 1px; margin-bottom: .1rem; }
.lb-star    { font-size: .9rem; }
.lb-star-on  { color: #f59e0b; }
.lb-star-off { color: #e2e8f0; }

/* Code tag + footer */
.lb-footer {
  margin-top: .85rem; font-size: .75rem; color: #64748b;
  border-top: 1px solid #f1f5f9; padding-top: .65rem;
}
.lb-code {
  background: #f1f5f9; border-radius: 4px; padding: .05rem .4rem;
  font-family: 'Courier New', monospace; color: #475569;
}

/* ── Score badge (leaderboard) ──────────────────────────────────── */
.lb-th-score { color: #7c3aed; }

.lb-score-badge {
  display: inline-block; padding: .3rem .7rem; border-radius: 20px;
  font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; line-height: 1;
}
.lb-score-elite { background: #f0fdf4; color: #15803d; border: 1.5px solid #86efac; }
.lb-score-good  { background: #eff6ff; color: #1d4ed8; border: 1.5px solid #93c5fd; }
.lb-score-ok    { background: #fefce8; color: #a16207; border: 1.5px solid #fde047; }
.lb-score-low   { background: #fef2f2; color: #b91c1c; border: 1.5px solid #fca5a5; }

.lb-score-formula { margin-top: .25rem; font-size: .66rem; color: #64748b; }
.lb-sc-pos { color: #16a34a; font-weight: 600; }
.lb-sc-neg { color: #dc2626; font-weight: 600; }

/* ── Territory Control ──────────────────────────────────────────── */
.tc-card { padding: 1.25rem 1.5rem; }

.tc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .9rem;
}
.tc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
}
.tc-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.tc-threshold-form {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.tc-thresh-label { font-size: .78rem; color: #64748b; font-weight: 600; }
.tc-thresh-input {
  width: 62px;
  padding: .25rem .4rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: .82rem;
  color: #1e293b;
}
.tc-thresh-btn {
  padding: .28rem .7rem;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.tc-thresh-btn:hover { background: #cbd5e1; }
.tc-run-btn {
  padding: .3rem .85rem;
  background: #1d4ed8;
  border: none;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.tc-run-btn:hover { background: #1e40af; }

/* Rules strip */
.tc-rules {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tc-rule {
  padding: .22rem .65rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  border: 1.5px solid transparent;
}
.tc-rule-flag  { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.tc-rule-warn  { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.tc-rule-strip { background: #f0f9ff; color: #075985; border-color: #7dd3fc; }

/* Activity Feed */
.tc-feed {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 380px;
  overflow-y: auto;
}
.tc-event {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  background: #f8fafc;
  border-left: 3.5px solid #cbd5e1;
}
.tc-event-flagged            { border-left-color: #ef4444; background: #fff5f5; }
.tc-event-warning            { border-left-color: #f59e0b; background: #fffdf0; }
.tc-event-cleared            { border-left-color: #22c55e; background: #f0fdf4; }
.tc-event-territory-removed  { border-left-color: #6366f1; background: #f5f3ff; }
.tc-event-territory-reassigned { border-left-color: #0ea5e9; background: #f0f9ff; }

.tc-event-icon {
  font-size: 1.05rem;
  line-height: 1.4;
  flex-shrink: 0;
}
.tc-event-body { flex: 1; min-width: 0; }

.tc-event-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  font-size: .8rem;
}
.tc-actor { font-weight: 700; color: #1e293b; }
.tc-arrow { color: #64748b; }
.tc-terr-name {
  background: #e0e7ff;
  color: #3730a3;
  padding: .1rem .45rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
}

/* Action badge colours */
.tc-action-badge {
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .04em;
  border: 1.5px solid transparent;
}
.tc-ab-flagged             { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.tc-ab-warning             { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.tc-ab-cleared             { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.tc-ab-territory-removed   { background: #f5f3ff; color: #4f46e5; border-color: #c4b5fd; }
.tc-ab-territory-reassigned{ background: #f0f9ff; color: #0369a1; border-color: #7dd3fc; }

.tc-event-reason {
  font-size: .73rem;
  color: #64748b;
  margin-top: .2rem;
}
.tc-event-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .2rem;
}
.tc-ts { font-size: .67rem; color: #64748b; }
.tc-triggered-by {
  font-size: .65rem;
  font-weight: 700;
  padding: .07rem .4rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tc-manual { background: #fef3c7; color: #92400e; }
.tc-auto   { background: #e0f2fe; color: #0369a1; }

.tc-empty {
  text-align: center;
  color: #64748b;
  font-size: .82rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 8px;
}

/* Leaderboard perf-status badges */
.tc-badge {
  display: inline-block;
  padding: .08rem .42rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .03em;
  border: 1.5px solid transparent;
  vertical-align: middle;
}
.tc-badge-flagged { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.tc-badge-warning { background: #fffbeb; color: #92400e; border-color: #fcd34d; }

/* ── Admin Dashboard: Booking Funnel card ──────────────────────── */
.bkf-admin-card { padding: 1.1rem 1.5rem; }
.bkf-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
}
.bkf-admin-title { font-size: 1rem; font-weight: 700; color: #1e293b; }
.bkf-admin-sub   { font-size: .78rem; color: #64748b; margin-top: .1rem; }
.bkf-admin-link  { color: #1d4ed8; text-decoration: none; font-weight: 600; }
.bkf-admin-link:hover { text-decoration: underline; }
.bkf-admin-controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.bkf-admin-toggle {
  padding: .32rem .9rem;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.bkf-toggle-on  { background: #dcfce7; color: #15803d; border-color: #86efac; }
.bkf-toggle-on:hover  { background: #bbf7d0; }
.bkf-toggle-off { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
.bkf-toggle-off:hover { background: #e2e8f0; }
.bkf-admin-preview-btn {
  padding: .32rem .85rem;
  background: #1d4ed8;
  color: #fff;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}
.bkf-admin-preview-btn:hover { background: #1e40af; }
.bkf-admin-note {
  margin-top: .75rem;
  font-size: .75rem;
  color: #64748b;
  background: #f8fafc;
  padding: .5rem .75rem;
  border-radius: 6px;
  border-left: 3px solid #cbd5e1;
}

/* ═══════════════════════════════════════════════════════════════════
   PUBLIC BOOKING FUNNEL  /book
   Mobile-first, max-width 520px card
   ══════════════════════════════════════════════════════════════════ */
.bkf-body {
  background: linear-gradient(160deg, #eff6ff 0%, #f1f5f9 60%, #f8fafc 100%);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1e293b;
}

/* Top bar */
.bkf-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.bkf-logo { display: flex; align-items: center; gap: .6rem; }
.bkf-logo-icon { font-size: 1.6rem; }
.bkf-logo-name { font-size: 1.1rem; font-weight: 800; color: #1d4ed8; letter-spacing: -.01em; }
.bkf-logo-sub  { font-size: .68rem; color: #64748b; }
.bkf-trust-strip { display: flex; gap: .6rem; flex-wrap: wrap; }
.bkf-ts-item {
  font-size: .7rem;
  font-weight: 600;
  color: #15803d;
  background: #f0fdf4;
  padding: .2rem .55rem;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
}

/* Progress step dots */
.bkf-progress-wrap {
  padding: 1rem 1rem .5rem;
  max-width: 520px;
  margin: 0 auto;
}
.bkf-step-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.bkf-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  flex-shrink: 0;
}
.bkf-dot-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s, color .25s;
}
.bkf-dot-label {
  font-size: .70rem;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  transition: color .25s;
}
.bkf-dot-active .bkf-dot-num  { background: #1d4ed8; color: #fff; box-shadow: 0 0 0 4px #bfdbfe; }
.bkf-dot-active .bkf-dot-label{ color: #1d4ed8; }
.bkf-dot-done   .bkf-dot-num  { background: #16a34a; color: #fff; }
.bkf-dot-done   .bkf-dot-label{ color: #16a34a; }
.bkf-dot-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  transition: background .25s;
  min-width: 24px;
  max-width: 60px;
  margin-bottom: 14px;
}
.bkf-line-done { background: #16a34a; }

/* Main card */
.bkf-main { padding: .75rem 1rem 2rem; max-width: 520px; margin: 0 auto; }
.bkf-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 1.75rem 1.5rem;
  overflow: hidden;
}
@media (max-width: 480px) {
  .bkf-card { padding: 1.4rem 1.1rem; border-radius: 12px; }
}

/* Step visibility */
.bkf-step { }
.bkf-hidden { display: none !important; }

/* Step typography */
.bkf-step-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: .35rem;
  letter-spacing: -.01em;
}
.bkf-step-sub {
  font-size: .85rem;
  color: #64748b;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Form fields */
.bkf-field-row { margin-bottom: .85rem; }
.bkf-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 360px) { .bkf-row-2 { grid-template-columns: 1fr; } }
.bkf-field { display: flex; flex-direction: column; gap: .3rem; }
.bkf-label { font-size: .78rem; font-weight: 700; color: #374151; }
.bkf-input {
  padding: .7rem .85rem;
  border: 1.5px solid #d1d5db;
  border-radius: 9px;
  font-size: .95rem;
  color: #111827;
  background: #fafafa;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  width: 100%;
  -webkit-appearance: none;
}
.bkf-input:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px #bfdbfe;
  background: #fff;
}
.bkf-input-zip { letter-spacing: .12em; }

/* Error */
.bkf-error {
  display: none;
  background: #fef2f2;
  color: #b91c1c;
  font-size: .8rem;
  padding: .5rem .75rem;
  border-radius: 7px;
  border: 1px solid #fca5a5;
  margin-bottom: .75rem;
  font-weight: 600;
}

/* Buttons */
.bkf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .85rem 1rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .18s, transform .1s;
  margin-top: .75rem;
}
.bkf-btn:active { transform: scale(.98); }
.bkf-btn-primary { background: #1d4ed8; color: #fff; }
.bkf-btn-primary:hover { background: #1e40af; }
.bkf-btn-book { background: #16a34a; font-size: 1.05rem; }
.bkf-btn-book:hover { background: #15803d; }
.bkf-btn-ghost {
  background: transparent;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  font-size: .85rem;
  padding: .6rem;
}
.bkf-btn-ghost:hover { background: #f8fafc; }
.bkf-btn-pay {
  background: #7c3aed;
  color: #fff;
  font-size: 1rem;
  margin-top: 1rem;
}
.bkf-btn-pay:hover { background: #6d28d9; }
.bkf-btn-new { margin-top: 1rem; font-size: .85rem; }
.bkf-btn-arrow { font-size: 1.1rem; }

/* Spinner */
.bkf-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bkf-spin .7s linear infinite;
}
@keyframes bkf-spin { to { transform: rotate(360deg); } }

/* Micro trust */
.bkf-micro-trust {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.bkf-micro-trust span { font-size: .7rem; color: #64748b; }

/* ── Step 2: Availability + Price ──────────────────────────────── */
.bkf-avail-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .9rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .03em;
  margin-bottom: 1rem;
}
.bkf-avail-today    { background: #dcfce7; color: #15803d; border: 1.5px solid #86efac; }
.bkf-avail-tomorrow { background: #fef9c3; color: #854d0e; border: 1.5px solid #fde68a; }
.bkf-avail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: bkf-pulse 1.5s ease-in-out infinite;
}
@keyframes bkf-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.bkf-vehicle-pill {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  padding: .25rem .8rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
}

.bkf-price-block { text-align: center; margin-bottom: 1.1rem; }
.bkf-price-amount {
  font-size: 2.8rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -.04em;
  line-height: 1;
}
.bkf-price-label { font-size: .82rem; color: #64748b; margin-top: .25rem; }

/* Inspector card */
.bkf-inspector-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .7rem 1rem;
  margin-bottom: 1.1rem;
}
.bkf-inspector-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bkf-inspector-name { font-size: .92rem; font-weight: 700; color: #1e293b; }
.bkf-inspector-meta { font-size: .75rem; color: #64748b; margin-top: .15rem; }

/* Trust grid */
.bkf-trust-grid {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}
.bkf-trust-card {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: .65rem .85rem;
}
.bkf-trust-icon { font-size: 1.3rem; flex-shrink: 0; }
.bkf-trust-title { font-size: .85rem; font-weight: 700; color: #1e293b; }
.bkf-trust-sub   { font-size: .72rem; color: #64748b; margin-top: .1rem; }
.bkf-trust-grid-sm .bkf-trust-card { padding: .5rem .75rem; }
.bkf-trust-grid-sm .bkf-trust-sub  { display: none; }

/* ── Step 4: Confirmation ──────────────────────────────────────── */
.bkf-confirm-checkmark {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.bkf-checkmark-svg {
  width: 60px;
  height: 60px;
}
.bkf-checkmark-circle {
  stroke: #16a34a;
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: bkf-stroke 0.6s cubic-bezier(0.65,0,0.45,1) forwards;
}
.bkf-checkmark-tick {
  stroke: #16a34a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: bkf-stroke 0.3s cubic-bezier(0.65,0,0.45,1) 0.5s forwards;
}
@keyframes bkf-stroke { to { stroke-dashoffset: 0; } }

.bkf-confirm-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .9rem 1rem;
  margin: 1rem 0;
}
.bkf-cc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .35rem 0;
  border-bottom: 1px solid #f1f5f9;
  gap: .5rem;
}
.bkf-cc-row:last-child { border-bottom: none; }
.bkf-cc-label { font-size: .75rem; color: #64748b; font-weight: 600; flex-shrink: 0; }
.bkf-cc-val   { font-size: .85rem; color: #0f172a; font-weight: 700; text-align: right; }
.bkf-ref { color: #1d4ed8; font-family: monospace; }

.bkf-pay-note { font-size: .72rem; color: #64748b; text-align: center; margin-top: .4rem; }

/* Footer */
.bkf-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .72rem;
  color: #64748b;
}
.bkf-footer a { color: #64748b; }

/* ── Responsive: hide trust strip on very small screens ─────── */
@media (max-width: 400px) {
  .bkf-trust-strip { display: none; }
  .bkf-topbar { padding: .75rem 1rem; }
}

/* ── Inspector Profile: Capacity bar ───────────────────────────── */
.ip-capacity-bar-wrap { display:flex; align-items:center; gap:.6rem; }
.ip-capacity-bar {
  flex: 1; height: 7px; background: #e5e7eb;
  border-radius: 4px; overflow: hidden; max-width: 120px;
}
.ip-capacity-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.ip-cap-ok   { background: #22c55e; }
.ip-cap-high { background: #f97316; }
.ip-cap-full { background: #ef4444; }
.ip-capacity-label { font-size: .78rem; color: #6b7280; }

/* ── Booking Funnel: Slot count chip (step 2) ───────────────────── */
.bkf-slots-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 700;
  padding: .28rem .75rem;
  border-radius: 99px;
  margin-bottom: .35rem;
  border: 1.5px solid transparent;
}
.bkf-slots-ok {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
}
.bkf-slots-low {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.bkf-slots-full {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* ── Booking Funnel: Date availability chip (step 3) ────────────── */
.bkf-date-avail {
  margin-top: .35rem;
  font-size: .76rem;
  font-weight: 600;
  padding: .25rem .6rem;
  border-radius: 6px;
  border: 1.5px solid transparent;
}
.bkf-date-avail-loading { color: #6b7280; background: #f9fafb; border-color: #e5e7eb; }
.bkf-date-avail-ok      { color: #15803d; background: #f0fdf4; border-color: #86efac; }
.bkf-date-avail-full    { color: #b91c1c; background: #fef2f2; border-color: #fca5a5; }

/* Disabled state for Book/Confirm button */
.bkf-btn.bkf-btn-disabled,
.bkf-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Booking Funnel: Reserved notice on step 4 ─────────────────── */
.bkf-reserved-notice {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 9px;
  padding: .65rem .9rem;
  margin-bottom: .75rem;
  font-size: .85rem;
  color: #92400e;
  font-weight: 600;
  line-height: 1.4;
}
.bkf-reserved-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── Inspection Detail: Booking Status Banners ─────────────────── */
.bks-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding: .9rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1.5px solid transparent;
}
.bks-banner-left {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
  min-width: 0;
}
.bks-banner-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.bks-icon { font-size: 1.4rem; flex-shrink: 0; }
.bks-title {
  font-size: .92rem;
  font-weight: 800;
  margin-bottom: .15rem;
}
.bks-sub { font-size: .78rem; line-height: 1.4; opacity: .9; }

/* Pending payment — amber */
.bks-pending {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #92400e;
}
/* Confirmed — green */
.bks-confirmed {
  background: #f0fdf4;
  border-color: #86efac;
  color: #14532d;
}

/* Pay button in pending banner */
.bks-pay-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem 1rem;
  background: #f97316;
  color: #fff;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.bks-pay-btn:hover { background: #ea580c; }

/* Admin override button */
.bks-override-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .9rem;
  background: #fff;
  color: #92400e;
  border: 1.5px solid #fed7aa;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.bks-override-btn:hover {
  background: #ffedd5;
  border-color: #f97316;
  color: #c2410c;
}

/* ═══════════════════════════════════════════════════════════════
   Booking Funnel v2 — Add-ons, Price Breakdown, Redirect state
   ═══════════════════════════════════════════════════════════════ */

/* Required / optional labels */
.bkf-req { color: #dc2626; font-size: .78rem; }
.bkf-opt { color: #64748b; font-size: .78rem; font-weight: 400; }

/* Cancelled-payment banner */
.bkf-cancel-banner {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #dc2626;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  text-align: center;
}

/* ── Add-ons section ─────────────────────────────────────────── */
.bkf-addons-section {
  margin: 1rem 0;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.bkf-addons-title {
  background: #f8fafc;
  padding: 8px 14px;
  font-size: .72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid #e2e8f0;
}
.bkf-addon-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}
.bkf-addon-row:last-child { border-bottom: none; }
.bkf-addon-row:hover { background: #f8fafc; }
.bkf-addon-check {
  width: 20px; height: 20px; flex-shrink: 0;
  accent-color: #1a3a5c;
  cursor: pointer;
}
.bkf-addon-info { flex: 1; }
.bkf-addon-name {
  font-size: .88rem; font-weight: 700; color: #1e293b;
}
.bkf-addon-desc {
  font-size: .75rem; color: #64748b; margin-top: 2px;
}
.bkf-addon-price {
  font-size: .88rem; font-weight: 700; color: #1a3a5c;
  flex-shrink: 0;
}

/* ── Price breakdown ─────────────────────────────────────────── */
.bkf-price-breakdown {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin: 1rem 0;
  font-size: .85rem;
}
.bkf-pb-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  color: #475569;
}
.bkf-pb-addon { color: #1a3a5c; }
.bkf-pb-total {
  display: flex;
  justify-content: space-between;
  border-top: 2px solid #e2e8f0;
  margin-top: 8px;
  padding-top: 10px;
  font-weight: 800;
  font-size: 1rem;
  color: #1a3a5c;
}

/* ── Step 3 order summary ────────────────────────────────────── */
.bkf-s3-summary {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-radius: 10px;
  padding: 14px;
  margin: 1rem 0;
  font-size: .85rem;
  display: none;
}
.bkf-s3-sum-title {
  font-size: .72rem; font-weight: 700; color: #0369a1;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px;
}
.bkf-s3-sum-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; color: #334155;
}
.bkf-s3-sum-addon { color: #1e5fa8; }
.bkf-s3-sum-total {
  display: flex; justify-content: space-between;
  border-top: 1.5px solid #bae6fd;
  margin-top: 8px; padding-top: 8px;
  font-weight: 800; font-size: .95rem; color: #1a3a5c;
}

/* ── Redirect/loading state (Step 4) ─────────────────────────── */
.bkf-redirect-spinner {
  text-align: center;
  padding: 2rem 0 1rem;
}
.bkf-redirect-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: bkf-pulse 1.4s ease-in-out infinite;
}
@keyframes bkf-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(.9); }
}
.bkf-redirect-dots {
  display: flex; justify-content: center; gap: 8px; margin-top: 1.2rem;
}
.bkf-redirect-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #1a3a5c; opacity: .3;
  animation: bkf-dot-bounce .8s ease-in-out infinite;
}
.bkf-redirect-dots span:nth-child(2) { animation-delay: .15s; }
.bkf-redirect-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bkf-dot-bounce {
  0%, 80%, 100% { opacity: .3; transform: scale(.8); }
  40%           { opacity: 1;  transform: scale(1.1); }
}


/* Nav button variants (in base.html) */
.btn-nav-warn {
  background: #fff7ed !important;
  color: #c2410c !important;
  border: 1px solid #fed7aa !important;
}
.btn-nav-launch {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Inspector Availability Schedule (inspector_profile.html)
═══════════════════════════════════════════════════════════════════════ */
.ip-section-note {
  font-size: 13px;
  color: #64748b;
  margin: -4px 0 14px;
}
.ip-avail-form { margin: 0; }
.ip-avail-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.ip-avail-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.ip-avail-row.ip-avail-active {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.ip-avail-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 120px;
}
.ip-avail-check input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: #3b82f6;
  flex-shrink: 0;
}
.ip-avail-day-name {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}
.ip-avail-times {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ip-avail-time-lbl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
}
.ip-avail-time-lbl span { font-weight: 500; }
.ip-avail-time-input {
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  background: #fff;
  color: #334155;
}
.ip-avail-save-btn {
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════
   Inspection Detail — Job Status Badge + Reassign Card
═══════════════════════════════════════════════════════════════════════ */
.id-job-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}
.id-job-status-badge.js-assigned    { background: #eff6ff; color: #1e40af; }
.id-job-status-badge.js-en_route    { background: #fffbeb; color: #92400e; }
.id-job-status-badge.js-in_progress { background: #f5f3ff; color: #6d28d9; }
.id-job-status-badge.js-completed   { background: #f0fdf4; color: #15803d; }

/* Reassignment card */
.reassign-card {
  margin-bottom: 20px;
}
.reassign-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reassign-toggle-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background .12s;
}
.reassign-toggle-btn:hover { background: #e2e8f0; }
.reassign-current {
  padding: 12px 0 4px;
}
.reassign-current-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #475569;
}
.reassign-lbl { color: #64748b; font-size: 13px; }
.reassign-status-pill { margin-left: 0; }
.reassign-unassigned {
  color: #f59e0b;
  font-weight: 500;
}
.reassign-form {
  margin-top: 14px;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}
.reassign-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}
.reassign-field { display: flex; flex-direction: column; gap: 5px; }
.reassign-field-lbl { font-size: 13px; font-weight: 600; color: #475569; }
.reassign-select {
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #334155;
}
.reassign-note-input {
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #334155;
}
.reassign-notify-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
}
.reassign-notify-check input { accent-color: #3b82f6; }
.reassign-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 540px) {
  .reassign-hd { flex-wrap: wrap; }
  .reassign-toggle-btn { width: 100%; text-align: center; }
  .reassign-actions { flex-direction: column; }
  .reassign-actions .btn { width: 100%; text-align: center; }
  .reassign-select, .reassign-note-input { font-size: 16px; }
}


/* =====================================================================
   DARK MODE  —  [data-theme="dark"]
   Appended after all light-mode rules so specificity always wins.
   Nav uses a near-black gradient already — no overrides needed for it.
   ===================================================================== */

/* ── Theme toggle button (nav) ── */
.nav-theme-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,.28);
    color: #fff;
    border-radius: 6px;
    padding: 0 .5rem;
    height: 32px;
    font-size: 1.05rem;
    cursor: pointer;
    line-height: 1;
    transition: background .18s, border-color .18s;
    flex-shrink: 0;
    order: -1;
}
.nav-theme-toggle:hover {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.55);
}

/* ── CSS variable layer ── */
:root {
    --dm-bg:           #0f172a;
    --dm-surface:      #1e293b;
    --dm-surface2:     #27364b;
    --dm-border:       #334155;
    --dm-text:         #e2e8f0;
    --dm-text-muted:   #94a3b8;
    --dm-input-bg:     #1e293b;
    --dm-input-border: #475569;
    --dm-link:         #60a5fa;
    --dm-accent:       #3b82f6;
    --dm-success:      #22c55e;
    --dm-warning:      #f59e0b;
    --dm-danger:       #f87171;
}

/* ── Base ── */
[data-theme="dark"] body {
    background: var(--dm-bg);
    color: var(--dm-text);
}

/* ── Cards / panels ── */
[data-theme="dark"] .dash-card,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .lc-card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .form-section,
[data-theme="dark"] .ip-card,
[data-theme="dark"] .alert-box,
[data-theme="dark"] .tc-card,
[data-theme="dark"] .score-card,
[data-theme="dark"] .inspector-card,
[data-theme="dark"] .activity-log,
[data-theme="dark"] .map-panel,
[data-theme="dark"] .booking-card,
[data-theme="dark"] .tech-assign-card,
[data-theme="dark"] .pkg-info-bar,
[data-theme="dark"] .pkg-banner,
[data-theme="dark"] .tab-panel,
[data-theme="dark"] .book-step,
[data-theme="dark"] .login-card,
[data-theme="dark"] .promo-card,
[data-theme="dark"] .um-modal-body,
[data-theme="dark"] .report-meta-card,
[data-theme="dark"] .insp-status-card,
[data-theme="dark"] .notes-card,
[data-theme="dark"] .photo-card,
[data-theme="dark"] .checklist-card {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

/* card headers */
[data-theme="dark"] .dash-card-hd,
[data-theme="dark"] .ip-card .dash-card-hd,
[data-theme="dark"] .form-section-hd,
[data-theme="dark"] .kpi-label,
[data-theme="dark"] .tc-card-hd {
    border-color: var(--dm-border);
    color: var(--dm-text);
}

/* ── Tables ── */
[data-theme="dark"] table,
[data-theme="dark"] .data-table {
    background: var(--dm-surface);
    color: var(--dm-text);
    border-color: var(--dm-border);
}
[data-theme="dark"] thead,
[data-theme="dark"] thead th,
[data-theme="dark"] .data-table thead th {
    background: var(--dm-surface2);
    color: var(--dm-text);
    border-color: var(--dm-border);
}
[data-theme="dark"] tbody tr:nth-child(even),
[data-theme="dark"] .data-table tbody tr:nth-child(even) {
    background: #1a2840;
}
[data-theme="dark"] tbody tr:hover,
[data-theme="dark"] .data-table tbody tr:hover {
    background: var(--dm-surface2);
}
[data-theme="dark"] td,
[data-theme="dark"] th {
    border-color: var(--dm-border);
    color: var(--dm-text);
}

/* ── Forms ── */
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--dm-input-bg);
    color: var(--dm-text);
    border-color: var(--dm-input-border);
}
[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: var(--dm-accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,.22);
}
[data-theme="dark"] .form-group label,
[data-theme="dark"] label {
    color: var(--dm-text);
}
[data-theme="dark"] .pkg-price-label {
    color: var(--dm-text);
}
[data-theme="dark"] .pkg-price-badge {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(96,165,250,.35);
}
[data-theme="dark"] .form-group input[type="file"] {
    background: var(--dm-surface2);
    border-color: var(--dm-input-border);
    color: var(--dm-text-muted);
}
[data-theme="dark"] ::placeholder {
    color: #64748b;
}

/* ── Buttons — keep primary colour; lighten secondary ── */
[data-theme="dark"] .btn-secondary {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}
[data-theme="dark"] .btn-secondary:hover {
    background: #3d5068;
}
[data-theme="dark"] .btn-outline {
    border-color: var(--dm-input-border);
    color: var(--dm-text);
}

/* ── Flash / alerts ── */
[data-theme="dark"] .flash,
[data-theme="dark"] .flash-success,
[data-theme="dark"] .flash-error,
[data-theme="dark"] .flash-warning,
[data-theme="dark"] .flash-info {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}
[data-theme="dark"] .flash-success { border-left-color: var(--dm-success); }
[data-theme="dark"] .flash-error   { border-left-color: var(--dm-danger);  }
[data-theme="dark"] .flash-warning { border-left-color: var(--dm-warning); }

/* ── Status / KPI badges — keep colour, darken bg ── */
[data-theme="dark"] .status-badge,
[data-theme="dark"] .chip,
[data-theme="dark"] .kpi-val {
    color: var(--dm-text);
}
[data-theme="dark"] .kpi-card {
    background: var(--dm-surface);
}
[data-theme="dark"] .kpi-val { color: var(--dm-link); }

/* ── Links ── */
[data-theme="dark"] a { color: var(--dm-link); }
[data-theme="dark"] a:hover { color: #93c5fd; }
[data-theme="dark"] .dash-card-link { color: var(--dm-link); }

/* ── Page header text ── */
[data-theme="dark"] .page-header h1,
[data-theme="dark"] h1, [data-theme="dark"] h2,
[data-theme="dark"] h3, [data-theme="dark"] h4 {
    color: var(--dm-text);
}

/* ── Sidebar / left-nav if present ── */
[data-theme="dark"] .sidebar,
[data-theme="dark"] .side-nav {
    background: var(--dm-surface);
    border-color: var(--dm-border);
}

/* ── Footer ── */
[data-theme="dark"] .site-footer {
    background: #07101e;
    border-color: #1e293b;
    color: var(--dm-text-muted);
}
[data-theme="dark"] .footer-copy,
[data-theme="dark"] .footer-tagline {
    color: var(--dm-text-muted);
}
[data-theme="dark"] .footer-version {
    color: #334155;
}

/* ── Activity log ── */
[data-theme="dark"] .activity-item {
    border-color: var(--dm-border);
    color: var(--dm-text);
}
[data-theme="dark"] .activity-meta { color: var(--dm-text-muted); }

/* ── Inspection checklist items ── */
[data-theme="dark"] .ci-row,
[data-theme="dark"] .checklist-item,
[data-theme="dark"] .insp-item {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}
[data-theme="dark"] .ci-row:nth-child(even),
[data-theme="dark"] .checklist-item:nth-child(even) {
    background: var(--dm-surface2);
}

/* ── Inspection detail – section headers ── */
[data-theme="dark"] .section-hd,
[data-theme="dark"] .cat-header,
[data-theme="dark"] .ip-section-head {
    background: var(--dm-surface2);
    color: var(--dm-text);
    border-color: var(--dm-border);
}

/* ── Technician assign card ── */
[data-theme="dark"] .tech-assign-auto  { background: #0d2e1c; color: #86efac; }
[data-theme="dark"] .tech-assign-manual { background: #1e1a08; color: #fcd34d; }

/* ── Admin tabs ── */
[data-theme="dark"] .tab-bar {
    background: var(--dm-surface);
    border-color: var(--dm-border);
}
[data-theme="dark"] .tab-btn {
    color: var(--dm-text-muted);
}
[data-theme="dark"] .tab-btn.active {
    background: var(--dm-accent);
    color: #fff;
}

/* ── Modal ── */
[data-theme="dark"] .um-modal,
[data-theme="dark"] .modal-overlay .modal-box {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}
[data-theme="dark"] .um-modal-footer,
[data-theme="dark"] .modal-footer {
    background: var(--dm-surface2);
    border-color: var(--dm-border);
}

/* ── Package/banner info bars ── */
[data-theme="dark"] .pkg-info-bar,
[data-theme="dark"] .ab-pkg-name {
    background: var(--dm-surface2);
    color: var(--dm-text);
    border-color: var(--dm-border);
}

/* ── Scrollbars (Chromium) ── */
[data-theme="dark"] ::-webkit-scrollbar { background: var(--dm-bg); width: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* ── Misc text / helper classes ── */
[data-theme="dark"] .text-muted,
[data-theme="dark"] .muted,
[data-theme="dark"] small { color: var(--dm-text-muted); }
[data-theme="dark"] .reassign-notify-check { color: var(--dm-text-muted); }
[data-theme="dark"] .zip-routing-override { background: var(--dm-surface2); color: var(--dm-text); border-color: var(--dm-border); }

/* ── KPI / metric cards — high-contrast text in dark mode ── */
[data-theme="dark"] .kpi-num { color: #fff; }
[data-theme="dark"] .kpi-lbl { color: #cbd5e1; }
[data-theme="dark"] .kpi-sub { color: #94a3b8; }

/* Neutralise tinted card backgrounds (green / blue / yellow) */
[data-theme="dark"] .kpi-revenue,
[data-theme="dark"] .kpi-rate-card,
[data-theme="dark"] .kpi-reviews,
[data-theme="dark"] .kpi-scheduled,
[data-theme="dark"] .kpi-completed {
    background: var(--dm-surface);
    border-color: var(--dm-border);
}
/* Keep the top-border accent on scheduled / completed */
[data-theme="dark"] .kpi-scheduled { border-top-color: #3b82f6; }
[data-theme="dark"] .kpi-completed  { border-top-color: #22c55e; }

/* ── Inspector pipeline cards — high-contrast text ── */
[data-theme="dark"] .insp-pipe-card {
    background: var(--dm-surface);
    border-color: var(--dm-border);
}
[data-theme="dark"] .insp-pipe-card:hover {
    background: var(--dm-surface2);
    border-color: #64748b;
}
[data-theme="dark"] .insp-pipe-lbl { color: #cbd5e1; }

/* Per-status number colours — keep vivid so they stay readable */
[data-theme="dark"] .insp-pipe-all  .insp-pipe-num { color: #fff; }
[data-theme="dark"] .insp-pipe-lead .insp-pipe-num { color: #fbbf24; }
[data-theme="dark"] .insp-pipe-sched .insp-pipe-num { color: #60a5fa; }
[data-theme="dark"] .insp-pipe-comp  .insp-pipe-num { color: #4ade80; }
[data-theme="dark"] .insp-pipe-done  .insp-pipe-num { color: #c084fc; }

/* Remove the light pastel tinted backgrounds */
[data-theme="dark"] .insp-pipe-lead,
[data-theme="dark"] .insp-pipe-sched,
[data-theme="dark"] .insp-pipe-comp,
[data-theme="dark"] .insp-pipe-done {
    background: var(--dm-surface);
    border-color: var(--dm-border);
}
/* Keep subtle left/top accent borders */
[data-theme="dark"] .insp-pipe-lead  { border-top-color: #fbbf24; }
[data-theme="dark"] .insp-pipe-sched { border-top-color: #60a5fa; }
[data-theme="dark"] .insp-pipe-comp  { border-top-color: #4ade80; }
[data-theme="dark"] .insp-pipe-done  { border-top-color: #c084fc; }

/* ── Score / quality bars ── */
[data-theme="dark"] .qs-bar-bg { background: #1e293b; }
[data-theme="dark"] .qs-bar    { background: var(--dm-accent); }

/* ── Status badge variants (light pastel → dark tint + vivid text) ── */
[data-theme="dark"] .badge-lead            { background: #1e293b; color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .badge-new-order       { background: #2e1065; color: #c4b5fd; border-color: #6d28d9; }
[data-theme="dark"] .badge-pending-assign  { background: #0c2a4a; color: #7dd3fc; border-color: #0369a1; }
[data-theme="dark"] .badge-scheduled       { background: #172554; color: #93c5fd; border-color: #1d4ed8; }
[data-theme="dark"] .badge-accepted        { background: #0c2a4a; color: #7dd3fc; border-color: #0369a1; }
[data-theme="dark"] .badge-enroute         { background: #422006; color: #fde68a; border-color: #ca8a04; }
[data-theme="dark"] .badge-inprogress      { background: #052e16; color: #6ee7b7; border-color: #059669; }
[data-theme="dark"] .badge-pending-review  { background: #431407; color: #fcd34d; border-color: #d97706; }
[data-theme="dark"] .badge-returned        { background: #450a0a; color: #f87171; border-color: #b91c1c; }
[data-theme="dark"] .badge-approved        { background: #052e16; color: #6ee7b7; border-color: #059669; }
[data-theme="dark"] .badge-completed       { background: #052e16; color: #4ade80; border-color: #166534; }
[data-theme="dark"] .badge-report          { background: #2e1065; color: #c4b5fd; border-color: #6d28d9; }
[data-theme="dark"] .badge-followedup      { background: #431407; color: #fb923c; border-color: #c2410c; }
[data-theme="dark"] .badge-reviewed        { background: #052e16; color: #86efac; border-color: #15803d; }
[data-theme="dark"] .badge-quo-new        { background: #2e1065; color: #c4b5fd; border-color: #6d28d9; }
[data-theme="dark"] .badge-quo-contacted  { background: #172554; color: #93c5fd; border-color: #1d4ed8; }
[data-theme="dark"] .badge-quo-quote      { background: #431407; color: #fcd34d; border-color: #d97706; }
[data-theme="dark"] .badge-quo-ready      { background: #052e16; color: #6ee7b7; border-color: #059669; }
[data-theme="dark"] .badge-quo-booked     { background: #042f2e; color: #5eead4; border-color: #0d9488; }
[data-theme="dark"] .badge-quo-lost       { background: #450a0a; color: #f87171; border-color: #b91c1c; }

/* ── Health / quality badge variants ── */
[data-theme="dark"] .badge-good { background: #052e16; color: #4ade80; }
[data-theme="dark"] .badge-fair { background: #422006; color: #fcd34d; }
[data-theme="dark"] .badge-poor { background: #450a0a; color: #fca5a5; }

/* ── Status chip variants ── */
[data-theme="dark"] .chip-lead       { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .chip-scheduled  { background: #172554; color: #93c5fd; }
[data-theme="dark"] .chip-completed  { background: #052e16; color: #4ade80; }
[data-theme="dark"] .chip-report     { background: #2e1065; color: #c4b5fd; }
[data-theme="dark"] .chip-followedup { background: #431407; color: #fdba74; }
[data-theme="dark"] .chip-reviewed   { background: #1a2e05; color: #bef264; }
[data-theme="dark"] .chip-paid       { background: #052e16; color: #4ade80; }
[data-theme="dark"] .chip-paysent    { background: #172554; color: #60a5fa; }
[data-theme="dark"] .chip-payfailed  { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .chip-refunded   { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .chip-unpaid     { background: #431407; color: #fbbf24; }

/* ── Semantic text-colour utilities ── */
[data-theme="dark"] .ckpi-green { color: #4ade80; }
[data-theme="dark"] .ckpi-amber { color: #fbbf24; }
[data-theme="dark"] .ckpi-red   { color: #f87171; }
[data-theme="dark"] .chk-icon-on,
[data-theme="dark"] .chk-on     { color: #4ade80; }

/* Generic semantic helpers (mirror user's intent) */
[data-theme="dark"] .text-success { color: #4ade80 !important; }
[data-theme="dark"] .text-danger  { color: #f87171 !important; }
[data-theme="dark"] .text-warning { color: #fbbf24 !important; }
[data-theme="dark"] .text-muted   { color: #94a3b8 !important; }

/* All table text — explicit white-family so no cell is ever unreadable */
[data-theme="dark"] td,
[data-theme="dark"] th,
[data-theme="dark"] .data-table td,
[data-theme="dark"] .data-table th { color: #e2e8f0; }

/* High-contrast number/label helpers (map to user's metric-value / label intent) */
[data-theme="dark"] .kpi-num,
[data-theme="dark"] .metric-value,
[data-theme="dark"] .value,
[data-theme="dark"] .amount        { color: #fff; }
[data-theme="dark"] .kpi-lbl,
[data-theme="dark"] .label         { color: #cbd5e1; }

/* ── Payment Summary grid ── */
[data-theme="dark"] .pay-sum-grid {
    border-color: var(--dm-border);
}
[data-theme="dark"] .pay-sum-col-hd {
    background: var(--dm-surface2);
    color: #cbd5e1;
    border-color: var(--dm-border);
}
[data-theme="dark"] .pay-sum-row-label {
    background: var(--dm-surface2);
    color: #e2e8f0;
    border-color: var(--dm-border);
}
[data-theme="dark"] .pay-sum-cell {
    border-color: var(--dm-border);
}
/* Total Billed — was dark navy text on white, now white on dark */
[data-theme="dark"] .pay-cell-billed    { color: #fff; background: var(--dm-surface); }
/* Collected — keep green identity, darken bg */
[data-theme="dark"] .pay-cell-collected { color: #4ade80; background: #052e16; }
/* Uncollected / unpaid — keep red identity, darken bg */
[data-theme="dark"] .pay-cell-unpaid    { color: #fca5a5; background: #450a0a; }
/* Zero amounts — readable muted */
[data-theme="dark"] .pay-cell-zero      { color: #94a3b8; background: var(--dm-surface); }
/* Collection rate cells */
[data-theme="dark"] .rate-high { color: #4ade80; background: #052e16; }
[data-theme="dark"] .rate-mid  { color: #fcd34d; background: #422006; }
[data-theme="dark"] .rate-low  { color: #fca5a5; background: #450a0a; }
/* Sub-label under Payment Summary heading */
[data-theme="dark"] .pay-sum-sub { color: #94a3b8; }

/* ── Unpaid Balance Aging buckets ── */
[data-theme="dark"] .aging-buckets      { border-color: var(--dm-border); }
[data-theme="dark"] .aging-bucket       { border-color: var(--dm-border); }
[data-theme="dark"] .aging-bucket-label { color: #94a3b8; }
[data-theme="dark"] .aging-header       { border-color: var(--dm-border); }
[data-theme="dark"] .aging-sub          { color: #94a3b8; }

/* Fresh (0–24 hrs) — neutral dark */
[data-theme="dark"] .age-fresh                  { background: var(--dm-surface); }
[data-theme="dark"] .age-fresh .aging-amt       { color: #e2e8f0; }
[data-theme="dark"] .age-fresh .aging-cnt       { color: #94a3b8; }

/* Warn (1–3 days) — dark amber tint */
[data-theme="dark"] .age-warn                   { background: #1c1200; }
[data-theme="dark"] .age-warn .aging-amt        { color: #fbbf24; }
[data-theme="dark"] .age-warn .aging-cnt        { color: #fcd34d; }

/* Risk (3–7 days) — dark orange tint */
[data-theme="dark"] .age-risk                   { background: #1c0a00; }
[data-theme="dark"] .age-risk .aging-amt        { color: #fb923c; }
[data-theme="dark"] .age-risk .aging-cnt        { color: #fdba74; }

/* Critical empty (7+ days, zero accounts) — neutral dark */
[data-theme="dark"] .age-critical               { background: var(--dm-surface); }
[data-theme="dark"] .age-critical .aging-amt    { color: #64748b; }
[data-theme="dark"] .age-critical .aging-cnt    { color: #475569; }

/* Critical active (7+ days, has accounts) — dark red tint */
[data-theme="dark"] .age-critical-active                    { background: #200000; }
[data-theme="dark"] .age-critical-active .aging-bucket-label { color: #fca5a5; }
[data-theme="dark"] .age-critical-active .aging-amt          { color: #f87171; }
[data-theme="dark"] .age-critical-active .aging-cnt          { color: #fca5a5; }

/* Aging risk table (if shown) */
[data-theme="dark"] .aging-risk-table th { background: var(--dm-surface2); color: #cbd5e1; border-color: var(--dm-border); }
[data-theme="dark"] .aging-risk-row      { border-color: var(--dm-border); color: var(--dm-text); }
[data-theme="dark"] .aging-risk-hd       { color: var(--dm-text); }

/* ── Admin launch page specific ── */
[data-theme="dark"] .admin-launch-card {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

/* ── Dropdown / select option background in dark mode ── */
[data-theme="dark"] option {
    background: var(--dm-surface);
    color: var(--dm-text);
}



/* ============================================================
   THEME PICKER — global base styles (used on /settings and Launch page)
   ============================================================ */

/* Settings nav button */
.btn-nav-settings {
  background: #f1f5f9; color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}
.btn-nav-settings:hover { background: #e2e8f0 !important; color: #1e293b !important; }
[data-theme="dark"] .btn-nav-settings {
  background: #1e293b !important; color: #94a3b8 !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .btn-nav-settings:hover {
  background: #334155 !important; color: #f1f5f9 !important;
}

/* Base .tp-opt used on any page that renders the picker */
.tp-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 12px 14px;
  background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 14px;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
  position: relative; text-align: center;
}
.tp-opt input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.tp-opt:hover { background: #eff6ff; border-color: #bfdbfe; }
.tp-opt-active {
  background: #eff6ff; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.tp-icon  { font-size: 22px; line-height: 1; }
.tp-label { font-size: 14px; font-weight: 700; color: #1e293b; }
.tp-desc  { font-size: 11px; color: #64748b; }
.tp-check {
  position: absolute; top: 8px; right: 10px;
  font-size: 13px; font-weight: 700; color: #3b82f6;
  opacity: 0; transition: opacity .15s;
}
.tp-opt-active .tp-check { opacity: 1; }
.tp-status { font-size: 13px; font-weight: 600; min-height: 20px; }
.tp-status-ok  { color: #16a34a; }
.tp-status-err { color: #dc2626; }

/* Dark mode overrides for the base tp-opt (applies everywhere) */
[data-theme="dark"] .tp-opt          { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .tp-opt:hover    { background: #1e3a5f; border-color: #3b82f6; }
[data-theme="dark"] .tp-opt-active   { background: #1e3a5f; border-color: #3b82f6; }
[data-theme="dark"] .tp-label        { color: #f1f5f9; }
[data-theme="dark"] .tp-desc         { color: #94a3b8; }

/* ── Nav: btn-nav-main, btn-nav-active, nav-divider ─────────────────────── */
nav .btn-nav-main {
  font-size: 14.5px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: 8px;
  letter-spacing: .01em;
}
nav .btn-nav-active {
  background: rgba(255,255,255,.22) !important;
  border-color: rgba(255,255,255,.85) !important;
  font-weight: 700;
}
nav .nav-divider {
  display: inline-block;
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.22);
  margin: 0 4px;
  vertical-align: middle;
  border-radius: 2px;
}

/* ── Dashboard top-bar action buttons ─────────────────────────────────── */
.ds-top-bar {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.ds-new-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem 1.25rem;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 700;
  background: #1a56db;
  color: #fff;
  text-decoration: none;
  border: none;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 1px 4px rgba(26,86,219,.25);
  white-space: nowrap;
}
.ds-new-btn:hover { background: #1447c0; box-shadow: 0 3px 8px rgba(26,86,219,.3); opacity: 1; color: #fff; }
.ds-past-btn {
  display: inline-flex;
  align-items: center;
  padding: .55rem 1.25rem;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #1e3a5f;
  text-decoration: none;
  border: 1px solid #cbd5e1;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.ds-past-btn:hover { background: #e2e8f0; border-color: #94a3b8; color: #1e3a5f; opacity: 1; }

/* ── Customer history table ──────────────────────────────────────────────── */
.ch-card { padding: 0; overflow: hidden; }
.ch-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.ch-filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.ch-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  color: #475569;
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: background .12s, border-color .12s;
}
.ch-filter-btn:hover { background: #e2e8f0; }
.ch-filter-active { background: #000 !important; color: #fff !important; border-color: #000 !important; }
.ch-filter-cnt {
  background: rgba(0,0,0,.1); color: inherit;
  border-radius: 20px; padding: 1px 6px; font-size: 11px;
}
.ch-filter-active .ch-filter-cnt { background: rgba(255,255,255,.25); }
.ch-table-wrap { overflow-x: auto; }
.ch-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ch-th { padding: 10px 16px; font-size: 11px; font-weight: 700; color: #64748b;
         text-transform: uppercase; letter-spacing: .04em;
         background: #f8fafc; border-bottom: 1px solid #e2e8f0; text-align: left; }
.ch-th-center { text-align: center; }
.ch-td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.ch-td-center { text-align: center; }
.ch-td-cust { min-width: 180px; }
.ch-cust-name { font-weight: 700; color: #1e293b; font-size: 14px; }
.ch-cust-email { font-size: 11px; color: #64748b; margin-top: 2px; }
.ch-insp-count { font-size: 18px; font-weight: 800; color: #0f172a; }
.ch-spent { font-size: 14px; font-weight: 700; color: #15803d; }
.ch-last-date { font-size: 12px; color: #64748b; }
.ch-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.ch-badge-repeat { background: #dbeafe; color: #1e40af; }
.ch-badge-new    { background: #dcfce7; color: #15803d; }
.ch-row:last-child .ch-td { border-bottom: none; }
.ch-row:hover .ch-td { background: #f8fafc; }
[data-theme="dark"] .ch-th { background: #0f172a; border-bottom-color: #334155; color: #94a3b8; }
[data-theme="dark"] .ch-td { border-bottom-color: #334155; }
[data-theme="dark"] .ch-cust-name { color: #f1f5f9; }
[data-theme="dark"] .ch-insp-count { color: #f1f5f9; }
[data-theme="dark"] .ch-spent { color: #4ade80; }
[data-theme="dark"] .ch-badge-repeat { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .ch-badge-new { background: #14532d; color: #4ade80; }
[data-theme="dark"] .ch-row:hover .ch-td { background: #0f172a; }

/* ── Admin Pipeline Overview Cards (dashboard.html) ───────────────────────── */
.ds-pipe-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.ds-pipe-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  text-decoration: none;
  transition: box-shadow .12s, transform .12s;
  text-align: center;
}
.ds-pipe-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.ds-pipe-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
}
.ds-pipe-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 6px;
}
.ds-pipe-alert {
  position: absolute;
  top: 6px; right: 8px;
  font-size: 14px;
  color: #f59e0b;
}
.ds-pipe-new      { background: #fefce8; border-color: #fde68a; }
.ds-pipe-new      .ds-pipe-num { color: #854d0e; }
.ds-pipe-assign   { background: #eff6ff; border-color: #bfdbfe; }
.ds-pipe-assign   .ds-pipe-num { color: #1e40af; }
.ds-pipe-sched    { background: #f0fdf4; border-color: #bbf7d0; }
.ds-pipe-sched    .ds-pipe-num { color: #15803d; }
.ds-pipe-review   { background: #fff7ed; border-color: #fed7aa; }
.ds-pipe-review   .ds-pipe-num { color: #c2410c; }
.ds-pipe-approved { background: #f0fdf4; border-color: #86efac; }
.ds-pipe-approved .ds-pipe-num { color: #166534; }
.ds-pipe-sent     { background: #f5f3ff; border-color: #ddd6fe; }
.ds-pipe-sent     .ds-pipe-num { color: #5b21b6; }

[data-theme="dark"] .ds-pipe-card     { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .ds-pipe-num      { color: #f1f5f9; }
[data-theme="dark"] .ds-pipe-lbl      { color: #94a3b8; }
[data-theme="dark"] .ds-pipe-new      { background: #3f3007; border-color: #92400e; }
[data-theme="dark"] .ds-pipe-assign   { background: #1e3a5f; border-color: #1d4ed8; }
[data-theme="dark"] .ds-pipe-sched    { background: #14532d; border-color: #166534; }
[data-theme="dark"] .ds-pipe-review   { background: #431407; border-color: #c2410c; }
[data-theme="dark"] .ds-pipe-approved { background: #052e16; border-color: #166534; }
[data-theme="dark"] .ds-pipe-sent     { background: #2e1065; border-color: #6d28d9; }

/* Accept job button accent color */
.mj-ribbon-accepted { background: #166534; color: #fff; }
.mj-job-accepted { border-left: 4px solid #166534; }

/* ===================================================================
   All Inspections page — workflow badges, assign modal, mobile cards
   =================================================================== */

/* ── Tighter page header on Inspections page ─────────────────────── */
.ppai-header-tight { margin-bottom: .75rem; }

/* ── Tighter dash-card ────────────────────────────────────────────── */
.dash-card-tight { padding: .75rem; }
.dash-card-tight .table-wrap { margin: 0 -.75rem; border-radius: 0 0 12px 12px; overflow: hidden; }

/* ── Tighter toolbar ──────────────────────────────────────────────── */
.cst-toolbar-tight { padding: .5rem .75rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.pio-search-wrap { flex: 0 0 auto; }
.pio-search-input {
  padding: .38rem .75rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: .87rem;
  background: #f8fafc;
  color: #1e293b;
  width: 260px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.pio-search-input:focus { border-color: #1a56db; box-shadow: 0 0 0 2px rgba(26,86,219,.15); background: #fff; }

/* ── Workflow Badges ──────────────────────────────────────────────── */
.wf-badge {
    display: inline-flex;
    align-items: center;
    padding: .22rem .65rem;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: .01em;
}
.wf-unassigned { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.wf-assigned   { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.wf-inprogress { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.wf-submitted  { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.wf-reviewed   { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.wf-sent       { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* ── Row actions column — Assign Tech + ⋮ side by side ───────────── */
.insp-row-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    justify-content: flex-end;
}
.btn-assign-tech {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    font-size: .72rem;
    font-weight: 700;
    color: #1e293b;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, border-color .12s;
}
.btn-assign-tech:hover {
    background: #e2e8f0;
    border-color: #64748b;
}

/* ── Assign Technician Modal ──────────────────────────────────────── */
.assign-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    align-items: center;
    justify-content: center;
}
.assign-modal.assign-modal-open {
    display: flex;
}
.assign-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}
.assign-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: min(420px, 92vw);
    overflow: hidden;
}
.assign-modal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem .8rem;
    border-bottom: 1px solid #e2e8f0;
}
.assign-modal-title {
    font-size: .95rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}
.assign-modal-close {
    background: none;
    border: none;
    font-size: 1rem;
    color: #64748b;
    cursor: pointer;
    padding: .2rem .4rem;
    border-radius: 4px;
    line-height: 1;
    transition: background .1s;
}
.assign-modal-close:hover { background: #f1f5f9; color: #1e293b; }
.assign-modal-body {
    padding: 1rem 1.25rem;
}
.assign-modal-sub {
    font-size: .8rem;
    color: #64748b;
    font-weight: 600;
    margin: 0 0 .75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.assign-modal-label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .4rem;
}
.assign-modal-select {
    width: 100%;
    padding: .55rem .75rem;
    font-size: .9rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #1e293b;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    padding-right: 2rem;
    cursor: pointer;
}
.assign-modal-select:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.assign-modal-ft {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .6rem;
    padding: .75rem 1.25rem 1rem;
    border-top: 1px solid #f1f5f9;
}
.btn-modal-cancel {
    padding: .45rem 1rem;
    font-size: .82rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s;
}
.btn-modal-cancel:hover { background: #e2e8f0; }
.btn-modal-save {
    padding: .45rem 1.1rem;
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    background: #1a56db;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s;
}
.btn-modal-save:hover { background: #1a3db3; }

/* ── Mobile responsive inspection cards ──────────────────────────── */
@media (max-width: 767px) {
    #cstTable thead { display: none; }

    #cstTable,
    #cstTable tbody { display: block; }

    #cstTable tbody tr.cst-row {
        display: block;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        margin: 0 0 .65rem;
        overflow: hidden;
        box-shadow: 0 1px 4px rgba(0,0,0,.06);
        cursor: pointer;
    }

    #cstTable tbody td {
        display: flex;
        align-items: flex-start;
        padding: .5rem .75rem;
        border-bottom: 1px solid #f1f5f9;
        font-size: .82rem;
        gap: .5rem;
    }
    #cstTable tbody td:last-child { border-bottom: none; }

    #cstTable tbody td::before {
        content: attr(data-label);
        font-size: .68rem;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: .05em;
        min-width: 70px;
        flex-shrink: 0;
        padding-top: .1rem;
    }

    #cstTable td[data-label="Customer"] {
        flex-direction: column;
        gap: 0;
        padding-top: .65rem;
    }
    #cstTable td[data-label="Customer"]::before { margin-bottom: .15rem; }

    #cstTable td[data-label="Customer"] .ins-name-link {
        font-size: .92rem;
        font-weight: 700;
    }
    #cstTable td[data-label="Customer"] .ins-vehicle {
        font-size: .75rem;
    }

    #cstTable td[data-label="Workflow"] { align-items: center; }

    .row-actions-td {
        padding: .6rem .75rem !important;
    }
    .insp-row-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .btn-assign-tech {
        padding: .4rem .9rem;
        font-size: .78rem;
    }

    .dash-card-tight { padding: .6rem; }
    .cst-toolbar-tight { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .5rem .6rem; }
    .cst-toolbar-right { width: 100%; }
    .cst-filter-form { flex-wrap: wrap; gap: .35rem; }
}

/* ── Dark mode — workflow badges ──────────────────────────────────── */
[data-theme="dark"] .wf-unassigned { background: #1e293b; color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .wf-assigned   { background: #1e3a5f; color: #93c5fd; border-color: #1d4ed8; }
[data-theme="dark"] .wf-inprogress { background: #3f3007; color: #fcd34d; border-color: #92400e; }
[data-theme="dark"] .wf-submitted  { background: #2e1065; color: #c4b5fd; border-color: #6d28d9; }
[data-theme="dark"] .wf-reviewed   { background: #042f2e; color: #5eead4; border-color: #0f766e; }
[data-theme="dark"] .wf-sent       { background: #052e16; color: #86efac; border-color: #166534; }

/* ── Dark mode — assign modal ─────────────────────────────────────── */
[data-theme="dark"] .assign-modal-box      { background: #1e293b; }
[data-theme="dark"] .assign-modal-hd       { border-color: #334155; }
[data-theme="dark"] .assign-modal-title    { color: #f1f5f9; }
[data-theme="dark"] .assign-modal-close    { color: #94a3b8; }
[data-theme="dark"] .assign-modal-close:hover { background: #334155; color: #f1f5f9; }
[data-theme="dark"] .assign-modal-label    { color: #94a3b8; }
[data-theme="dark"] .assign-modal-sub      { color: #64748b; }
[data-theme="dark"] .assign-modal-select   { background: #0f172a; border-color: #334155; color: #f1f5f9; }
[data-theme="dark"] .assign-modal-ft       { border-color: #334155; }
[data-theme="dark"] .btn-modal-cancel      { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .btn-modal-cancel:hover { background: #334155; }

/* ── Dark mode — assign tech button ──────────────────────────────── */
[data-theme="dark"] .btn-assign-tech       { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .btn-assign-tech:hover { background: #334155; border-color: #475569; color: #f1f5f9; }

/* ── Dark mode — mobile cards ─────────────────────────────────────── */
[data-theme="dark"] #cstTable tbody tr.cst-row { border-color: #334155; background: #1e293b; }
[data-theme="dark"] #cstTable tbody td         { border-color: #334155; }
