@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
/* ==========================================================================
   Alphatronics CRM — design system
   Reconstructed from the static mockups. Single stylesheet, no build step.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
    /* Brand */
    --cyan: #00b8d4;
    --cyan-dk: #0097a7;
    --cyan-soft: #e0f7fa;
    --auth-teal: #12b8ac;
    --auth-teal-dk: #0ea298;
    --violet: #7c5cfc;
    --violet-soft: #efeaff;
    --emerald: #16a34a;
    --emerald-soft: #e7f7ed;
    --amber: #f5a623;
    --amber-soft: #fdf3e0;
    --coral: #ef4444;
    --coral-soft: #fdeaea;

    /* Surfaces */
    --canvas: #f4f6f9;
    --surface: #ffffff;
    --shell: #121316;
    --shell-2: #212328;

    /* Ink */
    --ink: #10131a;
    --ink-2: #6b7688;
    --ink-3: #9aa4b5;
    --ink-inv: #e8edf5;

    /* Lines & shadow */
    --line: #e4e8ef;
    --line-2: #eef1f6;
    --shadow-sm: 0 1px 2px rgba(16, 19, 26, 0.05);
    --shadow: 0 2px 8px rgba(16, 19, 26, 0.06);
    --shadow-lg: 0 12px 32px rgba(16, 19, 26, 0.14);

    /* Type */
    --disp: "Inter", sans-serif;
    --body: "Inter", sans-serif;
    --mono: "Inter", sans-serif;

    /* Metrics */
    --sidebar-w: 244px;
    --topbar-h: 62px;
    --r: 12px;
    --r-sm: 8px;
}

/* ---------- 2. Reset ----------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--disp);
    font-weight: 600;
    line-height: 1.25;
}

a {
    color: var(--cyan-dk);
    text-decoration: none;
}

a:hover {
    color: var(--cyan);
}

img,
svg {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* Every inline SVG in the markup relies on these defaults. */
svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* ---------- 3. App shell ------------------------------------------------- */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--shell);
    color: var(--ink-inv);
    display: flex;
    flex-direction: column;
    z-index: 60;
    overflow-y: auto;
}

.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    flex: 0 0 var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.content {
    flex: 1;
    padding: 22px;
    width: 100%;
    /* max-width: 1500px; */
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 19, 26, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    z-index: 55;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ---------- 4. Sidebar --------------------------------------------------- */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 16px;
}

.brand-logo {
    display: block;
    line-height: 0;
}

.brand-logo img {
    width: 100%;
    max-width: 190px;
    height: auto;
    display: block;
}

.nav-sec {
    padding: 14px 14px 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: #55627a;
}

.nav {
    padding: 0 10px 18px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: var(--r-sm);
    color: #a9b4c7;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.nav a svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    opacity: 0.85;
}

.nav a:hover {
    background: var(--shell-2);
    color: #fff;
}

.nav a.active {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.nav a.active svg {
    opacity: 1;
}

.nav a .tag {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 20px;
    background: var(--coral);
    color: #fff;
}

.side-foot {
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ---------- 5. Topbar ---------------------------------------------------- */
.search {
    position: relative;
    flex: 1;
    max-width: 380px;
}

.search svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--ink-3);
    stroke: currentColor;
}

.search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--canvas);
    font-size: 13px;
    outline: none;
}

.search input:focus {
    border-color: var(--cyan);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 184, 212, 0.13);
}

.topbar .spacer {
    flex: 1;
}

.icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.icon-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan-dk);
}

.icon-btn svg {
    stroke: currentColor;
}

.icon-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--coral);
    border: 1.5px solid #fff;
}

.burger {
    display: none;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    cursor: pointer;
}

.user-chip:hover {
    border-color: var(--cyan);
}

.user-chip .av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--cyan-dk);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--disp);
}

.user-chip .who {
    text-align: left;
    line-height: 1.15;
}

.user-chip .who b {
    font-size: 12.5px;
    display: block;
}

.user-chip .who small {
    font-size: 10.5px;
    color: var(--ink-2);
}

/* Dropdown (topbar user menu) */
.menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    z-index: 70;
}

.menu.show {
    display: block;
}

.menu a,
.menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--r-sm);
    background: none;
    color: var(--ink);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.menu a:hover,
.menu button:hover {
    background: var(--canvas);
    color: var(--ink);
}

.menu svg {
    width: 15px;
    height: 15px;
    color: var(--ink-2);
    stroke: currentColor;
}

.menu hr {
    border: 0;
    border-top: 1px solid var(--line-2);
    margin: 5px 0;
}

.menu-wrap {
    position: relative;
}

/* ---------- 6. Page head ------------------------------------------------- */
.page {
    display: none;
}

.page.show {
    display: block;
    animation: rise 0.22s ease;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.eyebrow {
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--cyan-dk);
    margin-bottom: 3px;
}

