@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ==========================================================================
   IRONSIDE PLANT HIRE - Operations Platform
   Monochrome design system (black / white / dark grey) with a restrained
   industrial amber accent, on Ecme foundations. DM Sans throughout.
   Shared stylesheet for all pages.
   ========================================================================== */

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
table { border-collapse: collapse; border-spacing: 0; }
img { display: block; max-width: 100%; }

/* --- DESIGN TOKENS --- */
:root {
    /* Elevated brand - near-black primary */
    --primary: #1a1a1a;
    --primary-deep: #000000;
    --primary-mild: #333333;
    --primary-subtle: rgba(26, 26, 26, 0.06);
    /* Elevated brand - industrial amber accent (kept under the legacy --gold name) */
    --gold: #a09370;
    --gold-deep: #6f6347;
    --gold-subtle: rgba(160, 147, 112, 0.16);
    --amber: #a09370;
    --amber-deep: #6f6347;
    --amber-subtle: rgba(160, 147, 112, 0.16);
    --success: #2f7d52;
    --success-subtle: rgba(47, 125, 82, 0.12);
    --error: #b3261e;
    --error-subtle: rgba(179, 38, 30, 0.10);
    --warning: #9a6700;
    --warning-subtle: rgba(154, 103, 0, 0.14);
    --info: #1a1a1a;
    --info-subtle: rgba(26, 26, 26, 0.06);
    --neutral: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f4f4f4;
    --gray-150: #ededed;
    --gray-200: #e4e4e4;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --gray-950: #0a0a0a;
    /* Icon-chip / stat-tray tints - neutralised to greys so chrome stays monochrome.
       (Variable names kept for backwards compatibility with inline page styles.) */
    --sky-100: #f0f0f0;
    --sky-200: #e4e4e4;
    --emerald-100: #f0f0f0;
    --emerald-200: #e4e4e4;
    --purple-100: #f0f0f0;
    --purple-200: #e4e4e4;
    --orange-100: #f0f0f0;
    --orange-200: #e4e4e4;
    --amber-100: #f0f0f0;
    --amber-200: #e4e4e4;
    --rose-100: #f0f0f0;
    --rose-200: #e4e4e4;
    --navy-100: #f0f0f0;
    --navy-200: #e4e4e4;
    /* Layout */
    --header-height: 64px;
    --side-nav-width: 256px;
    --font-sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: 'DM Sans', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* --- BODY --- */
body {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--gray-100);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- TYPOGRAPHY --- */
h1, .h1 { font-size: 2.25rem; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
h2, .h2 { font-size: 1.875rem; font-weight: 700; color: var(--gray-900); line-height: 1.25; }
h3, .h3 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); line-height: 1.3; }
h4, .h4 { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); line-height: 1.35; }
h5, .h5 { font-size: 1.125rem; font-weight: 700; color: var(--gray-900); line-height: 1.4; }
h6, .h6 { font-size: 1.1rem; font-weight: 600; color: var(--gray-900); line-height: 1.5; }
.heading-text { color: var(--gray-900); }
.text-muted { color: var(--gray-400); }
.page-title { font-family: var(--font-display); font-size: 2.25rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; color: var(--gray-900); }
.page-subtitle { color: var(--gray-500); font-weight: 500; margin-top: 0.5rem; }

/* Numbered eyebrow label (01 / SECTION) */
.eyebrow { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gray-400); margin-bottom: 0.625rem; display: flex; align-items: center; gap: 0.5rem; }
.eyebrow b { color: var(--gold-deep); font-weight: 700; }
.card-eyebrow { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gray-400); margin-bottom: 0.25rem; }
.card-eyebrow b { color: var(--gold-deep); }

/* Display figures */
.display-num { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; }

/* ====================
   LAYOUT SHELL
   ==================== */
.app-layout { display: flex; min-height: 100vh; }

/* --- SIDEBAR --- */
.side-nav {
    width: var(--side-nav-width);
    background: var(--primary);
    border-right: 1px solid var(--primary-deep);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 40;
    overflow: hidden;
    transition: transform 0.25s ease;
}
.side-nav-logo {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1rem;
    gap: 0.625rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.10);
}
.side-nav-logo img.brand-logo { width: auto; height: auto; max-width: 100%; max-height: 64px; display: block; }
.side-nav-logo .logo-mark {
    width: 36px; height: 36px;
    border-radius: 0.625rem;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.side-nav-logo .logo-mark svg { width: 22px; height: 22px; }
.side-nav-logo .logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.side-nav-logo .logo-text strong { font-size: 0.9375rem; font-weight: 700; color: var(--gray-900); letter-spacing: -0.01em; }
.side-nav-logo .logo-text span { font-size: 0.625rem; font-weight: 600; color: var(--gold-deep); text-transform: uppercase; letter-spacing: 0.12em; }
.side-nav-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.625rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.20) transparent;
}
.side-nav-content::-webkit-scrollbar { width: 4px; }
.side-nav-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.20); border-radius: 4px; }
.menu-group-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
    padding: 1rem 0.75rem 0.5rem;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5625rem 0.75rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.72);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    width: 100%;
    margin-bottom: 0.125rem;
}
.menu-item:hover { color: #fff; background: rgba(255,255,255,0.10); }
.menu-item.active { color: #3a2a00; background: var(--gold); }
.menu-item.active .menu-count { background: rgba(33,29,90,0.18); color: #3a2a00; }
.menu-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.menu-count {
    margin-left: auto;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.0625rem 0.4375rem;
    border-radius: 9999px;
    min-width: 1.25rem;
    text-align: center;
}

/* --- COLLAPSIBLE NAV GROUPS --- */
.menu-parent { margin-bottom: 0.125rem; }
.menu-toggle { border: none; background: transparent; text-align: left; }
.menu-parent.has-active > .menu-toggle { color: #fff; }
.menu-chev { margin-left: auto; display: inline-flex; opacity: 0.6; transition: transform 0.2s; }
.menu-chev svg { width: 15px; height: 15px; }
.menu-parent.open > .menu-toggle .menu-chev { transform: rotate(90deg); }
.menu-sub { overflow: hidden; max-height: 0; transition: max-height 0.24s ease; margin-left: 1.15rem; padding-left: 0.6rem; border-left: 1px solid rgba(255,255,255,0.12); }
.menu-parent.open > .menu-sub { max-height: 30rem; }
.menu-child { font-size: 0.84375rem; color: rgba(255,255,255,0.62); padding-top: 0.5rem; padding-bottom: 0.5rem; }
.menu-child svg { width: 18px; height: 18px; }
.menu-text { flex: 0 1 auto; }

/* --- HEADER --- */
.header {
    height: var(--header-height);
    background: var(--neutral);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--gray-200);
}
.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 1.5rem;
    gap: 1rem;
}
.header-left { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 0.25rem; }
.header-search {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--gray-100);
    border-radius: 0.75rem;
    padding: 0.5rem 0.875rem;
    width: 100%;
    max-width: 340px;
    color: var(--gray-400);
}
.header-search input {
    border: none; background: none; outline: none;
    font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500;
    color: var(--gray-800); width: 100%;
}
.header-search svg { width: 18px; height: 18px; flex-shrink: 0; }
.header-search kbd {
    font-family: var(--font-sans); font-size: 0.6875rem; font-weight: 600;
    color: var(--gray-500); background: var(--neutral);
    border: 1px solid var(--gray-200); border-radius: 0.375rem; padding: 0.0625rem 0.375rem;
}
.header-action-item {
    display: flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem;
    border-radius: 9999px;
    cursor: pointer;
    color: var(--gray-600);
    transition: background 0.2s, color 0.2s;
}
.header-action-item:hover { background: rgba(0,0,0,0.05); color: var(--gray-900); }
.header-action-item svg { width: 20px; height: 20px; }
.mobile-only { display: none; }

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: var(--side-nav-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.page-container { padding: 1.5rem 2rem 2rem; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

/* --- FOOTER --- */
.footer {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--gray-400);
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ====================
   COMPONENTS
   ==================== */

/* --- CARD (always drop-shadowed per brand rules) --- */
.card {
    background: var(--neutral);
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
}
.card-border { border: 1px solid var(--gray-200); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.25rem 0; gap: 1rem; }
.card-header-border { padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-100); margin-bottom: 0; }
.card-title { font-size: 1.0625rem; font-weight: 700; color: var(--gray-900); }
.card-body { padding: 1.25rem; }
.card-footer { padding: 0.875rem 1.25rem; }
.card-footer-border { border-top: 1px solid var(--gray-100); }

/* Header stats */
.header-stats { display: flex; gap: 1.5rem; align-items: center; }
.header-stat { text-align: center; }
.header-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); }
.header-stat-label { font-size: 0.625rem; font-weight: 600; color: var(--gray-400); letter-spacing: 0.05em; text-transform: uppercase; }

