/* ============================================================================
   CARDINAL HEATING & COOLING — "Precision Technical" identity.
   Loaded only for the HVAC pack, so it re-skins the entire shared UI kit into a
   distinct clean-modern-mechanical SaaS product without touching other packs.
   Language: cool light field with a quiet DOTTED technical motif, white panels,
   a calibrated blue accent, slate ink, Archivo display type (sentence/title
   case — never shouty), 6px geometry, crisp thin borders, cool light shadows.
   Deliberately the OPPOSITE of the construction pack's dark steel + orange +
   uppercase-Oswald + blueprint-line-grid language.
   ============================================================================ */
:root {
    --accent: #2f7dd1;            /* calibrated blue */
    --accent-deep: #1f5fa8;       /* deep blue (hovers / pressed) */
    --accent-soft: #e7f0fa;       /* pale blue wash */
    --accent-tint: #f1f6fc;       /* faintest blue field */
    --bg: #eef3f8;               /* cool very-light field w/ faint blue cast */
    --panel: #ffffff;
    --ink: #16202b;              /* slate ink */
    --ink-soft: #5b6b7b;         /* soft slate */
    --line: #dde5ec;             /* cool hairline */
    --line-soft: #e8eef4;
    --side: #16202b;             /* dark slate sidebar */
    --side-2: #1b2733;
    --side-ink: #9fb0c2;
    --side-ink-bright: #ffffff;
    --display-font: "Archivo", "Segoe UI", sans-serif;
    --radius: 6px;
    --shadow: 0 1px 2px rgba(22,32,43,.05), 0 14px 30px -22px rgba(31,95,168,.40);
    --dot: rgba(47,125,209,.10);  /* technical dot color */
}

/* ---------------- Body: cool field + quiet dotted technical motif --------- */
body {
    font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background-color: var(--bg);
    /* a subtle dotted grid — precise but extremely quiet (dots, not lines) */
    background-image: radial-gradient(var(--dot) 1.1px, transparent 1.2px);
    background-size: 22px 22px;
    background-position: -11px -11px;
}

/* ---------------- Sidebar: dark slate instrument rail --------------------- */
.side {
    background: linear-gradient(180deg, var(--side-2), var(--side));
    border-right: 1px solid #0d151d;
}
.brand { border-bottom: 1px solid rgba(255,255,255,.07); margin: -2px -6px 12px; padding: 6px 14px 16px; }
.brand-mark {
    background: linear-gradient(160deg, #3a8be0, var(--accent));
    border-radius: var(--radius);
    box-shadow: 0 0 0 3px rgba(47,125,209,.20), inset 0 1px 0 rgba(255,255,255,.25);
    font-family: var(--display-font); font-weight: 700;
}
.brand-name { font-family: var(--display-font); font-weight: 700; letter-spacing: -.3px; }
.brand-pack { font-size: 11px; letter-spacing: .03em; color: #7e93a8; opacity: .9; }
.nav-link {
    border-radius: var(--radius); font-size: 13px; font-weight: 500;
    color: #9fb0c2; letter-spacing: -.1px;
    border-left: 2px solid transparent; padding-left: 10px;
    transition: background .14s, color .14s, border-color .14s;
}
.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link.active {
    background: linear-gradient(90deg, rgba(47,125,209,.26), rgba(47,125,209,.06));
    color: #fff; border-left-color: var(--accent);
}
.nav-link.active .nav-ico { color: #6fb0f0; opacity: 1; }
.side-foot { font-size: 11px; letter-spacing: .02em; color: #6c8097; opacity: .7; }

/* ---------------- Topbar ------------------------------------------------- */
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }
.client-id { font-size: 14.5px; }
.client-id strong { font-family: var(--display-font); font-weight: 700; letter-spacing: -.3px; }
.client-id .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 3px rgba(47,125,209,.18);
}
.switcher select { border-radius: var(--radius); }
.switcher select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------------- Page header: precise, sentence case, blue keyline ------ */
.page-head { position: relative; margin-bottom: 22px; padding-left: 15px; }
.page-head::before {
    content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-deep));
    border-radius: 3px;
}
.page-head h1 {
    font-family: var(--display-font); font-weight: 700; letter-spacing: -.5px;
    font-size: 24px; color: var(--ink);
}
.page-head .sub { font-size: 13px; color: var(--ink-soft); letter-spacing: 0; }
.page-head .back { font-size: 12.5px; font-weight: 500; }
.page-head .back:hover { color: var(--accent); }