.page-head h2 {
    font-size: 24px;
    letter-spacing: -0.02em;
}

.page-head p {
    font-size: 13px;
    color: var(--ink-2);
    margin-top: 3px;
}

.head-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

/* ---------- 7. Buttons --------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--body);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.btn:active {
    transform: translateY(1px);
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.btn-primary {
    background: var(--auth-teal);
    color: #fff;
}

.btn-primary:hover {
    background: var(--auth-teal-dk);
    color: #fff;
}

.btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}

.btn-ghost:hover {
    border-color: var(--cyan);
    color: var(--cyan-dk);
}

.btn-danger {
    background: var(--coral);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    color: #fff;
}

.btn-sm {
    padding: 6px 11px;
    font-size: 12px;
}

/* ---------- 8. Cards & grid ---------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    /* overflow: hidden; */
}

.card-pad {
    padding: 16px;
}

.card-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-2);
}

.card-h h3 {
    font-size: 14.5px;
}

.card-h a {
    font-size: 12.5px;
    font-weight: 500;
}

.grid {
    display: grid;
    gap: 16px;
}

.g2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.g3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.g4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- 9. KPI tiles ------------------------------------------------- */
.kpi {
    position: relative;
    overflow: hidden;
}

.kpi .circuit {
    position: absolute;
    right: -14px;
    top: -14px;
    width: 92px;
    height: 92px;
    color: var(--cyan);
    opacity: 0.07;
    stroke: currentColor;
}

.kpi .ic {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    margin-bottom: 11px;
}

.kpi .ic svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.ic.c {
    background: var(--cyan-soft);
    color: var(--cyan-dk);
}

.ic.v {
    background: var(--violet-soft);
    color: var(--violet);
}

.ic.g {
    background: var(--emerald-soft);
    color: var(--emerald);
}

.ic.a {
    background: var(--amber-soft);
    color: #b26a00;
}

.ic.r {
    background: var(--coral-soft);
    color: var(--coral);
}

.kpi label {
    font-size: 12px;
    color: var(--ink-2);
    display: block;
}

.kpi .val {
    font-family: var(--disp);
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 2px 0 7px;
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 500;
}

.trend svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

.trend.up {
    color: var(--emerald);
}

.trend.dn {
    color: var(--coral);
}

/* ---------- 10. Pills & chips -------------------------------------------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.p-blue {
    background: var(--cyan-soft);
    color: var(--cyan-dk);
}

.p-violet {
    background: var(--violet-soft);
    color: var(--violet);
}

.p-green {
    background: var(--emerald-soft);
    color: var(--emerald);
}

.p-amber {
    background: var(--amber-soft);
    color: #b26a00;
}

.p-red {
    background: var(--coral-soft);
    color: var(--coral);
}

.p-gray {
    background: var(--canvas);
    color: var(--ink-2);
}

.margin-chip {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    background: var(--emerald-soft);
    color: var(--emerald);
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 500;
}

.countdown {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.cd-urgent {
    background: var(--coral-soft);
    color: var(--coral);
}

.cd-soon {
    background: var(--amber-soft);
    color: #b26a00;
}

.cd-ok {
    background: var(--emerald-soft);
    color: var(--emerald);
}

/* ---------- 11. Tables --------------------------------------------------- */
.tbl-wrap {
    overflow-x: auto;
}

table thead th {
    padding: 10px 14px;
    text-align: left;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-2);
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

table tbody td {
    padding: 12px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
}

table tbody tr:last-child td {
    border-bottom: 0;
}

table tbody tr:hover {
    background: #fafbfd;
}

.rec-id {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--cyan-dk);
    white-space: nowrap;
}

.money {
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

.cust-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cust-av {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    font-family: var(--disp);
    font-size: 11.5px;
    font-weight: 600;
}

.cust-cell b {
    font-size: 13px;
    display: block;
}

.cust-cell small {
    font-size: 11.5px;
    color: var(--ink-2);
}

.empty {
    padding: 44px 16px;
    text-align: center;
    color: var(--ink-2);
}

.empty svg {
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    color: var(--ink-3);
    stroke: currentColor;
}

/* ---------- 12. Tabs ----------------------------------------------------- */
.tabbar {
    display: flex;
    gap: 3px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.tab {
    padding: 8px 13px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--ink);
}

.tab.active {
    color: var(--cyan-dk);
    border-bottom-color: var(--cyan);
}

.card-h .tabbar {
    border-bottom: 0;
}

/* ---------- 13. Kanban --------------------------------------------------- */
.kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.kan-col {
    background: #eef1f6;
    border-radius: var(--r);
    padding: 11px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
}

/* Each lane scrolls independently and lazy-loads more cards. */
.kan-body {
    overflow-y: auto;
    max-height: 62vh;
    padding-right: 2px;
    scrollbar-width: thin;
}

.kan-empty {
    font-size: 12px;
    color: var(--ink-3);
    padding: 8px 2px;
}

.kan-col.is-drop-target {
    outline: 2px dashed var(--cyan);
    outline-offset: -2px;
    background: #e6f4f7;
}

.kan-card.is-dragging {
    opacity: 0.45;
}

.kan-card[draggable="true"] {
    cursor: grab;
}

.kan-col-h {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 11px;
}

.kan-col-h .cnt {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-2);
}