/* --- STAT PORTLETS (standalone metric cards on a gapped grid) --- */
.stat-tray, .stat-grid {
    display: grid;
    gap: 1rem;
    background: transparent;
    box-shadow: none;
}
.stat-tray.cols-2, .stat-grid.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.stat-tray.cols-3, .stat-grid.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-tray.cols-4, .stat-grid.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card {
    position: relative;
    padding: 1.25rem 1.25rem 1.125rem;
    text-align: left;
    border: none;
    background: var(--neutral);
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
    transition: box-shadow 0.15s, transform 0.15s;
}
.stat-card.active { background: var(--navy-100); }
.stat-card.white { background: var(--neutral); }
/* icon chip floats top-right; value stacks under the label */
.stat-card-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.stat-card-icon, .stat-icon {
    width: 2.25rem; height: 2.25rem;
    border-radius: 0.625rem;
    background: var(--gray-100);
    color: var(--gray-700);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-card-icon svg, .stat-icon svg { width: 20px; height: 20px; }
.stat-card .stat-card-icon { background: var(--gray-100) !important; color: var(--gray-700) !important; }
.stat-icon.solid { background: var(--primary); color: #fff; }
.stat-card-label, .stat-label { font-size: 0.75rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--gray-500); margin-bottom: 0; white-space: nowrap; }
.stat-card-value, .stat-value { font-family: var(--font-display); font-size: 1.875rem; font-weight: 700; letter-spacing: -0.01em; color: var(--gray-900); line-height: 1.05; margin-top: 0.625rem; }
.stat-card-compare, .stat-foot { display: inline-flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; font-size: 0.8125rem; margin-top: 0.5rem; }
/* K&D-structure portlets: label + icon on a top row, value beneath */
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.stat-card-top + .stat-value { margin-top: 0.875rem; }

/* Coloured KPI cards */
.kpi-card { border-radius: 1rem; padding: 1.25rem; display: flex; justify-content: space-between; align-items: flex-start; box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05); }
.kpi-card .kpi-label { font-weight: 700; color: var(--gray-800); margin-bottom: 0.75rem; font-size: 0.875rem; }
.kpi-card .kpi-value { font-family: var(--font-display); font-size: 2.5rem; font-weight: 600; letter-spacing: 0.01em; color: var(--gray-900); line-height: 1; }
.kpi-card .kpi-sub { font-size: 0.8125rem; color: var(--gray-600); margin-top: 0.5rem; }
.kpi-card .kpi-icon { width: 2.75rem; height: 2.75rem; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.6); color: var(--gray-900); }
.kpi-card .kpi-icon svg { width: 22px; height: 22px; }

.grow-value { color: var(--success); font-weight: 700; }
.shrink-value { color: var(--error); font-weight: 700; }

/* --- BUTTON --- */
.btn {
    font-family: var(--font-sans);
    font-weight: 700; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    border-radius: 9999px; padding: 0.5625rem 1.125rem;
    border: 1px solid var(--gray-200); background: var(--neutral); color: var(--gray-800);
    cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.btn:hover { border-color: var(--gray-300); background: var(--gray-50); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 0.3125rem 0.75rem; font-size: 0.8125rem; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 0.6875rem 1.5rem; font-size: 0.9375rem; }
.btn-solid { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-solid:hover { background: var(--primary-deep); border-color: var(--primary-deep); }
.btn-gold { background: var(--gold); color: #3a2a00; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-plain { background: var(--primary-subtle); border-color: transparent; color: var(--primary); }
.btn-plain:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--error); color: #fff; border-color: var(--error); }
.btn-danger:hover { filter: brightness(0.95); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem; width: 2.25rem; height: 2.25rem; }
.btn-icon svg { width: 18px; height: 18px; }

/* --- INPUT --- */
.input {
    font-family: var(--font-sans); width: 100%;
    padding: 0.5rem 0.75rem; font-size: 0.875rem; font-weight: 600;
    color: var(--gray-800); background: var(--neutral);
    border: 1px solid #b9b9b9; border-radius: 0.75rem;
    outline: none; transition: all 0.15s; line-height: 1.5;
}
.input::placeholder { color: var(--gray-400); font-weight: 500; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--neutral); }
textarea.input { min-height: 6rem; resize: vertical; }
.input-icon-wrap { position: relative; }
.input-icon-wrap svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--gray-400); }
.input-icon-wrap .input { padding-left: 2.25rem; }

.select {
    font-family: var(--font-sans);
    padding: 0.5rem 2rem 0.5rem 0.75rem; font-size: 0.875rem; font-weight: 600; line-height: 1.5;
    color: var(--gray-800); background-color: var(--neutral);
    border: 1px solid #b9b9b9; border-radius: 0.75rem;
    outline: none; appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa1ac' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.5rem center;
    transition: all 0.15s;
}
.select:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background-color: var(--neutral); }

.form-item { margin-bottom: 1.25rem; }
.form-label { display: flex; align-items: center; gap: 0.375rem; font-weight: 600; margin-bottom: 0.375rem; color: var(--gray-700); }
.form-label .info-icon { color: var(--gray-400); cursor: help; display: inline-flex; }
.form-label .info-icon svg { width: 14px; height: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }

/* --- TABLE --- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; }
.table thead th {
    padding: 0.75rem 1.25rem; text-align: left;
    font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--gray-500); border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
.table tbody td { padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--gray-100); font-weight: 500; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr { cursor: pointer; transition: background 0.12s; }
.table-hover tbody tr:hover td { background: rgba(27,58,107,0.03); }
.table .heading-text { color: var(--gray-900); font-weight: 700; }
.table .sub-text { color: var(--gray-400); font-size: 0.8125rem; font-weight: 500; }
.cell-stack { display: flex; flex-direction: column; line-height: 1.3; }
.cell-media { display: flex; align-items: center; gap: 0.75rem; }
.num { font-variant-numeric: tabular-nums; }

/* --- TAG --- */
.tag {
    display: inline-flex; align-items: center; padding: 0.1875rem 0.625rem;
    border-radius: 0.5rem; font-size: 0.75rem; font-weight: 600; white-space: nowrap; gap: 0.3125rem;
}
.tag svg { width: 13px; height: 13px; }
.tag-success { background: var(--success-subtle); color: #059669; }
.tag-error { background: var(--error-subtle); color: var(--error); }
.tag-warning { background: var(--warning-subtle); color: #b45309; }
.tag-primary { background: var(--primary-subtle); color: var(--primary); }
.tag-gold { background: var(--gold-subtle); color: var(--gold-deep); }
.tag-info { background: var(--primary-subtle); color: var(--primary); }
.tag-neutral { background: var(--gray-100); color: var(--gray-600); }
.tag-purple { background: var(--gray-100); color: var(--gray-600); }
/* Plain tag row: coloured text + dot, no pill fill */
.tags-plain .tag { background: transparent !important; padding: 0; }

/* --- STATUS DOT --- */
.status-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 9999px; flex-shrink: 0; }
.status-dot-success { background: var(--success); }
.status-dot-warning { background: var(--warning); }
.status-dot-error { background: var(--error); }
.status-dot-primary { background: var(--primary); }
.status-dot-gold { background: var(--gold); }
.status-dot-muted { background: var(--gray-300); }
.status-line { display: inline-flex; align-items: center; gap: 0.4375rem; font-weight: 600; }

/* --- AVATAR --- */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gray-200); color: var(--gray-600); font-weight: 600;
    overflow: hidden; flex-shrink: 0; border-radius: 0.75rem;
}
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; font-size: 0.875rem; }
.avatar-lg { width: 3.125rem; height: 3.125rem; font-size: 1rem; }
.avatar-circle { border-radius: 9999px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-group { display: inline-flex; }
.avatar-group .avatar { margin-left: -0.5rem; border: 2px solid var(--neutral); }
/* Icon avatars: no background fill (initials/photo avatars keep theirs) */
.avatar:has(> svg) { background: transparent !important; color: var(--primary) !important; }
/* Company logo avatars: white tile with the logo contained (falls back to initials on error) */
.logo-avatar { background: #fff !important; border: 1px solid var(--gray-100); }
.logo-avatar img { object-fit: contain; padding: 4px; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* --- TABS --- */
.tab-list { display: flex; align-items: center; border-bottom: 1px solid var(--gray-200); gap: 0.25rem; flex-wrap: wrap; }
.tab-nav {
    font-weight: 700; font-size: 0.875rem; padding: 0.75rem 1rem;
    color: var(--gray-500); border-bottom: 2px solid transparent;
    cursor: pointer; transition: all 0.15s; margin-bottom: -1px; background: none; font-family: var(--font-sans);
}
.tab-nav:hover { color: var(--gray-900); }
.tab-nav.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- SEGMENT --- */
.segment { display: inline-flex; border-radius: 0.75rem; padding: 0.25rem; background: var(--gray-100); }
.segment-item {
    font-weight: 600; font-size: 0.8125rem; padding: 0.4375rem 1rem; border-radius: 0.625rem;
    cursor: pointer; color: var(--gray-500); transition: all 0.1s; background: transparent; border: none; font-family: var(--font-sans);
}
.segment-item:hover:not(.active) { color: var(--gray-800); }
.segment-item.active { background: var(--neutral); color: var(--gray-900); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* Filter pills */
.pill-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.pill {
    font-weight: 600; font-size: 0.8125rem; padding: 0.375rem 0.875rem; border-radius: 9999px;
    cursor: pointer; color: var(--gray-600); background: var(--neutral); border: 1px solid var(--gray-200);
    transition: all 0.12s; display: inline-flex; align-items: center; gap: 0.375rem;
}
.pill:hover { border-color: var(--gray-300); }
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill .pill-num { font-size: 0.6875rem; opacity: 0.7; }

/* Multi-select dropdown (searchable) */
.multiselect { position: relative; }
.multiselect-trigger {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 0.625rem;
    min-width: 220px; padding: 0.5rem 0.875rem; border-radius: 0.75rem;
    background: var(--neutral); border: 1px solid var(--gray-200); color: var(--gray-800);
    font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 600; cursor: pointer; transition: border-color 0.12s;
}
.multiselect-trigger:hover { border-color: var(--gray-300); }
.multiselect.open .multiselect-trigger { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.multiselect-trigger .ms-chevron { width: 16px; height: 16px; flex-shrink: 0; color: var(--gray-400); transition: transform 0.15s; }
.multiselect.open .multiselect-trigger .ms-chevron { transform: rotate(180deg); }
.multiselect-trigger .ms-badge { background: var(--primary); color: #fff; font-size: 0.6875rem; font-weight: 700; border-radius: 9999px; padding: 0.0625rem 0.4375rem; margin-left: 0.25rem; }
.multiselect-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; width: 280px;
    background: var(--neutral); border: 1px solid var(--gray-200); border-radius: 0.875rem;
    box-shadow: 0 16px 32px -8px rgba(16,24,40,0.18); display: none; flex-direction: column; overflow: hidden;
}
.multiselect.open .multiselect-panel { display: flex; animation: dialog-pop 0.15s ease; }
.multiselect-search { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--gray-100); color: var(--gray-400); }
.multiselect-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.multiselect-search input { border: none; outline: none; background: none; width: 100%; font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 500; color: var(--gray-800); }
.multiselect-options { max-height: 264px; overflow-y: auto; padding: 0.25rem; }
.multiselect-option { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.625rem; border-radius: 0.5rem; cursor: pointer; font-size: 0.8125rem; font-weight: 600; color: var(--gray-700); }
.multiselect-option:hover { background: var(--gray-100); }
.multiselect-option .ms-check { width: 18px; height: 18px; border: 1px solid var(--gray-300); border-radius: 0.375rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: transparent; }
.multiselect-option .ms-check svg { width: 12px; height: 12px; }
.multiselect-option.selected .ms-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.multiselect-option .ms-count { margin-left: auto; font-size: 0.6875rem; font-weight: 700; color: var(--gray-400); }
.multiselect-empty { padding: 0.75rem; text-align: center; font-size: 0.8125rem; color: var(--gray-400); }
.multiselect-foot { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; border-top: 1px solid var(--gray-100); }

/* --- BADGE --- */
.badge { position: relative; display: inline-flex; }
.badge-dot { position: absolute; top: -2px; right: -2px; width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: var(--error); border: 2px solid var(--neutral); }
.badge-count {
    position: absolute; top: -6px; right: -6px; min-width: 1.125rem; height: 1.125rem;
    display: flex; align-items: center; justify-content: center; border-radius: 9999px;
    background: var(--error); color: #fff; font-size: 0.625rem; font-weight: 700; padding: 0 0.25rem; border: 2px solid var(--neutral);
}

/* --- PROGRESS --- */
.progress { display: flex; align-items: center; width: 100%; gap: 0.5rem; }
.progress-track { flex: 1; height: 0.5rem; border-radius: 9999px; background: var(--gray-100); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 9999px; background: var(--primary); transition: width 0.3s; }
.progress-bar-success { background: var(--success); }
.progress-bar-warning { background: var(--warning); }
.progress-bar-error { background: var(--error); }
.progress-bar-gold { background: var(--gold); }
.progress-label { font-weight: 600; font-size: 0.8125rem; white-space: nowrap; }

/* --- CIRCULAR PROGRESS --- */
.progress-circle { position: relative; display: inline-flex; }
.progress-circle svg { transform: rotate(-90deg); }
.progress-circle-trail { stroke: var(--gray-100); }
.progress-circle-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: 700; font-size: 1.125rem; color: var(--gray-900); }

/* --- ALERT --- */
.alert { padding: 0.875rem 1rem; border-radius: 0.75rem; display: flex; gap: 0.75rem; align-items: flex-start; font-weight: 600; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: var(--primary-subtle); color: var(--primary); }
.alert-success { background: var(--success-subtle); color: #059669; }
.alert-warning { background: var(--warning-subtle); color: #b45309; }
.alert-error { background: var(--error-subtle); color: var(--error); }

/* --- DIALOG / MODAL --- */
.dialog-overlay {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(17,24,39,0.55); backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center; padding: 1rem;
}
.dialog-overlay.open { display: flex; }
.dialog-content {
    background: #f8f8f8; border-radius: 1.25rem;
    box-shadow: 0 48px 64px -16px rgba(0,0,0,0.30);
    width: 100%; max-width: 32rem; position: relative; max-height: 95vh; display: flex; flex-direction: column;
    animation: dialog-pop 0.18s ease;
}
.dialog-content.wide { max-width: 60rem; height: 88vh; }
@keyframes dialog-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100); }
.dialog-body { padding: 1.5rem; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.dialog-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 0.625rem; }
.close-btn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 0.5rem; border: none; background: transparent; color: var(--gray-400); cursor: pointer; flex-shrink: 0; transition: background 0.12s, color 0.12s; }
.close-btn:hover { background: var(--gray-100); color: var(--gray-700); }

/* --- DRAWER (right slide-in) --- */
.drawer-overlay {
    position: fixed; inset: 0; z-index: 55;
    background: rgba(17,24,39,0.45); backdrop-filter: blur(3px);
    display: none; justify-content: flex-end;
}
.drawer-overlay.open { display: flex; }
.drawer {
    background: var(--gray-100); width: 100%; max-width: 520px; height: 100%;
    display: flex; flex-direction: column; box-shadow: -24px 0 48px rgba(0,0,0,0.18);
    animation: drawer-in 0.22s ease;
}
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.drawer-head { background: var(--neutral); padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200); display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.drawer-foot { background: var(--neutral); border-top: 1px solid var(--gray-200); padding: 1rem 1.5rem; display: flex; gap: 0.625rem; justify-content: flex-end; }

/* --- DROPDOWN --- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute; top: 100%; margin-top: 0.375rem; right: 0;
    border-radius: 1rem; background: var(--neutral);
    box-shadow: 0 24px 48px -12px rgba(0,0,0,0.25); border: 1px solid var(--gray-100);
    padding: 0.5rem; z-index: 45; min-width: 14rem; display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 0.625rem; padding: 0.5625rem 0.75rem; border-radius: 0.5rem; cursor: pointer; font-weight: 600; font-size: 0.875rem; color: var(--gray-600); transition: all 0.15s; }
.dropdown-item:hover { background: var(--gray-100); color: var(--gray-900); }
.dropdown-item svg { width: 16px; height: 16px; }
.dropdown-divider { height: 1px; background: var(--gray-100); margin: 0.375rem 0; }

/* --- CHECKBOX / RADIO --- */
.checkbox { width: 1.25rem; height: 1.25rem; border: 1px solid var(--gray-300); border-radius: 0.375rem; cursor: pointer; appearance: none; vertical-align: middle; flex-shrink: 0; transition: all 0.15s; }
.checkbox:checked {
    background: var(--primary); border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center;
}
.checkbox-label { display: inline-flex; align-items: center; gap: 0.625rem; cursor: pointer; font-weight: 600; }

/* --- SWITCH --- */
.switcher { width: 2.75rem; height: 1.5rem; display: inline-flex; align-items: center; position: relative; border-radius: 1.5rem; background: var(--gray-300); cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.switcher.checked { background: var(--primary); }
.switcher-toggle { position: absolute; left: 0.125rem; top: 50%; transform: translateY(-50%); width: 1.25rem; height: 1.25rem; background: #fff; border-radius: 9999px; transition: left 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switcher.checked .switcher-toggle { left: calc(100% - 1.375rem); }

/* --- PAGINATION --- */
.pagination { display: inline-flex; align-items: center; gap: 0.25rem; }
.pagination-pager { min-width: 2rem; height: 2rem; padding: 0 0.5rem; border-radius: 0.5rem; display: inline-flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 600; cursor: pointer; color: var(--gray-500); transition: all 0.15s; }
.pagination-pager:hover { background: var(--gray-100); }
.pagination-pager.active { background: var(--primary); color: #fff; }

/* --- TOAST --- */
.toast-wrap { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 80; display: flex; flex-direction: column; gap: 0.625rem; }
.toast {
    background: var(--neutral); border-radius: 0.875rem; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.12), 0 8px 10px -6px rgba(0,0,0,0.10);
    border: 1px solid var(--gray-100); padding: 0.875rem 1rem; display: flex; gap: 0.75rem; align-items: flex-start;
    min-width: 280px; max-width: 360px; animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.hide { animation: toast-out 0.2s ease forwards; }
@keyframes toast-out { to { transform: translateX(20px); opacity: 0; } }
.toast-icon { width: 2rem; height: 2rem; border-radius: 9999px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-icon svg { width: 16px; height: 16px; }
.toast-title { font-weight: 700; color: var(--gray-900); font-size: 0.875rem; }
.toast-msg { font-size: 0.8125rem; color: var(--gray-500); }

/* --- SKELETON --- */
.skeleton { background: var(--gray-200); border-radius: 0.375rem; animation: skeleton-pulse 1.5s ease-in-out infinite; }
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* --- EMPTY STATE --- */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--gray-400); }
.empty-state .empty-icon { width: 3.5rem; height: 3.5rem; border-radius: 9999px; background: var(--gray-100); color: var(--gray-400); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.empty-state .empty-icon svg { width: 28px; height: 28px; }
.empty-state h5 { color: var(--gray-700); margin-bottom: 0.25rem; }

/* --- TIMELINE --- */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before { content: ''; position: absolute; left: 0.4375rem; top: 0.25rem; bottom: 0.25rem; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -1.75rem; top: 0.125rem; width: 1rem; height: 1rem; border-radius: 9999px; background: var(--neutral); border: 2px solid var(--gray-300); }
.timeline-dot.primary { border-color: var(--primary); background: var(--primary); }
.timeline-dot.success { border-color: var(--success); background: var(--success); }
.timeline-dot.gold { border-color: var(--gold); background: var(--gold); }
.timeline-time { font-size: 0.75rem; color: var(--gray-400); font-weight: 600; }

/* --- DESCRIPTION LIST --- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.625rem 1.5rem; }
.dl dt { color: var(--gray-400); font-weight: 600; font-size: 0.8125rem; }
.dl dd { color: var(--gray-800); font-weight: 600; text-align: right; }

/* --- CALENDAR / SCHEDULE GRID --- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; }
.cal-head { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); text-align: center; padding-bottom: 0.25rem; }
.cal-cell { background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 0.625rem; min-height: 92px; padding: 0.5rem; }
.cal-cell.muted { opacity: 0.45; }
.cal-cell.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-date { font-weight: 700; color: var(--gray-700); font-size: 0.8125rem; margin-bottom: 0.25rem; }
.cal-event { font-size: 0.6875rem; font-weight: 600; padding: 0.125rem 0.375rem; border-radius: 0.375rem; margin-bottom: 0.1875rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- KANBAN --- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 1rem; align-items: stretch; }
.kanban-col { background: var(--gray-200); border-radius: 1rem; padding: 0.75rem; }
.kanban-col:has(.status-dot-primary) { background: var(--primary-subtle); }
.kanban-col:has(.status-dot-warning) { background: var(--warning-subtle); }
.kanban-col:has(.status-dot-gold) { background: var(--gold-subtle); }
.kanban-col:has(.status-dot-success) { background: var(--success-subtle); }
.kanban-col:has(.status-dot-error) { background: var(--error-subtle); }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 0.25rem 0.5rem 0.75rem; font-weight: 700; color: var(--gray-700); }
.kanban-card { background: var(--neutral); border-radius: 0.875rem; padding: 0.875rem; margin-bottom: 0.625rem; box-shadow: 0 1px 3px rgba(16,24,40,0.06); cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(16,24,40,0.10); }
.kanban-card:last-child { margin-bottom: 0; }

/* --- PHONE FRAME (job cards mobile view) --- */
.device-stage { display: flex; gap: 2.5rem; align-items: flex-start; flex-wrap: wrap; }
.phone-frame {
    width: 390px; height: 800px; background: #0b1220; border-radius: 2.75rem; padding: 0.75rem;
    box-shadow: 0 40px 80px -20px rgba(0,0,0,0.45), inset 0 0 0 2px #2a3550; flex-shrink: 0; position: relative;
}
.phone-notch { position: absolute; top: 0.75rem; left: 50%; transform: translateX(-50%); width: 130px; height: 26px; background: #0b1220; border-radius: 0 0 1rem 1rem; z-index: 6; }
.phone-screen { width: 100%; height: 100%; background: var(--gray-100); border-radius: 2.1rem; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.phone-statusbar { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem 0; font-size: 0.75rem; font-weight: 700; color: var(--gray-900); flex-shrink: 0; }
.phone-statusbar .sb-icons { display: flex; gap: 0.3125rem; align-items: center; }
.phone-statusbar svg { width: 15px; height: 15px; }
.phone-appbar { background: var(--primary); color: #fff; padding: 0.625rem 1rem 0.875rem; flex-shrink: 0; }
.phone-appbar .pa-top { display: flex; align-items: center; justify-content: space-between; }
.phone-appbar h4 { color: #fff; font-size: 1.125rem; }
.phone-appbar .pa-sub { color: rgba(255,255,255,0.7); font-size: 0.75rem; font-weight: 600; }
.phone-appbar .pa-icon { width: 2rem; height: 2rem; border-radius: 0.625rem; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; }
.phone-appbar .pa-icon svg { width: 18px; height: 18px; }
.phone-scroll { flex: 1; overflow-y: auto; padding: 0.875rem; }
.phone-scroll::-webkit-scrollbar { width: 0; }
.phone-tabbar { background: var(--neutral); border-top: 1px solid var(--gray-200); display: flex; flex-shrink: 0; padding: 0.5rem 0.5rem calc(0.5rem + 6px); }
.phone-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.1875rem; font-size: 0.625rem; font-weight: 700; color: var(--gray-400); padding: 0.25rem; border-radius: 0.5rem; }
.phone-tab.active { color: var(--primary); }
.phone-tab svg { width: 21px; height: 21px; }
.phone-handle { position: absolute; bottom: 0.5rem; left: 50%; transform: translateX(-50%); width: 120px; height: 5px; border-radius: 9999px; background: rgba(0,0,0,0.25); z-index: 6; }

/* Mobile job card */
.jc { background: var(--neutral); border-radius: 1rem; padding: 0.875rem; margin-bottom: 0.75rem; box-shadow: 0 1px 3px rgba(16,24,40,0.07); cursor: pointer; transition: transform 0.12s; }
.jc:active { transform: scale(0.98); }
.jc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.jc-ref { font-size: 0.6875rem; font-weight: 700; color: var(--gray-400); letter-spacing: 0.03em; }
.jc-title { font-weight: 700; color: var(--gray-900); font-size: 0.9375rem; }
.jc-meta { display: flex; align-items: center; gap: 0.375rem; color: var(--gray-500); font-size: 0.8125rem; font-weight: 600; margin-top: 0.25rem; }
.jc-meta svg { width: 14px; height: 14px; color: var(--gray-400); }

/* Mobile checklist row */
.check-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--neutral); border-radius: 0.75rem; margin-bottom: 0.5rem; box-shadow: 0 1px 2px rgba(16,24,40,0.05); }
.check-box { width: 1.5rem; height: 1.5rem; border-radius: 0.5rem; border: 2px solid var(--gray-300); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: transparent; transition: all 0.15s; }
.check-row.done .check-box { background: var(--success); border-color: var(--success); color: #fff; }
.check-row.done .check-label { color: var(--gray-400); text-decoration: line-through; }
.check-box svg { width: 15px; height: 15px; }
.check-label { font-weight: 600; color: var(--gray-800); font-size: 0.875rem; }
.seg-pass { display: inline-flex; border-radius: 0.625rem; overflow: hidden; border: 1px solid var(--gray-200); }
.seg-pass button { padding: 0.375rem 0.75rem; font-size: 0.75rem; font-weight: 700; color: var(--gray-500); background: var(--neutral); }
.seg-pass button.pass.active { background: var(--success); color: #fff; }
.seg-pass button.fail.active { background: var(--error); color: #fff; }

/* Signature pad */
.sig-pad { background: var(--neutral); border: 2px dashed var(--gray-300); border-radius: 0.75rem; height: 130px; display: flex; align-items: center; justify-content: center; color: var(--gray-400); font-weight: 600; cursor: crosshair; position: relative; overflow: hidden; }

/* --- BAR CHART --- */
.bar-chart { display: flex; align-items: flex-end; gap: 0.625rem; height: 180px; padding-top: 1rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 2.25rem; border-radius: 0.375rem 0.375rem 0 0; background: var(--primary); transition: height 0.4s; }
.bar.alt { background: var(--gold); }
.bar-label { font-size: 0.6875rem; font-weight: 600; color: var(--gray-400); }

/* Line chart */
.chart-line { width: 100%; height: 220px; position: relative; }
.chart-line svg { width: 100%; height: 100%; }
.chart-line path.line { fill: none; stroke: var(--primary); stroke-width: 2.5; }
.chart-line path.area { fill: var(--primary-subtle); stroke: none; }

/* Donut legend */
.legend { display: flex; flex-direction: column; gap: 0.625rem; }
.legend-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; font-weight: 600; }
.legend-key { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--gray-600); }
.legend-swatch { width: 0.75rem; height: 0.75rem; border-radius: 0.25rem; }

/* ====================
   UTILITIES
   ==================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }
.w-full { width: 100%; } .h-full { height: 100%; }
.text-xs { font-size: 0.75rem; } .text-sm { font-size: 0.875rem; } .text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; } .text-xl { font-size: 1.25rem; } .text-2xl { font-size: 1.5rem; } .text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.text-primary { color: var(--primary); } .text-gold { color: var(--gold-deep); }
.text-success { color: var(--success); } .text-error { color: var(--error); } .text-warning { color: #b45309; }
.text-gray-400 { color: var(--gray-400); } .text-gray-500 { color: var(--gray-500); } .text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); } .text-gray-900 { color: var(--gray-900); } .text-white { color: #fff; }
.bg-sky-100 { background: var(--sky-100); } .bg-sky-200 { background: var(--sky-200); }
.bg-emerald-100 { background: var(--emerald-100); } .bg-emerald-200 { background: var(--emerald-200); }
.bg-purple-100 { background: var(--purple-100); } .bg-purple-200 { background: var(--purple-200); }
.bg-orange-100 { background: var(--orange-100); } .bg-orange-200 { background: var(--orange-200); }
.bg-amber-100 { background: var(--amber-100); } .bg-amber-200 { background: var(--amber-200); }
.bg-rose-100 { background: var(--rose-100); } .bg-rose-200 { background: var(--rose-200); }
.bg-navy-100 { background: var(--navy-100); } .bg-navy-200 { background: var(--navy-200); }
.bg-gold-subtle { background: var(--gold-subtle); }
.bg-gray-50 { background: var(--gray-50); } .bg-gray-100 { background: var(--gray-100); }
.bg-white { background: var(--neutral); }
.rounded-lg { border-radius: 0.75rem; } .rounded-xl { border-radius: 1rem; } .rounded-2xl { border-radius: 1.25rem; } .rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--gray-200); }
.border-b { border-bottom: 1px solid var(--gray-200); }
.border-t { border-top: 1px solid var(--gray-200); }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.shadow-md { box-shadow: 0 4px 12px rgba(16,24,40,0.08); }
.p-0 { padding: 0; } .p-2 { padding: 0.5rem; } .p-3 { padding: 0.75rem; } .p-4 { padding: 1rem; } .p-5 { padding: 1.25rem; } .p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; } .px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; } .py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 0.75rem; } .mb-4 { margin-bottom: 1rem; } .mb-5 { margin-bottom: 1.25rem; } .mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 0.75rem; } .mt-4 { margin-top: 1rem; } .mt-5 { margin-top: 1.25rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.ml-2 { margin-left: 0.5rem; } .ml-auto { margin-left: auto; }
.opacity-60 { opacity: 0.6; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; } .text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.hidden { display: none; }
.leading-tight { line-height: 1.25; }

/* Grid columns */
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-12 { grid-template-columns: repeat(12, 1fr); }
.col-span-2 { grid-column: span 2; } .col-span-3 { grid-column: span 3; } .col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; } .col-span-6 { grid-column: span 6; } .col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; } .col-span-9 { grid-column: span 9; }

/* --- RESPONSIVE --- */
.scrim { position: fixed; inset: 0; background: rgba(17,24,39,0.5); z-index: 39; display: none; }
.scrim.open { display: block; }

@media (max-width: 1280px) {
    .xl-stack { grid-template-columns: 1fr !important; }
    .kanban { grid-template-columns: repeat(2, minmax(240px,1fr)); }
}
@media (max-width: 1024px) {
    .side-nav { transform: translateX(-100%); }
    .side-nav.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-only { display: inline-flex; }
    .lg-stack { grid-template-columns: 1fr !important; }
}
@media (max-width: 768px) {
    .page-container { padding: 1rem; }
    .header-search { max-width: none; }
    .stat-tray.cols-2, .stat-tray.cols-3, .stat-tray.cols-4,
    .stat-grid.grid-cols-2, .stat-grid.grid-cols-3, .stat-grid.grid-cols-4 { grid-template-columns: 1fr; }
    .md-stack { grid-template-columns: 1fr !important; }
    .md-stack-2 { grid-template-columns: repeat(2,1fr) !important; }
    .kanban { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .hide-sm { display: none; }
    .phone-frame { width: 100%; max-width: 390px; height: 720px; margin: 0 auto; }
    .device-stage { justify-content: center; }
}

/* --- MASTHEAD (dashboard hero) --- */
.masthead {
    background: var(--primary); color: #fff; border-radius: 1.25rem;
    padding: 1.75rem 2rem; display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem 2.5rem; flex-wrap: wrap; position: relative; overflow: hidden;
    box-shadow: 0 16px 36px -16px rgba(0,0,0,0.45);
}
.masthead::after { content: ''; position: absolute; right: -40px; top: -60px; width: 280px; height: 280px; border-radius: 9999px; border: 40px solid rgba(255,255,255,0.04); }
.masthead .mh-left { position: relative; z-index: 1; }
.masthead .mh-eyebrow { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(255,255,255,0.55); margin-bottom: 0.625rem; }
.masthead .mh-eyebrow b { color: var(--gold); }
.masthead h1 { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; letter-spacing: -0.01em; color: #fff; line-height: 1.05; }
.masthead .mh-sub { color: rgba(255,255,255,0.62); font-weight: 500; margin-top: 0.625rem; }
.masthead-stats { display: flex; gap: 2rem; align-items: center; position: relative; z-index: 1; }
.mh-stat .v { font-family: var(--font-display); font-size: 2.25rem; font-weight: 600; color: #fff; line-height: 1; }
.mh-stat .v.gold { color: var(--gold); }
.mh-stat .l { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.55); margin-top: 0.375rem; }
.mh-divider { width: 1px; align-self: stretch; background: rgba(255,255,255,0.16); }

/* --- SIDEBAR USER PROFILE --- */
.side-nav-profile { border-top: 1px solid rgba(255,255,255,0.10); padding: 0.875rem; display: flex; align-items: center; gap: 0.625rem; flex-shrink: 0; }
.side-nav-profile .meta { line-height: 1.2; flex: 1; min-width: 0; }
.side-nav-profile .meta strong { font-size: 0.8125rem; color: #fff; display: block; }
.side-nav-profile .meta span { font-size: 0.6875rem; color: rgba(255,255,255,0.55); }
.side-nav-profile .signout { color: rgba(255,255,255,0.55); display: flex; padding: 0.375rem; border-radius: 9999px; }
.side-nav-profile .signout:hover { color: #fff; background: rgba(255,255,255,0.12); }

/* --- SIDEBAR "POWERED BY" VENDOR MARK --- */
.side-nav-powered { border-top: 1px solid rgba(255,255,255,0.08); padding: 0.75rem 0.875rem 0.9375rem; display: flex; flex-direction: column; align-items: center; gap: 0.375rem; flex-shrink: 0; }
.side-nav-powered span { font-size: 0.5625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.38); }
.side-nav-powered img { width: 124px; height: auto; opacity: 0.85; }

/* --- editorial refinements --- */
.table tbody td { padding: 1rem 1.25rem; }
.table thead th { padding: 0.875rem 1.25rem; }
.card-title { letter-spacing: -0.01em; }

/* --- WORKFORCE PLANNER (resource timeline) --- */
.planner { background: var(--neutral); border-radius: 1.25rem; box-shadow: 0 1px 3px rgba(16,24,40,0.05), 0 1px 2px rgba(16,24,40,0.04); overflow: hidden; }
.planner-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--gray-200); flex-wrap: wrap; }
.planner-toolbar .tb-date { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; color: var(--gray-900); min-width: 230px; }
.planner-nav { display: inline-flex; align-items: center; gap: 0.25rem; }
.planner-nav button { width: 2rem; height: 2rem; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; color: var(--gray-600); border: 1px solid var(--gray-200); background: var(--neutral); transition: all 0.15s; }
.planner-nav button:hover { background: var(--gray-100); color: var(--gray-900); }
.planner-nav button svg { width: 16px; height: 16px; }

.planner-scroll { overflow-x: auto; }
.planner-head, .planner-row { display: grid; grid-template-columns: 224px repeat(7, minmax(118px, 1fr)); }
.planner-head { position: sticky; top: 0; z-index: 4; background: var(--neutral); border-bottom: 1px solid var(--gray-200); }
.planner-head .corner { grid-column: 1; grid-row: 1; display: flex; align-items: center; padding: 0.75rem 1.25rem; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gray-400); position: sticky; left: 0; background: var(--neutral); z-index: 5; border-right: 1px solid var(--gray-200); }
.day-head { grid-row: 1; text-align: center; padding: 0.625rem 0.25rem; border-right: 1px solid var(--gray-100); }
.day-head .dow { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-400); }
.day-head .dom { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--gray-800); line-height: 1.1; }
.day-head.weekend { background: var(--gray-50); }
.day-head.today .dom { color: #fff; background: var(--primary); width: 1.875rem; height: 1.875rem; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; margin-top: 0.125rem; }

.planner-row { border-top: 1px solid var(--gray-100); min-height: 86px; }
.planner-row:hover .res-cell { background: var(--gray-50); }
.res-cell { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 0.625rem; padding: 0.625rem 1rem; position: sticky; left: 0; background: var(--neutral); z-index: 3; border-right: 1px solid var(--gray-200); }
.res-cell .meta { line-height: 1.25; min-width: 0; }
.res-cell .meta strong { font-size: 0.875rem; color: var(--gray-900); display: block; }
.res-cell .meta span { font-size: 0.6875rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.day-slot { grid-row: 1; border-right: 1px solid var(--gray-100); }
.day-slot.weekend { background: var(--gray-50); }

.job-bar { grid-row: 1; align-self: center; z-index: 2; margin: 0.3125rem; border-radius: 0.625rem; padding: 0.4375rem 0.625rem; cursor: pointer; min-height: 2.5rem; display: flex; flex-direction: column; justify-content: center; overflow: hidden; transition: transform 0.12s, box-shadow 0.12s; box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.job-bar:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,0.18); }
.job-bar .jb-title { font-size: 0.6875rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.job-bar .jb-sub { font-size: 0.625rem; font-weight: 600; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-bar.top { align-self: start; margin-top: 0.375rem; }
.job-bar.bottom { align-self: end; margin-bottom: 0.375rem; }
/* job type fills */
.jb-breakdown { background: var(--error); color: #fff; }
.jb-service { background: var(--primary); color: #fff; }
.jb-rote { background: var(--gold); color: #3a2a00; }
.jb-delivery { background: var(--success); color: #fff; }
.jb-collection { background: var(--gray-500); color: #fff; }
.jb-workshop { background: var(--primary-mild); color: #fff; }
.jb-leave { background: var(--gray-200); color: var(--gray-600); box-shadow: none; }

.planner-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; padding: 0.875rem 1.25rem; border-top: 1px solid var(--gray-100); }
.planner-legend .lg { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 600; color: var(--gray-600); }
.planner-legend .sw { width: 0.875rem; height: 0.875rem; border-radius: 0.3125rem; }

@media (max-width: 768px) {
  .planner-head, .planner-row { grid-template-columns: 150px repeat(7, minmax(104px, 1fr)); }
  .res-cell .meta span { display: none; }
}

/* Style guide swatch */
.sg-swatch { height: 64px; border-radius: 0.75rem; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); margin-bottom: 0.5rem; }
.sg-block { padding: 1rem; border-radius: 0.75rem; background: var(--gray-50); }
.sg-block-bordered { border: 1px solid var(--gray-200); transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease; }
.sg-block-bordered:hover { border-color: var(--primary); background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* ====================
   STEPPER (multi-step wizard)
   ==================== */
.stepper { display: flex; align-items: center; width: 100%; }
.stepper .step { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.stepper .step-marker {
    width: 1.875rem; height: 1.875rem; border-radius: 9999px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8125rem; flex-shrink: 0;
    background: var(--neutral); color: var(--gray-400);
    border: 2px solid var(--gray-200); transition: all 0.2s;
}
.stepper .step-marker svg { width: 15px; height: 15px; }
.stepper .step-label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); white-space: nowrap; transition: color 0.2s; }
.stepper .step-line { flex: 1; height: 2px; background: var(--gray-200); margin: 0 0.625rem; border-radius: 2px; transition: background 0.2s; min-width: 0.75rem; }
.stepper .step.active .step-marker { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-subtle); }
.stepper .step.active .step-label { color: var(--gray-900); }
.stepper .step.done .step-marker { background: var(--gold); border-color: var(--gold); color: var(--gray-900); }
.stepper .step.done + .step-line { background: var(--gold); }
.stepper .step.done .step-label { color: var(--gray-700); }

.step-panel { display: none; animation: dialog-pop 0.18s ease; }
.step-panel.active { display: block; }

/* Field that is auto-pulled / calculated (visually distinct from editable) */
.input.input-pulled, .input[readonly] { background: var(--neutral); color: var(--gray-500); cursor: default; border-color: var(--gray-200); }
.input.input-pulled:focus, .input[readonly]:focus { box-shadow: none; border-color: var(--gray-200); background: var(--neutral); }
.field-hint { font-size: 0.6875rem; font-weight: 600; color: var(--gray-400); margin-top: 0.25rem; }

/* --- AUTOCOMPLETE (typeahead) --- */
.autocomplete { position: relative; }
.autocomplete-menu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
    background: var(--neutral); border: 1px solid var(--gray-200); border-radius: 0.875rem;
    box-shadow: 0 16px 32px -8px rgba(16,24,40,0.18); max-height: 248px; overflow-y: auto; padding: 0.25rem; display: none;
}
.autocomplete.open .autocomplete-menu { display: block; animation: dialog-pop 0.15s ease; }
.autocomplete-option { display: flex; align-items: center; justify-content: space-between; gap: 0.625rem; padding: 0.5rem 0.625rem; border-radius: 0.5rem; cursor: pointer; }
.autocomplete-option:hover, .autocomplete-option.active { background: var(--gray-100); }
.autocomplete-option .ac-main { min-width: 0; line-height: 1.3; }
.autocomplete-option .ac-name { font-weight: 700; color: var(--gray-900); font-size: 0.875rem; }
.autocomplete-option .ac-sub { font-size: 0.6875rem; color: var(--gray-400); font-weight: 600; }
.autocomplete-option .ac-badge { flex-shrink: 0; font-size: 0.625rem; font-weight: 700; color: var(--gold-deep); background: var(--gold-subtle); padding: 0.125rem 0.4375rem; border-radius: 9999px; white-space: nowrap; }
.autocomplete-empty { padding: 0.75rem; text-align: center; color: var(--gray-400); font-size: 0.8125rem; font-weight: 600; }

/* --- PLANT PICKER (searchable equipment list) --- */
.plant-picker { border: 1px solid var(--gray-200); border-radius: 0.875rem; overflow: hidden; }
.plant-scroll { max-height: 244px; overflow-y: auto; }
.plant-table { width: 100%; border-collapse: collapse; }
.plant-table thead th {
    position: sticky; top: 0; z-index: 1; background: var(--neutral); text-align: left;
    padding: 0.5rem 0.875rem; font-size: 0.625rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--gray-400); border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
.plant-table th.r, .plant-table td.r { text-align: right; }
.plant-table tbody td { padding: 0.5625rem 0.875rem; border-bottom: 1px solid var(--gray-100); font-weight: 600; vertical-align: middle; }
.plant-table tbody tr:last-child td { border-bottom: none; }
.plant-table tbody tr { cursor: pointer; transition: background 0.12s; }
.plant-table tbody tr:hover td { background: var(--gray-50); }
.plant-table tbody tr.selected td { background: var(--primary-subtle); }
.plant-table .pk-no { font-weight: 700; color: var(--gray-900); }
.plant-table .pk-sub { font-size: 0.6875rem; color: var(--gray-400); font-weight: 500; }
.plant-table .pk-radio { width: 1.125rem; height: 1.125rem; border-radius: 0.375rem; border: 2px solid var(--gray-300); display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.plant-table tbody tr.selected .pk-radio { background: var(--primary); border-color: var(--primary); color: #fff; }
.plant-table .pk-radio svg { width: 11px; height: 11px; }
.plant-empty { padding: 1.25rem; text-align: center; font-size: 0.8125rem; color: var(--gray-400); font-weight: 600; }

/* Selected equipment list (multi-select summary) */
.sel-list { display: flex; flex-direction: column; gap: 0.5rem; }
.sel-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.875rem; background: var(--neutral); border: 1px solid var(--gray-200); border-radius: 0.75rem; box-shadow: 0 1px 2px rgba(16,24,40,0.04); }
.sel-row .sel-main { flex: 1; min-width: 0; }
.sel-row .sel-no { font-weight: 700; color: var(--gray-900); }
.sel-row .sel-sub { font-size: 0.6875rem; color: var(--gray-400); font-weight: 500; }
.sel-row .sel-remove { color: var(--gray-400); display: inline-flex; padding: 0.25rem; border-radius: 0.375rem; }
.sel-row .sel-remove:hover { color: var(--error); background: var(--error-subtle); }
.sel-row .sel-remove svg { width: 16px; height: 16px; }

/* Per-asset rate table (charges step) */
.rate-table { width: 100%; border-collapse: collapse; }
.rate-table th { text-align: left; font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.rate-table th.r, .rate-table td.r { text-align: right; }
.rate-table td { padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--gray-100); font-weight: 600; vertical-align: middle; }
.rate-table tbody tr:last-child td { border-bottom: none; }
.rate-table .rt-no { font-weight: 700; color: var(--gray-900); }
.rate-table .rt-sub { font-size: 0.6875rem; color: var(--gray-400); font-weight: 500; }
.rate-table input.input { padding: 0.375rem 0.5rem; text-align: right; }
.rate-table .rt-rate { width: 6rem; margin-left: auto; }
.rate-table .rt-ex { width: 5rem; margin-left: auto; }
.rate-table .rt-perday { font-family: var(--font-display); font-weight: 600; color: var(--gray-900); font-variant-numeric: tabular-nums; }

/* --- CHARGE SUMMARY ROWS --- */
.sum-row { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--gray-100); font-weight: 600; }
.sum-row:last-child { border-bottom: none; }
.sum-row .sum-label { color: var(--gray-600); display: inline-flex; align-items: center; gap: 0.375rem; }
.sum-row .sum-val { font-family: var(--font-display); font-weight: 600; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.sum-row.sum-total { border-top: 2px solid var(--gray-200); border-bottom: none; padding-top: 0.75rem; margin-top: 0.25rem; }
.sum-row.sum-total .sum-label { color: var(--gray-900); font-weight: 700; }
.sum-row.sum-total .sum-val { font-size: 1.375rem; color: var(--primary); }

/* --- EXTRAS --- */
.extra-cat { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.extra-chip {
    display: inline-flex; align-items: center; gap: 0.4375rem; padding: 0.4375rem 0.75rem;
    border-radius: 9999px; border: 1px dashed var(--gray-300); background: var(--neutral);
    font-weight: 600; font-size: 0.8125rem; color: var(--gray-700); cursor: pointer; transition: all 0.12s;
}
.extra-chip:hover { border-color: var(--primary); color: var(--primary); border-style: solid; }
.extra-chip svg { width: 14px; height: 14px; }
.extra-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; background: var(--neutral); border: 1px solid var(--gray-200); border-radius: 0.75rem; margin-bottom: 0.5rem; box-shadow: 0 1px 2px rgba(16,24,40,0.04); }
.extra-row .ex-name { font-weight: 600; color: var(--gray-800); flex: 1; }
.extra-row .ex-qty { width: 4rem; }
.extra-row .ex-line { font-family: var(--font-display); font-weight: 600; color: var(--gray-900); min-width: 4.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.extra-row .ex-remove { color: var(--gray-400); display: inline-flex; padding: 0.25rem; border-radius: 0.375rem; }
.extra-row .ex-remove:hover { color: var(--error); background: var(--error-subtle); }
.extra-row .ex-remove svg { width: 16px; height: 16px; }

/* --- SEGMENT (full width, for rate basis) --- */
.segment.segment-block { display: flex; width: 100%; }
.segment.segment-block .segment-item { flex: 1; text-align: center; }

/* --- PDF / AGREEMENT PREVIEW SHEET --- */
.pdf-sheet { background: #fff; border-radius: 0.5rem; box-shadow: 0 8px 24px -8px rgba(16,24,40,0.20); border: 1px solid var(--gray-200); padding: 2rem; max-width: 640px; margin: 0 auto; color: var(--gray-700); font-size: 0.8125rem; }
.pdf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--primary); margin-bottom: 1.25rem; }
.pdf-brand img { max-height: 48px; }
.pdf-brand .pdf-co { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; text-transform: uppercase; color: var(--primary); line-height: 1; }
.pdf-brand .pdf-co-sub { font-size: 0.6875rem; color: var(--gray-500); font-weight: 600; margin-top: 0.25rem; }
.pdf-doc-title { text-align: right; }
.pdf-doc-title .t { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; text-transform: uppercase; color: var(--gray-900); line-height: 1; }
.pdf-doc-title .r { font-size: 0.75rem; color: var(--gray-500); font-weight: 600; margin-top: 0.375rem; }
.pdf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.pdf-block-label { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-400); margin-bottom: 0.375rem; }
.pdf-block strong { color: var(--gray-900); font-size: 0.9375rem; }
.pdf-block div { line-height: 1.5; }
.pdf-table { width: 100%; margin-bottom: 1rem; }
.pdf-table th { text-align: left; font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); padding: 0.375rem 0.5rem; border-bottom: 1px solid var(--gray-200); }
.pdf-table th.r, .pdf-table td.r { text-align: right; }
.pdf-table td { padding: 0.4375rem 0.5rem; border-bottom: 1px solid var(--gray-100); font-weight: 600; color: var(--gray-700); }
.pdf-table td .muted { color: var(--gray-400); font-weight: 500; font-size: 0.75rem; }
.pdf-totals { width: 260px; margin-left: auto; }
.pdf-totals .sum-row { padding: 0.375rem 0.5rem; }
.pdf-foot { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); font-size: 0.6875rem; color: var(--gray-400); text-align: center; }
.pdf-watermark { position: absolute; }