/* ---------------- KPI cards: white, airy, blue accent + corner gradient -- */
.kpis { gap: 13px; }
.kpi-card {
    position: relative; overflow: hidden;
    border-radius: var(--radius); border: 1px solid var(--line);
    border-top: 2px solid var(--accent);
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(47,125,209,.055), transparent 42%),
        var(--panel);
    box-shadow: var(--shadow); padding: 16px 18px 15px;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(22,32,43,.06), 0 20px 38px -22px rgba(31,95,168,.55);
    border-color: #cfdcea;
}
.kpi-ic {
    color: var(--accent); background: var(--accent-soft);
    border-radius: var(--radius); padding: 6px; top: 13px; right: 13px;
    box-shadow: inset 0 0 0 1px rgba(47,125,209,.10);
}
.kpi-ic svg { width: 18px; height: 18px; opacity: 1; }
.kpi-lab { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--ink-soft); }
.kpi-num { font-family: var(--display-font); font-weight: 700; font-size: 31px; color: var(--ink); letter-spacing: -.8px; line-height: 1.06; }
.kpi-delta { font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.kpi-delta.up { color: #2c7a48; }
.kpi-delta.down { color: #b3392f; }

/* ---------------- Panels: clean instrument cards ------------------------- */
.rpanel { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel-h {
    background: linear-gradient(180deg, #ffffff, var(--accent-tint));
    border-bottom: 1px solid var(--line); padding: 13px 18px;
}
.panel-h h3 {
    font-family: var(--display-font); font-weight: 700; letter-spacing: -.3px;
    font-size: 14.5px; color: var(--ink);
    display: flex; align-items: center; gap: 9px;
}
.panel-h h3::before {                        /* small blue indicator dot */
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 3px rgba(47,125,209,.16);
    flex: none;
}
.panel-sub { font-weight: 400; color: var(--ink-soft); font-size: 12px; letter-spacing: 0; }
.panel-act a { color: var(--accent); font-weight: 600; font-size: 12.5px; text-decoration: none; }
.panel-act a:hover { color: var(--accent-deep); }
.panel-b { padding: 16px 18px; }

/* List rows */
.list-row { border-bottom: 1px solid var(--line-soft); }
a.list-row:hover { background: var(--accent-tint); }
.list-row .grow b { font-weight: 600; }

/* ---------------- Tables: cool light register --------------------------- */
table.data.card, table.data { border-radius: var(--radius); }
table.data thead th {
    background: #eaf0f6;                      /* cool light slate / pale blue-gray */
    color: #46596b; border-bottom: 1px solid var(--line);
    text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; font-weight: 600;
    padding: 11px 14px;
}
table.data thead th:first-child { border-top-left-radius: var(--radius); }
table.data thead th:last-child  { border-top-right-radius: var(--radius); }
table.data td { border-bottom: 1px solid var(--line-soft); font-size: 13px; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:nth-child(even) td { background: #fafcfe; }
table.data tbody tr.clickable:hover td { background: var(--accent-tint); }
table.data td .num, table.data .num { font-variant-numeric: tabular-nums; }

/* ---------------- Badges: crisp cool pills ------------------------------ */
.badge {
    display: inline-block; border-radius: 4px; padding: 3px 8px;
    font-size: 11px; font-weight: 600; letter-spacing: .01em; line-height: 1.5;
    border: 1px solid transparent; background: #eef2f7; color: #51606f;
}

/* done / paid / active — green */
.badge-completed, .badge-paid, .badge-active, .badge-complete, .badge-won,
.badge-accepted, .badge-confirmed, .badge-replied {
    background: #e2f2e6; color: #2c7a48; border-color: #c5e6d0;
}
/* scheduled / standard / queued — blue */
.badge-scheduled, .badge-pending, .badge-standard, .badge-new, .badge-draft,
.badge-sent, .badge-quote-sent {
    background: var(--accent-soft); color: #2563ab; border-color: #cfe1f4;
}
/* en-route / on-site / maintenance / in-flight — amber/orange */
.badge-en-route, .badge-on-site, .badge-maintenance, .badge-priority,
.badge-needs-reply {
    background: #fdeedd; color: #ad6312; border-color: #f3ddc2;
}
/* invoiced — warm gold */
.badge-invoiced { background: #f3edd9; color: #8a6d1f; border-color: #e6dcb8; }
/* emergency / cancelled / no-show / expired — red */
.badge-emergency, .badge-cancelled, .badge-no-show, .badge-expired,
.badge-lost, .badge-overdue, .badge-declined, .badge-inactive, .badge-void {
    background: #fbe1dc; color: #b03325; border-color: #f3c8c0;
}
/* quote — violet */
.badge-quote { background: #efe9fb; color: #6d4bb3; border-color: #ddd2f4; }

/* plan tiers — gold / silver / bronze */
.badge-gold,   .badge-plan-gold   { background: #f7eecb; color: #8a6d1f; border-color: #ecdfae; }
.badge-silver, .badge-plan-silver { background: #eceef1; color: #56606c; border-color: #d9dde2; }
.badge-bronze, .badge-plan-bronze { background: #f1e3d6; color: #8a5a2f; border-color: #e3cdb8; }

/* customer type */
.badge-commercial, .badge-type-commercial { background: var(--accent-soft); color: #2563ab; border-color: #cfe1f4; }
.badge-residential, .badge-type-residential { background: #eef2f7; color: var(--ink-soft); border-color: var(--line); }

/* ---------------- Atoms -------------------------------------------------- */
.pill {
    border-radius: 4px; font-size: 11px; font-weight: 600; letter-spacing: .01em;
    background: #eef2f7; border: 1px solid var(--line); color: var(--ink-soft);
}
.pill.prio-emergency { background: #fbe1dc; color: #b03325; border-color: #f3c8c0; }
.pill.prio-priority  { background: #fdeedd; color: #ad6312; border-color: #f3ddc2; }
.pill.prio-standard  { background: #eef2f7; color: var(--ink-soft); border-color: var(--line); }
.pill.prio-maintenance { background: #e2f2e6; color: #2c7a48; border-color: #c5e6d0; }
.pill.prio-quote     { background: #efe9fb; color: #6d4bb3; border-color: #ddd2f4; }

.rprogress { height: 7px; background: #e3ebf2; border: 1px solid var(--line); border-radius: 999px; }
.rprogress i { background: linear-gradient(90deg, var(--accent), #5aa0e6); border-radius: 999px; }

.datebox {
    background: linear-gradient(180deg, #ffffff, var(--accent-tint));
    border: 1px solid var(--line); border-radius: var(--radius);
    color: var(--ink);
}
.datebox b { font-family: var(--display-font); color: var(--ink); }
.datebox span { color: var(--accent); }

.avatar {
    border-radius: var(--radius);
    background: linear-gradient(160deg, #3a8be0, var(--accent));
    font-family: var(--display-font); font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.feed-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(47,125,209,.14); }

/* ---------------- Buttons: blue primary w/ soft focus ring -------------- */
.btn {
    border-radius: var(--radius); font-weight: 600; font-size: 13px;
    border: 1px solid var(--line);
}
.btn:hover { background: var(--accent-tint); border-color: #cfdcea; }
.btn-primary {
    background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: 0 1px 2px rgba(31,95,168,.25);
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); filter: none; }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(47,125,209,.30); }
.btn-danger { color: #b03325; border-color: #f0c8c4; background: #fff; }
.btn-danger:hover { background: #fbe1dc; }

/* ---------------- Generic detail (customers / equipment / etc.) --------- */
.detail.card { border-radius: var(--radius); }
.detail-key {
    background: var(--accent-tint); color: var(--ink-soft);
    font-weight: 600; font-size: 12.5px;
}

/* Forms / search focus rings — keep the cool blue ring consistent */
.search input { border-radius: var(--radius); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