.kan-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 11px;
    margin-bottom: 9px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.kan-card:hover {
    border-color: var(--cyan);
    box-shadow: var(--shadow);
}

.kan-card .kid {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-3);
    margin-bottom: 4px;
}

.kan-card h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 9px;
}

.kan-card .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11.5px;
    color: var(--ink-2);
}

.kan-tech {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tech-av {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--amber);
    color: #fff;
    font-size: 9.5px;
    font-weight: 600;
    font-family: var(--disp);
}

/* ---------- 14. Charts (CSS only) ---------------------------------------- */
.bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 190px;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    max-width: 46px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--cyan), var(--cyan-dk));
    transition: height 0.4s ease;
}

.bar.alt {
    background: linear-gradient(180deg, #cfd7e3, #b6c0d0);
}

.bar.lost {
    background: linear-gradient(180deg, #f87171, var(--coral));
}

.bar-col small {
    font-size: 11px;
    color: var(--ink-2);
}

.funnel {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.fn-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fn-row .lbl {
    flex: 0 0 78px;
    font-size: 12px;
    color: var(--ink-2);
}

.fn-track {
    flex: 1;
    height: 26px;
    border-radius: 6px;
    background: var(--canvas);
    overflow: hidden;
}

.fn-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 9px;
    border-radius: 6px;
    color: #fff;
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 500;
    transition: width 0.4s ease;
}

.mini-prog {
    height: 6px;
    border-radius: 4px;
    background: var(--canvas);
    overflow: hidden;
    min-width: 70px;
}

.mini-prog i {
    display: block;
    height: 100%;
    border-radius: 4px;
}

/* ---------- 15. Timeline ------------------------------------------------- */
.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 1px;
    background: var(--line);
}

.tl-item {
    position: relative;
    padding-bottom: 16px;
}

.tl-item:last-child {
    padding-bottom: 0;
}

.tl-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-soft);
}

.tl-dot.g {
    background: var(--emerald);
    box-shadow: 0 0 0 3px var(--emerald-soft);
}

.tl-dot.a {
    background: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-soft);
}

.tl-dot.v {
    background: var(--violet);
    box-shadow: 0 0 0 3px var(--violet-soft);
}

.tl-item h4 {
    font-size: 13px;
    font-weight: 600;
}

.tl-item time {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    color: var(--ink-3);
}

.tl-item p {
    font-size: 12.5px;
    color: var(--ink-2);
    margin-top: 2px;
}

/* ---------- 16. Reminder rows -------------------------------------------- */
.rem-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line-2);
}

.rem-row:last-child {
    border-bottom: 0;
}

.rem-cal {
    flex: 0 0 42px;
    text-align: center;
    padding: 5px 0;
    border-radius: var(--r-sm);
    background: var(--canvas);
    border: 1px solid var(--line);
}

.rem-cal b {
    display: block;
    font-family: var(--disp);
    font-size: 15px;
    line-height: 1.1;
}

.rem-cal small {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--ink-2);
}

.rem-row .body {
    flex: 1;
    min-width: 0;
}

.rem-row .body b {
    display: block;
    font-size: 13px;
}

.rem-row .body small {
    font-size: 11.5px;
    color: var(--ink-2);
}

/* ---------- 17. Quote builder -------------------------------------------- */
.quote-line {
    display: grid;
    grid-template-columns: 2.4fr 0.6fr 1fr 1fr 38px;
    gap: 7px;
    align-items: center;
    margin-bottom: 7px;
}

.quote-line input {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    font-size: 12.5px;
    outline: none;
}

.quote-line input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 184, 212, 0.13);
}

.quote-tot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    color: var(--ink-2);
}

.quote-tot.grand {
    margin-top: 7px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
    font-family: var(--disp);
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
}

/* ---------- 18. Roles ---------------------------------------------------- */
.role-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.role-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.rc-ic {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    margin-bottom: 11px;
}

.rc-ic svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.role-card h4 {
    font-size: 14.5px;
}

.role-card > p {
    font-size: 12px;
    color: var(--ink-2);
    margin-top: 2px;
}

.perm-list {
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid var(--line-2);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.perm {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--ink-2);
}

.perm svg {
    width: 13px;
    height: 13px;
    color: var(--emerald);
    stroke: currentColor;
}

/* ---------- 19. Settings rows -------------------------------------------- */
.set-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line-2);
}

.set-row:last-child {
    border-bottom: 0;
}

.set-row .body {
    flex: 1;
    min-width: 0;
}

.set-row .body b {
    display: block;
    font-size: 13px;
}

.set-row .body small {
    font-size: 11.5px;
    color: var(--ink-2);
}

.tgl {
    flex: 0 0 42px;
    width: 42px;
    height: 23px;
    border-radius: 20px;
    background: #cbd3e0;
    position: relative;
    cursor: pointer;
    transition: background 0.18s;
}

.tgl::after {
    content: '';
    position: absolute;
    top: 2.5px;
    left: 2.5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s;
}

.tgl.on {
    background: var(--emerald);
}

.tgl.on::after {
    transform: translateX(19px);
}

.tgl.sm {
    flex: 0 0 34px;
    width: 34px;
    height: 19px;
}

.tgl.sm::after {
    width: 14px;
    height: 14px;
}

.tgl.sm.on::after {
    transform: translateX(15px);
}

/* ---------- Inline date filter ------------------------------------------- */
.date-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink-2);
    white-space: nowrap;
}

.date-field input[type="date"] {
    width: auto;
    padding: 6px 8px;
    font-size: 12.5px;
}

/* ---------- Permission matrix (Add / Edit user) -------------------------- */
.perm-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 6px;
}

.perm-module {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface, #fff);
    overflow: hidden;
}

.perm-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
}

.perm-head .body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.perm-head .body b {
    font-size: 13.5px;
}

.perm-head .body small {
    font-size: 11.5px;
    color: var(--ink-2);
}

.perm-children {
    border-top: 1px solid var(--line);
    padding: 6px 14px 12px;
    display: flex;
    flex-direction: column;
}

.perm-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--ink);
}

.perm-child + .perm-child {
    border-top: 1px dashed var(--line);
}

.perm-hint {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--ink-2);
}

/* ---------- 20. Notification drawer -------------------------------------- */
.notif-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 348px;
    max-width: 88vw;
    background: #fff;
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.24s ease;
    z-index: 65;
    display: flex;
    flex-direction: column;
}

.notif-drawer.show {
    transform: translateX(0);
}

.notif-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
}

.notif-h h3 {
    font-size: 15px;
}

.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.notif-item {
    display: flex;
    gap: 11px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-2);
    color: inherit;
    text-decoration: none;
}

.notif-item:hover {
    background: var(--canvas);
}

.notif-item.is-unread {
    background: rgba(0, 151, 167, 0.06);
    box-shadow: inset 3px 0 0 var(--cyan);
}

.notif-item .ni {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
}

.notif-item .ni svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

.notif-item b {
    display: block;
    font-size: 12.5px;
}

.notif-item p {
    font-size: 11.5px;
    color: var(--ink-2);
    margin-top: 1px;
}

.notif-item time {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-3);
}

/* ---------- 21. Forms ---------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-2);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
    min-height: 92px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 184, 212, 0.13);
}

.field .err {
    font-size: 11.5px;
    color: var(--coral);
}

.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid {
    border-color: var(--coral);
}

/* Mandatory-field marker beside a label. */
.req {
    color: var(--coral);
    font-weight: 600;
    margin-left: 2px;
}

/* Password input paired with a show/hide button. */
.pw-wrap {
    position: relative;
    display: block;
}

.pw-wrap input {
    padding-right: 38px;
}

.pw-eye {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
}

.pw-eye:hover {
    color: var(--ink);
    background: var(--line-2);
}

.pw-eye svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke-width: 2;
}

.pw-eye .eye-off,
.pw-eye.is-visible .eye-on {
    display: none;
}

.pw-eye.is-visible .eye-off {
    display: block;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line-2);
}

/* ---------- 22. Flash & pagination --------------------------------------- */
.flash {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    border-radius: var(--r-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.flash svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
}

.flash-ok {
    background: var(--emerald-soft);
    border-color: #b9e6c9;
    color: #126030;
}

.flash-err {
    background: var(--coral-soft);
    border-color: #f6c2c2;
    color: #9b1c1c;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-top: 1px solid var(--line-2);
    font-size: 12.5px;
    color: var(--ink-2);
}

.pager .links {
    display: flex;
    gap: 4px;
}

.pager .links a,
.pager .links span {
    min-width: 30px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    text-align: center;
    color: var(--ink-2);
    background: #fff;
}

.pager .links a:hover {
    border-color: var(--cyan);
    color: var(--cyan-dk);
}

.pager .links .cur {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.pager .links .off {
    opacity: 0.45;
}

/* ---------- 23. Filter bar ----------------------------------------------- */
.ts-control .item{
    display: flex;
    align-items: center;
}
.filter-bar {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-2);
    overflow: unset !important;
}

.filter-bar input,
.filter-bar select {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    font-size: 12.5px;
    outline: none;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--cyan);
}

.filter-bar input[type='search'] {
    min-width: 220px;
}

/* ---------- 24. Responsive ----------------------------------------------- */
@media (max-width: 1200px) {
    .g4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .role-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.24s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .burger {
        display: grid;
    }

    .g2,
    .g3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .grid > .card[style*='span 2'] {
        grid-column: auto !important;
    }
}

@media (max-width: 720px) {
    .content {
        padding: 15px;
    }

    .g4,
    .role-grid,
    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .search {
        display: none;
    }

    .user-chip .who {
        display: none;
    }

    .quote-line {
        grid-template-columns: 1fr 1fr;
    }
}

@media print {
    .sidebar,
    .topbar,
    .notif-drawer,
    .overlay,
    .head-actions,
    .form-actions {
        display: none !important;
    }

    .main {
        margin-left: 0;
    }

    .card {
        box-shadow: none;
        break-inside: avoid;
    }
}


/* ---------- 25. Auth screens --------------------------------------------- */
.auth-body {
    background: var(--canvas);
}

.auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* Left brand panel -------------------------------------------------------- */
.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 44px 52px;
    background: #17181c;
    color: #e8edf5;
}

.auth-logo {
    position: relative;
    z-index: 2;
    display: block;
    line-height: 0;
}

.auth-logo img {
    width: 100%;
    max-width: 236px;
    height: auto;
    display: block;
}

.auth-pitch {
    position: relative;
    z-index: 2;
    margin: auto 0;
    max-width: 430px;
}

.auth-welcome {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-welcome-ic {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--auth-teal), var(--auth-teal-dk));
    box-shadow: 0 6px 18px rgba(18, 184, 172, 0.35);
}

.auth-welcome-ic svg {
    width: 23px;
    height: 23px;
    stroke: #fff;
}

.auth-welcome h1 {
    font-size: 30px;
    letter-spacing: -0.02em;
    color: #fff;
}

.auth-pitch > p {
    margin-top: 18px;
    max-width: 384px;
    font-size: 14.5px;
    line-height: 1.6;
    color: #9ba3b4;
}

.auth-points {
    list-style: none;
    padding: 0;
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: 14px;
    color: #d5dbe6;
}

.auth-points .ic {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #fff;
}

.auth-points .ic svg {
    width: 17px;
    height: 17px;
    stroke: var(--auth-teal-dk);
}

.auth-foot {
    position: relative;
    z-index: 2;
    font-size: 12px;
    color: #616b7d;
}

.auth-watermark {
    position: absolute;
    left: 26px;
    bottom: 70px;
    width: 290px;
    height: 290px;
    z-index: 1;
    pointer-events: none;
}

.auth-watermark svg {
    width: 100%;
    height: 100%;
    stroke: rgba(255, 255, 255, 0.05);
}

/* Right form panel -------------------------------------------------------- */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    background: var(--canvas);
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(16, 19, 26, 0.06);
    padding: 34px 34px 32px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 8px;
    background: var(--canvas);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 16px;
}

.auth-badge svg {
    width: 14px;
    height: 14px;
    stroke: var(--auth-teal-dk);
}

.auth-card h2 {
    font-size: 26px;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.auth-card > p {
    margin-top: 6px;
    font-size: 13.5px;
    color: var(--ink-2);
}

.auth-form {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-field > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.auth-field .opt {
    font-weight: 400;
    color: var(--ink-3);
}

.auth-inputwrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-inputwrap > .ic {
    position: absolute;
    left: 13px;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.auth-inputwrap > .ic svg {
    width: 17px;
    height: 17px;
    stroke: var(--ink-3);
}

.auth-inputwrap input {
    width: 100%;
    height: 44px;
    padding: 0 13px 0 40px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    font-family: var(--body);
    font-size: 14px;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-inputwrap input::placeholder {
    color: var(--ink-3);
}

.auth-inputwrap input:focus {
    outline: none;
    border-color: var(--auth-teal);
    box-shadow: 0 0 0 3px rgba(18, 184, 172, 0.14);
}

.auth-inputwrap.has-toggle input {
    padding-right: 44px;
}

.auth-inputwrap input.is-invalid {
    border-color: var(--coral);
}

.auth-inputwrap input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.auth-eye {
    position: absolute;
    right: 8px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    border-radius: 6px;
    color: var(--ink-3);
    cursor: pointer;
}

.auth-eye:hover {
    color: var(--ink-2);
}

.auth-eye svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.auth-eye .eye-off {
    display: none;
}

.auth-eye.is-visible .eye-on {
    display: none;
}

.auth-eye.is-visible .eye-off {
    display: block;
}

.auth-field .err {
    font-size: 12px;
    color: var(--coral);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.auth-row-end {
    justify-content: flex-end;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    cursor: pointer;
}

.auth-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-teal-dk);
    cursor: pointer;
}

.auth-row a,
.auth-alt a {
    color: var(--auth-teal-dk);
    font-weight: 600;
}

.auth-row a:hover,
.auth-alt a:hover {
    color: var(--auth-teal);
    text-decoration: underline;
}

.btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 46px;
    margin-top: 2px;
    border: 0;
    border-radius: 10px;
    background: var(--auth-teal);
    color: #fff;
    font-family: var(--body);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(18, 184, 172, 0.28);
    transition: background 0.15s, transform 0.05s;
}

.btn-auth:hover {
    background: var(--auth-teal-dk);
}

.btn-auth:active {
    transform: translateY(1px);
}

.btn-auth svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.auth-alt {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line-2);
    text-align: center;
    font-size: 13px;
    color: var(--ink-2);
}

/* Flash messages inside the card. */
.auth-card .flash {
    margin-top: 18px;
    margin-bottom: 0;
}

/* Demo sign-in shortcuts, only rendered outside production. */
.auth-demo {
    margin-top: 18px;
    padding: 13px;
    border: 1px dashed var(--line);
    border-radius: var(--r-sm);
    background: var(--canvas);
}

.auth-demo b {
    display: block;
    font-size: 11px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin-bottom: 9px;
}

.auth-demo .row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.auth-demo button {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    font-size: 11.5px;
    color: var(--ink-2);
    cursor: pointer;
}

.auth-demo button:hover {
    border-color: var(--auth-teal);
    color: var(--auth-teal-dk);
}

@media (max-width: 920px) {
    .auth {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-aside {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-main {
        padding: 24px 16px;
    }

    .auth-card {
        padding: 26px 22px;
        border-radius: 14px;
    }

    .auth-card h2 {
        font-size: 23px;
    }
}

/* ---------- 26. Customer register & form --------------------------------- */
.pay-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.pay-paid {
    background: var(--emerald);
    color: #fff;
}

.pay-unpaid {
    background: var(--coral);
    color: #fff;
}

.cust-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.cust-form > .col-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.cust-form > .col-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.sec-head {
    display: flex;
    align-items: center;
    gap: 9px;
}

.sec-head svg {
    width: 18px;
    height: 18px;
    stroke: var(--ink-2);
    flex: 0 0 18px;
}

.sec-head h3 {
    font-size: 15px;
    letter-spacing: -0.01em;
}

.sec-sub {
    margin: 3px 0 16px;
    font-size: 12.5px;
    color: var(--ink-2);
}

.tgl-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
}

.tgl-box .body {
    flex: 1;
    min-width: 0;
}

.tgl-box .body b {
    display: block;
    font-size: 13px;
}

.tgl-box .body small {
    font-size: 11.5px;
    color: var(--ink-2);
}

@media (max-width: 980px) {
    .cust-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- 27. Lead card phone & searchable owner filter ---------------- */
.kan-phone {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 9px;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-2);
}

.kan-phone svg {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    stroke: var(--ink-3);
}

.kan-phone:hover {
    color: var(--cyan-dk);
}

.kan-phone:hover svg {
    stroke: var(--cyan-dk);
}

/* Tom Select — align the owner filter with the app's inputs. */
.filter-bar .ts-wrapper {
    min-width: 200px;
    margin: 0;
}

.filter-bar .ts-control {
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    font-size: 12.5px;
    color: var(--ink);
    box-shadow: none;
}

.filter-bar .ts-wrapper.single .ts-control {
    background-image: none;
}

.filter-bar .ts-wrapper.single .ts-control::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--ink-3);
    border-bottom: 1.5px solid var(--ink-3);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.filter-bar .ts-wrapper.focus .ts-control {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 184, 212, 0.13);
}

.filter-bar .ts-control input {
    font-size: 12.5px;
    color: var(--ink);
}

.ts-dropdown {
    margin-top: 5px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-lg);
    font-size: 12.5px;
    color: var(--ink);
}

.ts-dropdown .option {
    padding: 8px 11px;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
    background: var(--cyan-soft);
    color: var(--cyan-dk);
}

.ts-dropdown .no-results {
    padding: 8px 11px;
    color: var(--ink-3);
}

/* ---------- 28. Quotation builder & register ----------------------------- */
.tabbar.pills {
    border-bottom: 0;
    gap: 6px;
    flex-wrap: wrap;
}

.tabbar.pills .tab {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 7px 14px;
    margin-bottom: 0;
}

.tabbar.pills .tab.active {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.inline-search {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-search input {
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    font-size: 12.5px;
    outline: none;
    min-width: 220px;
}

.inline-search input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 184, 212, 0.13);
}

.inline-search a {
    font-size: 12.5px;
    white-space: nowrap;
}

.quote-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.quote-main,
.quote-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.quote-layout .sec-head {
    margin-bottom: 14px;
}

.quote-layout input[readonly],
.quote-layout input:disabled {
    background: var(--canvas);
    color: var(--ink-2);
    cursor: default;
}

/* Saved particular cards */
.particular-card .card-pad {
    padding-top: 16px;
    padding-bottom: 16px;
}

.particular-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.particular-head h3 {
    font-size: 15px;
}

.particular-actions {
    display: flex;
    gap: 16px;
}

.particular-actions button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--auth-teal-dk);
}

.particular-actions button svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

.particular-actions button.danger {
    color: var(--coral);
}

.particular-desc {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--ink-2);
}

.particular-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 18px;
    margin-top: 14px;
}

.particular-grid label {
    display: block;
    font-size: 11.5px;
    color: var(--ink-2);
    margin-bottom: 3px;
}

.particular-grid b {
    font-size: 13px;
    font-weight: 600;
}

/* Tom Select — match the app's form inputs anywhere it is used. */
.ts-control {
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    font-size: 13px;
    color: var(--ink);
    box-shadow: none;
}

.ts-wrapper.single .ts-control {
    background-image: none;
    padding-right: 30px;
}

.ts-wrapper.single .ts-control::after {
    content: '';
    position: absolute;
    right: 13px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--ink-3);
    border-bottom: 1.5px solid var(--ink-3);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 184, 212, 0.13);
}

.ts-control input {
    font-size: 13px;
    color: var(--ink);
}

@media (max-width: 980px) {
    .quote-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- 29. Complaints & AMC service screens ------------------------- */
.crumb {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--ink-3);
    margin-bottom: 5px;
}

.crumb a {
    color: var(--ink-2);
}

.crumb a:hover {
    color: var(--auth-teal-dk);
}

.title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.head-filter select {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    outline: none;
}

.btn.is-active {
    border-color: var(--auth-teal);
    color: var(--auth-teal-dk);
}

/* Key/value display blocks on detail pages */
.kv-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.kv label {
    display: block;
    font-size: 11.5px;
    color: var(--ink-2);
    margin-bottom: 3px;
}

.kv .val {
    font-size: 14px;
    color: var(--ink);
    line-height: 1.55;
}

.assignee {
    display: flex;
    align-items: center;
    gap: 12px;
}

.assignee-av {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--disp);
}

.assignee b {
    display: block;
    font-size: 14px;
}

.assignee small {
    font-size: 12px;
    color: var(--ink-2);
}

/* Clickable register rows */
.row-link {
    cursor: pointer;
}

.row-link:hover {
    background: var(--canvas);
}

/* Complaint kanban board */
.cmp-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.cmp-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.cmp-col-h {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    padding: 2px;
}

.cmp-col-h .cnt {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-2);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 8px;
}

.dot.p-red {
    background: var(--coral);
}

.dot.p-amber {
    background: var(--amber);
}

.dot.p-green {
    background: var(--emerald);
}

.dot.p-blue {
    background: var(--cyan);
}

.dot.p-gray {
    background: var(--ink-3);
}

.cmp-col-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 96px;
    border-radius: var(--r);
    transition: background 0.15s, outline-color 0.15s;
}

.cmp-col.is-drop-target .cmp-col-body {
    outline: 2px dashed var(--cyan);
    outline-offset: 6px;
    background: #e6f4f7;
}

.board-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    font-size: 12.5px;
    color: var(--ink-2);
}

.board-hint svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke-width: 1.7;
}

.cmp-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.cmp-card:hover {
    border-color: var(--cyan);
    box-shadow: var(--shadow);
}

.cmp-card[draggable="true"] {
    cursor: grab;
}

.cmp-card.is-dragging {
    opacity: 0.45;
}

.cmp-card.is-saving {
    opacity: 0.6;
    pointer-events: none;
}

.cmp-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cmp-top .kid {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-3);
}

.cmp-edit {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: var(--ink-3);
}

.cmp-edit svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

.cmp-edit:hover {
    background: var(--canvas);
    color: var(--auth-teal-dk);
}

.cmp-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.cmp-title {
    font-size: 12.5px;
    color: var(--ink-2);
    margin-top: 3px;
}

.cmp-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid var(--line-2);
}

.cmp-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cmp-meta span {
    font-size: 12px;
    color: var(--ink-2);
}

.cmp-meta small {
    font-size: 11px;
    color: var(--ink-3);
}

.cmp-empty {
    font-size: 12px;
    color: var(--ink-3);
    padding: 8px 2px;
}

.report-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid var(--auth-teal);
    border-radius: 20px;
    color: var(--auth-teal-dk);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.report-chip svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
}

.report-chip:hover {
    background: rgba(18, 184, 172, 0.08);
    color: var(--auth-teal-dk);
}

@media (max-width: 900px) {
    .cmp-board {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- 30. Users, roles & assigned users ---------------------------- */
.ic.n {
    background: var(--canvas);
    color: var(--ink-2);
}

.stat-tile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-tile .ic {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin: 0;
}

.stat-tile .ic svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.stat-body b {
    display: block;
    font-family: var(--disp);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
}

.stat-body span {
    font-size: 12.5px;
    color: var(--ink-2);
}

/* Role/status pill with a leading colour dot */
.tag-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 20px;
    background: var(--canvas);
    font-size: 12px;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
}

.dot.p-violet {
    background: var(--violet);
}

/* Numeric workload chips */
.num-chip {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 24px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
}

.num-chip.danger {
    background: var(--coral);
    border-color: transparent;
    color: #fff;
}

.row-view {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--auth-teal-dk);
    font-weight: 600;
    font-size: 13px;
}

.row-view svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

.row-view:hover {
    color: var(--auth-teal);
}

/* ---------- 31. Confirmation dialog --------------------------------------- */
.cdlg {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cdlg[hidden] {
    display: none;
}

.cdlg-veil {
    position: absolute;
    inset: 0;
    background: rgba(16, 19, 26, 0.5);
    animation: cdlg-fade 0.16s ease-out;
}

.cdlg-box {
    position: relative;
    width: 100%;
    max-width: 396px;
    background: var(--surface);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    padding: 24px 24px 18px;
    text-align: center;
    animation: cdlg-rise 0.18s ease-out;
}

.cdlg-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--coral-soft);
    color: var(--coral);
}

.cdlg-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke-width: 1.8;
}

.cdlg-box h3 {
    font-family: var(--disp);
    font-size: 16.5px;
    font-weight: 700;
    color: var(--ink);
}

.cdlg-box p {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-2);
}

.cdlg-box p:empty {
    display: none;
}

.cdlg-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.cdlg-actions .btn {
    min-width: 108px;
    justify-content: center;
}

@keyframes cdlg-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cdlg-rise {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
    .cdlg-actions {
        flex-direction: column-reverse;
    }

    .cdlg-actions .btn {
        width: 100%;
    }
}

/* ---------- 32. Error pages ----------------------------------------------- */
.err-body {
    min-height: 100vh;
    background: var(--canvas);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.err {
    width: 100%;
    max-width: 560px;
    text-align: center;
}

.err-logo {
    display: inline-block;
    margin-bottom: 26px;
}

.err-logo img {
    height: 42px;
    width: auto;
}

.err-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 44px 32px 34px;
    overflow: hidden;
}

.err-code {
    position: absolute;
    top: -18px;
    left: 0;
    right: 0;
    font-family: var(--disp);
    font-size: 132px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 4px;
    color: var(--cyan);
    opacity: 0.09;
    pointer-events: none;
    user-select: none;
}

.err-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--cyan-soft);
    color: var(--cyan-dk);
}

.err-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke-width: 1.7;
}

.err-card h1 {
    position: relative;
    font-family: var(--disp);
    font-size: 23px;
    font-weight: 700;
    color: var(--ink);
}

.err-card p {
    position: relative;
    max-width: 400px;
    margin: 9px auto 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ink-2);
}

.err-actions {
    position: relative;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.err-foot {
    margin-top: 22px;
    font-size: 12px;
    color: var(--ink-3);
}

@media (max-width: 520px) {
    .err-card {
        padding: 34px 20px 26px;
    }

    .err-code {
        font-size: 96px;
    }

    .err-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* A toggle that depends on another being switched on first. */
.tgl-box.is-locked {
    opacity: 0.55;
}

.tgl-box.is-locked .tgl {
    cursor: not-allowed;
}

.field .hint {
    font-size: 11.5px;
    color: var(--ink-2);
}

.field .hint:empty {
    display: none;
}

/* A KPI card that opens its module. */
a.kpi.is-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

a.kpi.is-link:hover {
    border-color: var(--cyan);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.kpi-go {
    position: absolute;
    top: 16px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: var(--ink-3);
    opacity: 0;
    transition: opacity 0.15s;
}

.kpi-go svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke-width: 2;
}

a.kpi.is-link:hover .kpi-go {
    opacity: 1;
    color: var(--cyan-dk);
}

/* A searchable filter in a page header keeps the width of a plain select. */
.head-filter .ts-wrapper {
    width: 200px;
    min-width: 200px;
}

.head-filter .ts-control {
    min-height: 36px;
    padding: 6px 11px;
}

@media (max-width: 620px) {
    .head-filter,
    .head-filter .ts-wrapper {
        width: 100%;
        min-width: 0;
    }
}
