/* ============================================================
   DataLeads — Wireframe / Mockup style
   Black & white, no shadows, no gradients, dashed placeholders.
   ============================================================ */

/* -- THEME VARIABLES ------------------------------------------------ */
:root,
html[data-theme="dark"],
html[data-theme="light"] {
    color-scheme: light;
    --bg-1: #ffffff;
    --bg-2: #ffffff;
    --bg-3: #f5f5f5;
    --accent-1: #000000;
    --accent-2: #000000;
    --accent-3: #000000;
    --hot: #000000;
    --warm: #000000;
    --cold: #000000;
    --good: #000000;
    --bad: #000000;
    --text-1: #000000;
    --text-2: #1a1a1a;
    --text-3: #555555;
    --text-mute: #808080;
    --border: #000000;
    --border-soft: #b3b3b3;
    --border-strong: #000000;
    --glass-bg: #ffffff;
    --glass-bg-2: #fafafa;
    --glass-shadow: none;
    --grid-dot: #d9d9d9;
    --chart-grid: #d9d9d9;
    --input-bg: #ffffff;
    --select-option-bg: #ffffff;
    --tooltip-bg: #ffffff;
    --hover-bg: #f0f0f0;
    --fill-zebra: #f7f7f7;
    --fill-hatch: repeating-linear-gradient(45deg, #000 0 1px, transparent 1px 6px);
    --radius: 0px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg-1);
    color: var(--text-1);
    font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    min-height: 100vh;
}

a { color: var(--text-1); text-decoration: underline; text-underline-offset: 2px; }
a:hover { background: var(--text-1); color: #fff; text-decoration: none; }

/* ====================================================================
   GLOBAL HOVER / ACTIVE CONTRAST POLICY
   --------------------------------------------------------------------
   Rule of thumb (wireframe theme):
     - Containers whose hover/active background is BLACK (#000)
         → ALL descendant text + icons must paint #fff
         → embedded .badge / .chip flip to white-pill / black-text
     - Containers whose hover background is LIGHT GREY (#f0f0f0)
         → ALL descendant text paints PURE #000 (overrides .muted
            and other low-contrast greys that would otherwise read poorly)
     - Containers whose hover background is OFF-WHITE (#fafafa, zebra)
         → text remains as defined per component (grey-out is intentional
            for .due-list .due-row)
     - SVG icons in this codebase use stroke="currentColor", so once the
       text color above is set, icons follow automatically.
   ==================================================================== */

/* ---- Group A: BLACK hover/active backgrounds → white descendants -- */
.btn:not(.ghost):not(.danger),
.btn:not(.ghost):not(.danger) *,
.btn.ghost:hover,
.btn.ghost:hover *,
.btn.danger:hover,
.btn.danger:hover *,
.pagination a:hover,
.pagination a:hover *,
.pagination .current,
.pagination .current *,
.modal-close:hover,
.modal-close:hover *,
.contact-link:hover,
.contact-link:hover *,
.logout-form button:hover,
.logout-form button:hover *,
.tab.active,
.tab.active *,
.sidebar nav a.active,
.sidebar nav a.active *,
.sidebar .nav a.active,
.sidebar .nav a.active *,
input[type="file"]::file-selector-button:hover,
input[type="file"]::file-selector-button:hover *,
input[type="file"]::-webkit-file-upload-button:hover,
.attachment-file-cta:hover,
.attachment-file-cta:hover *,
.assignee-item.active,
.assignee-item.active *,
.kanban-card.kanban-card--dragging,
.kanban-card.kanban-card--dragging * {
    color: #fff !important;
}
/* SVG icons inside black-bg parents */
.btn:not(.ghost):not(.danger) svg,
.btn.ghost:hover svg,
.btn.danger:hover svg,
.pagination a:hover svg,
.pagination .current svg,
.modal-close:hover svg,
.contact-link:hover svg,
.logout-form button:hover svg,
.sidebar nav a.active svg,
.sidebar .nav a.active svg,
.tab.active svg,
.assignee-item.active svg {
    stroke: #fff;
    fill: none;
    color: #fff;
}
/* Badges/chips in black-bg parents: invert pill (white bg, black text) */
.btn:not(.ghost):not(.danger) .badge,
.btn:not(.ghost):not(.danger) .chip,
.btn.ghost:hover .badge,
.btn.ghost:hover .chip,
.contact-link:hover .badge,
.contact-link:hover .chip,
.sidebar nav a.active .badge,
.sidebar nav a.active .nav-badge,
.sidebar .nav a.active .badge,
.sidebar .nav a.active .nav-badge,
.tab.active .badge,
.tab.active .chip,
.pagination .current .badge,
.modal-close:hover .badge,
.assignee-item.active .badge,
.assignee-item.active .chip {
    background: #fff !important;
    color: #000 !important;
    border-color: #fff !important;
}

/* ---- Default <a>:hover (global black bg) → also white descendants - */
a:hover small,
a:hover strong,
a:hover .muted,
a:hover .muted-count,
a:hover span:not(.badge):not(.chip):not(.dot),
a:hover svg {
    color: #fff;
    stroke: #fff;
}

/* ---- Group B: LIGHT GREY hover (#f0f0f0) → all text pure black ---- */
/*   These containers set background to var(--hover-bg) on hover. The
     descendant rules below ensure low-contrast greys (.muted, small,
     var(--text-3)) flip to solid black for AA contrast on #f0f0f0.
     Chips/badges/pipe-dots are excluded so their own color tokens stick. */
.sidebar nav a:not(.active):hover,
.sidebar nav a:not(.active):hover :not(.badge):not(.chip):not(.nav-badge):not(.pipe-chip):not(.pipe-dot),
.sidebar .nav a:not(.active):hover,
.sidebar .nav a:not(.active):hover :not(.badge):not(.chip):not(.nav-badge):not(.pipe-chip):not(.pipe-dot),
.user-card-link:hover,
.user-card-link:hover :not(.badge):not(.chip),
.tbl tbody tr:hover,
.tbl tbody tr:hover :not(.badge):not(.chip):not(.pipe-chip):not(.pipe-dot),
.perf-table tbody tr:hover,
.perf-table tbody tr:hover :not(.badge):not(.chip):not(.pipe-chip):not(.pipe-dot),
.kanban-card:hover,
.kanban-card:hover :not(.badge):not(.chip):not(.pipe-chip):not(.pipe-dot):not(.kanban-owner),
.assignee-item:not(.active):hover,
.assignee-item:not(.active):hover :not(.badge):not(.chip),
.attachment-link:hover,
.attachment-link:hover :not(.badge):not(.chip),
.tab:not(.active):hover,
.tab:not(.active):hover :not(.badge):not(.chip),
.search-results a:hover,
.search-results a:hover :not(.badge):not(.chip):not(.pipe-chip),
.search-results .lead-row:hover,
.search-results .lead-row:hover :not(.badge):not(.chip):not(.pipe-chip),
.theme-toggle:hover,
.theme-toggle:hover :not(.badge):not(.chip),
.kanban-lane--over {
    color: #000;
}
/* SVG icons inside light-grey hover containers stay black */
.sidebar nav a:not(.active):hover svg,
.sidebar .nav a:not(.active):hover svg,
.user-card-link:hover svg,
.tbl tbody tr:hover svg,
.perf-table tbody tr:hover svg,
.kanban-card:hover svg,
.assignee-item:not(.active):hover svg,
.attachment-link:hover svg,
.tab:not(.active):hover svg,
.search-results a:hover svg,
.search-results .lead-row:hover svg,
.theme-toggle:hover svg {
    stroke: #000;
    color: #000;
}
/* Inside light-grey hover, badges/chips keep their normal black-on-white */
.sidebar nav a:not(.active):hover .badge,
.sidebar nav a:not(.active):hover .nav-badge.nav-badge--bad,
.tbl tbody tr:hover .badge,
.kanban-card:hover .badge,
.kanban-card:hover .chip.hot { /* hot chip stays solid black */ }

/* ---- Group C: explicit grey-out (off-white bg, deliberately faded) - */
/* due-list rows are intentionally muted on hover — keep #808080. */
.due-list .due-row:hover,
.due-list .due-row:hover :not(.badge):not(.chip):not(.dot) {
    color: #808080;
}
.due-list .due-row:hover svg { stroke: #808080; }

/* ---- BTN default (black) → BTN:hover (white bg) — flip child colors  */
.btn:not(.ghost):not(.danger):hover,
.btn:not(.ghost):not(.danger):hover *,
.btn:not(.ghost):not(.danger):hover svg {
    color: #000 !important;
    stroke: #000;
}
.btn:not(.ghost):not(.danger):hover .badge,
.btn:not(.ghost):not(.danger):hover .chip {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

h1, h2, h3, h4, h5 {
    font-family: inherit;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
h1 { font-size: 18px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
h4, h5 { font-size: 13px; }

p { margin: 0 0 8px; }
small { font-size: 11px; color: var(--text-2); }
.muted { color: var(--text-3); }
.muted-count { color: var(--text-3); font-size: 11px; }

hr { border: 0; border-top: 1px dashed var(--border); margin: 12px 0; }

/* -- LAYOUT --------------------------------------------------------- */
.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.main {
    padding: 20px 24px 60px;
    border-left: 1px solid var(--border);
    min-width: 0;
}

/* -- SIDEBAR -------------------------------------------------------- */
.sidebar {
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 14px 12px;
    position: sticky; top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex; flex-direction: column;
}
.sidebar h2,
.sidebar .nav-group-title,
.sidebar .group-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-3);
    margin: 14px 6px 6px;
    border-bottom: 1px dashed var(--border-soft);
    padding-bottom: 4px;
}
.brand {
    display: flex; align-items: center; gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #000;
    margin-bottom: 4px;
}
.brand-mark {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid #000;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; }
.brand-text span { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }

.sidebar nav, .sidebar .nav {
    display: flex; flex-direction: column;
    flex: 1;
}
.sidebar nav a,
.sidebar .nav a,
.sidebar a.nav-link {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px;
    border: 1px solid transparent;
    margin: 1px 0;
    text-decoration: none;
    color: var(--text-1);
    font-size: 12px;
}
.sidebar nav a:hover,
.sidebar .nav a:hover,
.sidebar a.nav-link:hover {
    background: var(--hover-bg);
    color: var(--text-1);
    border: 1px solid var(--border-soft);
    text-decoration: none;
}
.sidebar nav a.active,
.sidebar .nav a.active,
.sidebar a.nav-link.active,
.sidebar nav a[aria-current="page"] {
    background: #000; color: #fff;
    border: 1px solid #000;
}
.sidebar nav a .badge,
.sidebar .nav a .badge,
.sidebar a.nav-link .badge,
.nav-badge { margin-left: auto; }
.nav-badge {
    display: inline-block;
    padding: 0 5px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font-size: 10px;
    line-height: 1.4;
}
.nav-badge--bad { background: #000; color: #fff; border-style: solid; }
.nav-badge--warn { background: #d9d9d9; color: #000; }
.sidebar nav a.active .nav-badge,
.sidebar .nav a.active .nav-badge { background: #fff; color: #000; }

.logout-form { display: inline-flex; margin: 0; }
.logout-form button {
    width: 28px; height: 28px;
    border: 1px solid #000;
    background: #fff;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
}
.logout-form button:hover { background: #000; color: #fff; }

.sidebar-search {
    position: relative;
    margin: 4px 4px 12px;
}
.sidebar-search input {
    width: 100%;
    padding: 6px 8px 6px 26px;
    border: 1px solid var(--border);
    background: #fff;
    font: inherit;
}
.sidebar-search-icon {
    position: absolute; left: 8px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
}
.sidebar-search-pop {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1px solid #000;
    z-index: 50;
    max-height: 320px; overflow-y: auto;
}

.user-card,
.user-card-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px;
    border: 1px solid var(--border);
    margin-top: 12px;
    text-decoration: none; color: inherit;
}
.user-card-link:hover { background: var(--hover-bg); color: inherit; }
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-avatar,
.profile-avatar {
    width: 28px; height: 28px;
    border: 1px solid #000;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
    background: #fff;
}

/* -- TOPBAR --------------------------------------------------------- */
.topbar {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 2px solid #000;
}
.topbar h1 { margin-bottom: 2px; }
.topbar p { color: var(--text-3); font-size: 12px; margin: 0; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* -- BUTTONS -------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border: 1.5px solid #000;
    background: #000;
    color: #fff;
    font: inherit;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: #fff; color: #000; text-decoration: none; }
.btn.ghost,
.btn.ghost:link {
    background: #fff;
    color: #000;
}
.btn.ghost:hover { background: #000; color: #fff; }
.btn.danger { background: #fff; color: #000; border-style: dashed; }
.btn.danger:hover { background: #000; color: #fff; border-style: solid; }
.btn[disabled], .btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-icon {
    width: 28px; height: 28px;
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}

.theme-toggle {
    border: 1px solid var(--border);
    background: #fff;
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.theme-toggle:hover { background: var(--hover-bg); }
.icon-sun, .icon-moon { width: 14px; height: 14px; }

/* -- CARDS ---------------------------------------------------------- */
.card {
    background: #fff;
    border: 1px solid #000;
    padding: 14px;
    margin: 0;
    min-width: 0;
}
.card + .card { margin-top: 0; }
.card-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--text-1);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-soft);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    flex-shrink: 0;
}
.card-title h3 { margin: 0; }

/* Grid-item cards: stretch to row height and let last child fill remaining
   vertical space. Scoped to .grid > .card so the filter form (which has both
   .card and .filters) keeps its row-flex layout. */
.grid > .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    align-self: stretch;
}
.grid > .card > * { min-width: 0; }
.grid > .card > *:last-child:not(.card-title) { flex-grow: 1; }
.grid > .card > div[style*="height:240px"],
.grid > .card > div[style*="height:260px"],
.grid > .card > div[style*="height: 240px"],
.grid > .card > div[style*="height: 260px"] {
    flex: 0 0 auto;
    min-height: 240px;
    max-height: 320px;
}

/* -- GRID ----------------------------------------------------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    grid-auto-flow: row dense;
    align-items: stretch;
    min-width: 0;
}
.grid > .card,
.grid > .col-3,
.grid > .col-4,
.grid > .col-6,
.grid > .col-8,
.grid > .col-12 { align-self: stretch; height: auto; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
@media (max-width: 1100px) {
    .col-3, .col-4 { grid-column: span 6; }
    .col-8 { grid-column: span 12; }
}
@media (max-width: 720px) {
    .col-3, .col-4, .col-6, .col-8 { grid-column: span 12; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .main { border-left: 0; padding: 14px; }
}

/* -- USER CARD POSITIONING ----------------------------------------- */
.sidebar .user-card { margin-top: auto; }
.user-card .user-card-link { flex: 1; padding: 0; border: 0; }
.user-card .user-card-link:hover { background: transparent; }

/* -- FILTERS / FORMS ------------------------------------------------ */
html, body, form, input, select, textarea, button {
    accent-color: #000;
    color-scheme: light;
}
.filters {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 10px;
    align-items: center;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"],
input[type="tel"], input[type="url"], input[type="month"],
input[type="time"], input[type="datetime-local"],
textarea {
    border: 1px solid #000;
    background: #fff;
    color: var(--text-1);
    padding: 5px 8px;
    font: inherit;
    font-size: 12px;
    min-height: 28px;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
}
/* Native select: custom black caret SVG, white track, sharp edges */
select {
    border: 1px solid #000;
    background: #fff;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'><polygon points='0,0 10,0 5,8' fill='%23000'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px 8px;
    color: var(--text-1);
    padding: 5px 26px 5px 8px;
    font: inherit;
    font-size: 12px;
    min-height: 28px;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
select::-ms-expand { display: none; }
select option {
    background: #fff;
    color: #000;
}
textarea { min-height: 60px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: 2px solid #000;
    outline-offset: -1px;
}
input::placeholder, textarea::placeholder { color: var(--text-3); font-style: italic; }

/* Native date/time picker icon → force black */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="search"]::-webkit-search-cancel-button {
    filter: grayscale(100%) contrast(2);
    cursor: pointer;
    opacity: 0.7;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Number spinners: keep but desaturate */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    filter: grayscale(100%);
    opacity: 0.7;
}

/* Custom black checkbox / radio (cross-browser greyscale) */
input[type="checkbox"], input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border: 1.5px solid #000;
    background: #fff;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
    border-radius: 0;
    position: relative;
    flex-shrink: 0;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked {
    background: #000;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><polyline points='1,5 4,8 9,2' fill='none' stroke='%23fff' stroke-width='2'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}
input[type="radio"]:checked {
    background: #fff;
    box-shadow: inset 0 0 0 3px #000;
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled { opacity: 0.4; cursor: not-allowed; }

/* Range slider greyscale */
input[type="range"] {
    accent-color: #000;
    background: transparent;
}

/* File input: minimal wireframe button */
input[type="file"] {
    border: 1px dashed #000;
    background: #fff;
    padding: 4px;
    font: inherit; font-size: 11px;
    cursor: pointer;
}
input[type="file"]::-webkit-file-upload-button,
input[type="file"]::file-selector-button {
    border: 1px solid #000;
    background: #fff;
    color: #000;
    padding: 3px 8px;
    margin-right: 8px;
    font: inherit; font-size: 11px;
    cursor: pointer;
    text-transform: uppercase;
}
input[type="file"]::-webkit-file-upload-button:hover,
input[type="file"]::file-selector-button:hover { background: #000; color: #fff; }

/* Autofill (Chrome): override yellow tint to white */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: #000;
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 5000s ease-in-out 0s;
}

.filter-bar { display: flex; flex-wrap: wrap; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.field-check .check-wrap { display: inline-flex; align-items: center; gap: 6px; }

.form-section {
    border: 1px dashed var(--border-soft);
    padding: 12px;
    margin: 12px 0;
}
.form-section h3 {
    margin-top: 0; margin-bottom: 10px;
    border-bottom: 1px solid #000;
    padding-bottom: 4px;
}
.form-section--collapse summary { cursor: pointer; padding: 4px 0; }
.form-actions {
    display: flex; gap: 8px; padding-top: 12px;
    border-top: 1px dashed var(--border-soft);
    margin-top: 12px;
}
.lead-edit-form .form-section { background: #fff; }

/* -- BADGES / CHIPS ------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font-size: 11px;
    letter-spacing: 0.04em;
    line-height: 1.4;
}
.chip {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid #000;
    background: #fff;
    font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.08em;
}
.chip.hot   { background: #000; color: #fff; }
.chip.warm  { background: #d9d9d9; color: #000; }
.chip.cold  { background: #fff; color: #000; }
.chip.ok    { background: #000; color: #fff; }
.chip.bad   { background: #fff; color: #000; border-style: dashed; }
.chip.neutral, .chip.muted { background: #fff; color: var(--text-3); border-color: var(--border-soft); }
.chip.danger { background: #fff; color: #000; border-style: dashed; }

.hot   { color: #000; }
.warm  { color: #000; }
.cold  { color: #000; }
.ok, .good   { color: #000; }
.bad, .danger { color: #000; }
.neutral { color: var(--text-3); }

/* -- KPI ------------------------------------------------------------ */
.kpi-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 12px;
}
.kpi {
    border: 1px solid #000;
    background: #fff;
    color: #000;
    padding: 10px 12px;
}
.kpi .label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
    color: inherit;
    opacity: 0.7;
}
.kpi .num, .kpi .value {
    font-size: 22px; font-weight: 700;
    margin-top: 2px;
    letter-spacing: 0.02em;
    color: inherit;
}
.kpi .delta { font-size: 11px; color: inherit; opacity: 0.75; }
.kpi .delta strong { opacity: 1; }

/* Dark-tinted KPI cards: force white text + lighter sub-labels */
.kpi.tint-4, .kpi.tint-5, .kpi.tint-6 { color: #fff; border-color: #000; }
.kpi.tint-4 .label, .kpi.tint-5 .label, .kpi.tint-6 .label,
.kpi.tint-4 .delta, .kpi.tint-5 .delta, .kpi.tint-6 .delta { color: #fff; opacity: 0.85; }
.kpi.tint-4 small, .kpi.tint-5 small, .kpi.tint-6 small,
.kpi.tint-4 strong, .kpi.tint-5 strong, .kpi.tint-6 strong { color: #fff; }
/* tint-4 is medium grey — slightly darken for AA contrast with white */
.kpi.tint-4 { background: #707070; }

/* -- TABLES --------------------------------------------------------- */
table.tbl, .tbl, .perf-table, .assign-table, .matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.tbl th, .tbl td,
.perf-table th, .perf-table td,
.assign-table th, .assign-table td,
.matrix-table th, .matrix-table td {
    padding: 6px 8px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
.tbl th, .perf-table th, .assign-table th, .matrix-table th {
    background: #f0f0f0;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.1em;
}
.tbl tbody tr:nth-child(even),
.perf-table tbody tr:nth-child(even),
.assign-table tbody tr:nth-child(even) { background: var(--fill-zebra); }
.tbl tbody tr:hover,
.perf-table tbody tr:hover { background: var(--hover-bg); cursor: default; }

.tbl-compact td, .tbl-compact th { padding: 3px 6px; font-size: 11px; }

.matrix-cell { text-align: center; }
.matrix-total { font-weight: 700; background: #f0f0f0 !important; }

/* -- PAGINATION ----------------------------------------------------- */
.pagination {
    display: flex; gap: 4px; align-items: center;
    margin-top: 10px;
    font-size: 12px;
}
.pagination a, .pagination span {
    padding: 3px 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-1);
    background: #fff;
}
.pagination .current, .pagination a:hover {
    background: #000; color: #fff;
}

/* -- TOASTS / ALERTS ------------------------------------------------ */
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 6px; }
.toast {
    background: #fff;
    border: 1.5px solid #000;
    padding: 8px 12px;
    font-size: 12px;
    min-width: 220px;
}
.toast.success { border-style: solid; }
.toast.error, .toast.bad { border-style: dashed; }
.toast.warning, .toast.warn { background: #f0f0f0; }

.auth-alert, .alert-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border: 1.5px solid #000;
    background: #fff;
    font-size: 12px;
}
.alert-pill--bad { border-style: dashed; }
.alert-pill--warn { background: #f0f0f0; }
.auth-alert.bad { border-style: dashed; }

/* -- LOGIN ---------------------------------------------------------- */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: start center;
    background: #fff;
    padding: 8vh 20px 20px;
}
.auth-card {
    width: 100%; max-width: 480px;
    border: 1.5px solid #000;
    padding: 20px;
    background: #fff;
}
.auth-brand {
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid #000;
    padding-bottom: 10px; margin-bottom: 12px;
}
.auth-body { display: flex; flex-direction: column; gap: 10px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-submit { width: 100%; justify-content: center; }
.auth-foot { font-size: 11px; color: var(--text-3); margin-top: 8px; }
/* ---- Demo accounts: bottom-left FAB + drop-up popover ---- */
.auth-demo-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    z-index: 199;
    cursor: pointer;
}
.auth-demo-backdrop[hidden] { display: none; }
.auth-demo-dock {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.auth-demo-fab {
    width: 36px; height: 36px;
    border: 1.5px solid #000;
    background: #fff;
    color: #000;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    position: relative;
}
.auth-demo-fab:hover,
.auth-demo-dock--open .auth-demo-fab {
    background: #000;
    color: #fff;
}
.auth-demo-fab:hover svg,
.auth-demo-dock--open .auth-demo-fab svg { stroke: #fff; }
.auth-demo-fab::after {
    content: "DEMO";
    position: absolute;
    top: -6px; right: -6px;
    background: #000; color: #fff;
    border: 1px solid #000;
    font-size: 8px;
    letter-spacing: 0.12em;
    padding: 0 4px;
    line-height: 1.4;
}
.auth-demo-dock--open .auth-demo-fab::after {
    background: #fff; color: #000;
}

/* Popover opens UPWARD from the FAB */
.auth-demo-pop {
    width: 300px;
    max-height: 60vh;
    background: #fff;
    border: 1.5px solid #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px -4px 0 #000;
}
.auth-demo-pop[hidden] { display: none; }
.auth-demo-pop-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #000;
    background: #f0f0f0;
}
.auth-demo-pop-head h2 {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.1em;
}
.auth-demo-pop-head .muted {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.auth-demo-pop-body {
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.auth-demo-pop-foot {
    padding: 6px 10px;
    border-top: 1px dashed var(--border-soft);
    background: #fafafa;
    font-size: 10px;
    color: var(--text-3);
}

.auth-demo-group {
    border: 1px dashed var(--border-soft);
    padding: 8px 10px;
}
.auth-demo-group-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 8px;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--border-soft);
    margin-bottom: 4px;
}
.auth-demo-group-head h3 { margin: 0; font-size: 11px; }
.auth-demo-group-head .muted { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }

.auth-demo-list {
    list-style: none;
    padding: 0; margin: 0;
    display: flex; flex-direction: column;
    gap: 2px;
}

/* Demo row: full-width clickable button, grid: name / password / arrow */
.auth-demo-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid var(--border-soft);
    background: #fff;
    color: #000;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.auth-demo-row + .auth-demo-row,
.auth-demo-list li + li .auth-demo-row { /* tighter stacking when multiple rows */ }
.auth-demo-row:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}
.auth-demo-row:hover * { color: #fff; }
.auth-demo-row:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.auth-demo-user {
    display: flex; flex-direction: column;
    min-width: 0;
}
.auth-demo-user strong { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.auth-demo-user small  { font-size: 10px; color: var(--text-3); }

.auth-demo-pass {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--text-3);
    padding: 1px 6px;
    border: 1px dashed var(--border-soft);
    background: #fafafa;
    white-space: nowrap;
}
.auth-demo-row:hover .auth-demo-pass {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.auth-demo-arrow {
    font-size: 14px;
    line-height: 1;
    color: var(--text-3);
}
.auth-demo-row:hover .auth-demo-arrow { color: #fff; }

.auth-demo-badge {
    border: 1px solid currentColor;
    padding: 0 5px;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .auth-demo-pop { width: calc(100vw - 32px); }
}

/* -- MODAL ---------------------------------------------------------- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 999;
    display: grid; place-items: center;
    padding: 20px;
}
.modal-card {
    background: #fff;
    border: 2px solid #000;
    width: 100%;
    max-width: 1080px;
    max-height: 90vh;
    display: flex; flex-direction: column;
}
.modal-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start; gap: 8px;
    padding: 14px 16px;
    padding-right: 56px;
    border-bottom: 1px solid #000;
    position: relative;
    background: #fafafa;
}
.modal-head-left h2, .modal-head-left h3 { margin: 0; }
.modal-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.modal-close {
    position: absolute; right: 10px; top: 10px;
    width: 28px; height: 28px;
    border: 1px solid #000; background: #fff;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; line-height: 1;
}
.modal-close:hover { background: #000; color: #fff; }
.modal-body {
    overflow-y: auto;
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 14px;
}
.modal-section {
    border: 1px dashed var(--border-soft);
    padding: 10px 12px;
}
.modal-section h4 {
    margin: 0 0 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
}
.modal-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-timeline { display: flex; flex-direction: column; gap: 6px; }
.modal-act {
    border: 1px solid var(--border);
    padding: 6px 8px;
}
.modal-act-head {
    display: flex; gap: 6px; align-items: baseline;
    font-size: 11px; color: var(--text-3);
}
.modal-act-body { font-size: 12px; }
.modal-act-note { font-size: 11px; color: var(--text-3); font-style: italic; }
.modal-act-foot {
    display: flex; justify-content: space-between;
    font-size: 10px; color: var(--text-3);
    margin-top: 4px;
}

.kv-grid {
    display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px;
    font-size: 12px;
}
.kv-grid dt { color: var(--text-3); text-transform: uppercase; font-size: 10px; letter-spacing: 0.08em; padding-top: 2px; }
.kv-grid dd { margin: 0; }
.kv-wide { grid-template-columns: 160px 1fr; }

/* -- KANBAN PIPELINE ----------------------------------------------- */
.kanban {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 1fr);
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.kanban-col {
    background: #fff;
    border: 1px solid #000;
    min-height: 320px;
    display: flex; flex-direction: column;
}
.kanban-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #000;
    background: #f0f0f0;
}
.kanban-head h3 { margin: 0; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kanban-lane-meta { padding: 4px 10px; font-size: 11px; color: var(--text-3); border-bottom: 1px dashed var(--border-soft); }
.kanban-lane {
    flex: 1;
    padding: 8px;
    display: flex; flex-direction: column; gap: 6px;
    min-height: 200px;
}
.kanban-lane--over { background: var(--fill-zebra); outline: 2px dashed #000; outline-offset: -4px; }
.kanban-empty { color: var(--text-3); font-style: italic; font-size: 11px; text-align: center; padding: 12px; border: 1px dashed var(--border-soft); }
.kanban-more { display: block; text-align: center; padding: 4px; font-size: 11px; border-top: 1px dashed var(--border-soft); margin-top: 4px; }

.kanban-card {
    background: #fff;
    border: 1px solid #000;
    padding: 6px 8px;
    cursor: grab;
    user-select: none;
}
.kanban-card:hover { background: var(--hover-bg); }
.kanban-card--dragging { opacity: 0.4; cursor: grabbing; }
.kanban-card-head {
    display: flex; justify-content: space-between; gap: 6px; align-items: center;
    margin-bottom: 4px;
}
.kanban-card-title {
    font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
    cursor: pointer;
}
.kanban-card-meta {
    display: flex; flex-wrap: wrap; gap: 4px;
    font-size: 11px; color: var(--text-3);
}
.kanban-card-foot {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-top: 4px; padding-top: 4px;
    border-top: 1px dashed var(--border-soft);
    font-size: 11px;
}
.kanban-value { font-weight: 700; }
.kanban-owner {
    border: 1px solid #000;
    padding: 0 4px;
    font-size: 10px;
    margin-left: auto;
}

.pipe-dot {
    display: inline-block; width: 8px; height: 8px;
    border: 1px solid #000; background: #fff;
}
.pipe-dot-pending { background: #fff; }
.pipe-dot-open { background: #d9d9d9; }
.pipe-dot-negotiation { background: #808080; }
.pipe-dot-proposal { background: #404040; }
.pipe-dot-closing { background: #1a1a1a; }
.pipe-dot-won { background: #000; }
.pipe-dot-lost { background: #fff; border-style: dashed; }

.pipe-chip {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid #000;
    background: #fff;
    font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.06em;
}
.pipe-select {
    border: 1px solid #000;
    background: #fff;
    padding: 2px 6px;
    font: inherit;
    font-size: 11px;
}

/* -- CHARTS --------------------------------------------------------- */
canvas { max-width: 100%; }

/* -- FUNNEL --------------------------------------------------------- */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-step {
    display: grid; grid-template-columns: 130px 1fr 110px;
    gap: 10px; align-items: center;
    font-size: 12px;
}
.funnel-label { color: var(--text-1); text-transform: uppercase; font-size: 10px; letter-spacing: 0.08em; font-weight: 700; }
.funnel-bar {
    height: 16px;
    background: #fff;
    border: 1px solid #000;
    position: relative;
    overflow: hidden;
}
.funnel-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--fill-hatch);
    border-right: 1px solid #000;
    transition: width .35s ease;
}
.funnel-bar > span:empty { box-sizing: border-box; }
.funnel-bar .step-pending     { background: repeating-linear-gradient(45deg, #fff 0 4px, #d9d9d9 4px 8px); }
.funnel-bar .step-open        { background: repeating-linear-gradient(45deg, #fff 0 3px, #b3b3b3 3px 6px); }
.funnel-bar .step-negotiation { background: #b3b3b3; }
.funnel-bar .step-proposal    { background: #808080; }
.funnel-bar .step-closing     { background: #404040; }
.funnel-bar .step-won         { background: #000; }
.funnel-bar .step-lost        { background: repeating-linear-gradient(135deg, #fff 0 4px, #000 4px 5px); }
.funnel-value { text-align: right; font-weight: 700; }

/* -- TIMELINE / ACTIVITIES ----------------------------------------- */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-row {
    border: 1px solid var(--border);
    padding: 8px 10px;
    background: #fff;
}
.timeline-head {
    display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
    font-size: 11px; color: var(--text-3);
}
.timeline-icon {
    display: inline-flex; width: 18px; height: 18px;
    border: 1px solid #000; align-items: center; justify-content: center;
    font-size: 10px;
}
.timeline-body { font-size: 12px; }
.timeline-meta { font-size: 11px; color: var(--text-3); display: flex; gap: 8px; }
.timeline-notes { font-size: 11px; color: var(--text-2); font-style: italic; margin-top: 4px; }
.timeline-foot {
    display: flex; justify-content: space-between;
    font-size: 10px; color: var(--text-3); margin-top: 4px;
}
.timeline-actions { display: flex; gap: 6px; }

.act-badge {
    display: inline-block; padding: 0 5px;
    border: 1px solid #000; background: #fff;
    font-size: 10px; text-transform: uppercase;
}

/* -- DUE / FOLLOW-UP ----------------------------------------------- */
.due-banner {
    display: flex; gap: 10px;
    border: 1.5px solid #000; padding: 10px;
    background: #f0f0f0;
}
.due-banner-icon { font-size: 22px; }
.due-banner-body { display: flex; flex-direction: column; gap: 4px; }
.due-badge {
    display: inline-block;
    padding: 1px 6px;
    border: 1px dashed #000;
    background: #fff;
    font-size: 10px;
    text-transform: uppercase;
}

/* Make the Follow-up + Sales Pipeline row taller so the list shows more
   items at once and the funnel doesn't feel cramped. */
.grid > .card#due-panel,
.grid > .card#pipeline-panel {
    min-height: 480px;
}

/* Summary pills shown above the list */
.due-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.due-pill {
    border: 1px solid #000;
    background: #fff;
    padding: 6px 10px;
    display: flex; flex-direction: column; align-items: center;
    gap: 2px;
    text-align: center;
}
.due-pill strong {
    font-size: 20px;
    line-height: 1.1;
    font-weight: 700;
}
.due-pill span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
}
.due-pill.due-overdue  { background: #000; color: #fff; border-color: #000; }
.due-pill.due-overdue span { color: #fff; opacity: 0.85; }
.due-pill.due-today    { background: #d9d9d9; color: #000; }
.due-pill.due-upcoming { background: #fff; color: #000; border-style: dashed; }

/* Scrollable list — fills remaining card height, scrolls internally */
.due-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
    margin-right: -4px;
}
.due-list .due-row {
    display: block;
    padding: 8px 10px;
    border: 1px solid var(--border-soft);
    text-decoration: none;
    color: #000;
    background: #fff;
}
.due-list .due-row .due-row-head {
    display: flex; align-items: baseline; gap: 6px;
    font-size: 12px;
}
.due-list .due-row strong {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.due-list .due-row .dot {
    display: inline-block;
    width: 8px; height: 8px;
    border: 1px solid #000;
    background: #fff;
    flex-shrink: 0;
}
.due-list .due-row.due-overdue .dot  { background: #000; }
.due-list .due-row.due-today .dot    { background: #707070; }
.due-list .due-row.due-upcoming .dot { background: #fff; }
.due-list .due-row .due-row-date {
    font-size: 11px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.due-list .due-row small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: var(--text-3);
}
.due-list .due-row.due-overdue { border-left: 3px solid #000; }
.due-list .due-row.due-today   { border-left: 3px solid #707070; }
.due-list .due-row.due-upcoming{ border-left: 3px dashed #b3b3b3; }

/* Hover: grey out the text (no inversion) */
.due-list .due-row:hover,
.due-list .due-row:hover strong,
.due-list .due-row:hover small,
.due-list .due-row:hover .due-row-date,
.due-list .due-row:hover .muted {
    color: #808080;
    background: #fafafa;
    text-decoration: none;
}
.due-list .due-row:hover .dot { border-color: #808080; }

/* -- ASSIGNMENT WORKBENCH ------------------------------------------ */
.assign-toolbar {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    padding: 10px; border: 1px solid #000; background: #fff;
}
.assign-panel { border: 1px solid #000; padding: 10px; background: #fff; margin-top: 10px; }
.assign-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.assign-action { display: inline-flex; gap: 6px; align-items: center; }
.assignee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.assignee-item {
    border: 1px solid var(--border);
    padding: 6px 8px;
    cursor: pointer;
    background: #fff;
    display: flex; align-items: center; gap: 8px;
}
.assignee-item:hover { background: var(--hover-bg); }
.assignee-item.active, .assignee-item.picked\: { background: #000; color: #fff; border-color: #000; }
.selected-count { font-weight: 700; }
.row-check, .row-check-av, .row-check-in { width: 16px; height: 16px; accent-color: #000; }
.select-all { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }

/* -- QUOTA ---------------------------------------------------------- */
.quota-bar { margin: 8px 0; }
.quota-bar-head {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-3);
    margin-bottom: 2px;
}
.quota-bar-track {
    height: 12px;
    background: #fff;
    border: 1px solid #000;
    position: relative;
    overflow: hidden;
}
.quota-bar-track--inline { height: 8px; }
.quota-bar-fill {
    height: 100%;
    background: var(--fill-hatch);
}
.quota-pct { font-weight: 700; font-size: 11px; }
.quota-self { padding: 10px; border: 1px solid #000; background: #fff; }

/* -- REVENUE -------------------------------------------------------- */
.revenue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.revenue-kpi {
    border: 1px solid #000;
    padding: 10px;
    background: #fff;
}
.revenue-kpi .label { font-size: 10px; text-transform: uppercase; color: var(--text-3); letter-spacing: 0.1em; }
.revenue-kpi .num { font-size: 18px; font-weight: 700; }
.revenue-kpi--accent { background: #f0f0f0; }
.revenue-kpi--good { border-width: 2px; }
.revenue-subhead { font-size: 11px; color: var(--text-3); }

/* -- PRIORITY ------------------------------------------------------- */
.priority-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
}
.priority-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.priority-head {
    display: flex; justify-content: space-between;
    border-bottom: 1px solid #000;
    padding-bottom: 4px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
}
.priority-head--hot { background: #000; color: #fff; padding: 4px 6px; }
.priority-head--hot .muted,
.priority-head--hot small,
.priority-head--hot .dot { color: #fff; }
.priority-head--warm { background: #d9d9d9; color: #000; padding: 4px 6px; }
.priority-head--warm .muted,
.priority-head--warm small { color: #000; opacity: 0.7; }
.priority-scroll { max-height: 280px; overflow-y: auto; overflow-x: auto; padding-right: 4px; }
.priority-scroll .tbl { width: 100%; table-layout: auto; }
.priority-scroll .tbl td,
.priority-scroll .tbl th { word-break: break-word; }

/* -- LOST / PARETO -------------------------------------------------- */
.bar {
    height: 10px;
    background: #fff;
    border: 1px solid #000;
    position: relative;
    overflow: hidden;
}
.bar > span {
    display: block;
    height: 100%;
    width: 0;
    background:
        repeating-linear-gradient(45deg, #000 0 1px, transparent 1px 6px),
        #000;
    border-right: 1px solid #000;
    transition: width .35s ease;
}
.legacy-note { font-size: 11px; color: var(--text-3); font-style: italic; }

/* -- LOST PARETO (lost.html) --------------------------------------- */
.lost-pareto { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.lost-row { display: flex; flex-direction: column; gap: 4px; }
.lost-row-head {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 12px;
}
.lost-label { font-weight: 600; }
.lost-count { font-variant-numeric: tabular-nums; }
.lost-bar-track {
    height: 12px;
    background: #fff;
    border: 1px solid #000;
    position: relative;
    overflow: hidden;
}
.lost-bar-fill {
    height: 100%;
    background: #000;
    border-right: 1px solid #000;
    transition: width .35s ease;
}
.lost-rank-1 { background: #000000; }
.lost-rank-2 { background: #404040; }
.lost-rank-3 { background: #707070; }
.lost-rank-4 { background: repeating-linear-gradient(45deg, #000 0 1px, #fff 1px 4px); }
.lost-rank-5,
.lost-rank-6,
.lost-rank-7,
.lost-rank-8,
.lost-rank-9 { background: repeating-linear-gradient(45deg, #000 0 1px, #fff 1px 6px); }
.lost-unclassified {
    border: 1px dashed #000;
    padding: 8px 10px;
    margin-top: 10px;
    font-size: 12px;
    background: #fafafa;
}
.lost-insight {
    border-top: 1px dashed var(--border-soft);
    padding-top: 8px; margin-top: 8px;
    font-size: 12px;
}

/* -- BARLIST (Top Reasons / Pareto) -------------------------------- */
.barlist { display: flex; flex-direction: column; gap: 8px; }
.barlist-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
        "name count"
        "bar  bar";
    gap: 3px 8px;
    font-size: 12px;
    align-items: baseline;
}
.barlist-row .name {
    grid-area: name;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}
.barlist-row .count {
    grid-area: count;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.barlist-row .bar {
    grid-area: bar;
    height: 8px;
}

/* -- DUPLICATES ---------------------------------------------------- */
.dup-groups { display: flex; flex-direction: column; gap: 12px; }
.dup-group { border: 1px solid #000; padding: 10px; background: #fff; }
.dup-group-head {
    display: flex; justify-content: space-between;
    border-bottom: 1px dashed var(--border-soft);
    padding-bottom: 6px; margin-bottom: 8px;
}
.dup-actions { display: flex; gap: 8px; margin-top: 8px; }
.dup-radio { accent-color: #000; }
.dup-check, .dup-warning {
    border: 1.5px solid #000;
    background: #f0f0f0;
    padding: 8px 10px;
    font-size: 12px;
}

/* -- ATTACHMENTS --------------------------------------------------- */
.attachment-list { display: flex; flex-direction: column; gap: 4px; }
.attachment-link {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    text-decoration: none; color: inherit;
    background: #fff;
}
.attachment-link:hover { background: var(--hover-bg); color: inherit; }
.attachment-icon { font-size: 14px; }
.attachment-name { font-size: 12px; }
.attachment-upload { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.attachment-file-input { display: none; }
.attachment-file-cta {
    border: 1px dashed #000;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
}
.attachment-file-name { font-size: 11px; color: var(--text-3); font-style: italic; }

/* -- AUDIT --------------------------------------------------------- */
.audit-list { display: flex; flex-direction: column; gap: 6px; }
.audit-row {
    border-left: 2px solid #000;
    padding: 6px 8px;
    background: #fafafa;
}
.audit-head { display: flex; gap: 6px; align-items: baseline; font-size: 11px; color: var(--text-3); }
.audit-badge {
    border: 1px solid #000; padding: 0 4px;
    font-size: 10px; text-transform: uppercase;
}
.audit-body { font-size: 12px; }
.audit-diff { display: flex; flex-direction: column; gap: 2px; font-family: inherit; font-size: 11px; }
.audit-old { color: var(--text-3); text-decoration: line-through; }
.audit-new { color: #000; font-weight: 700; }
.audit-arrow { color: var(--text-3); padding: 0 4px; }

/* -- PROFILE ------------------------------------------------------- */
.profile-summary {
    display: flex; gap: 12px; align-items: center;
    padding: 10px; border: 1px solid #000;
}
.profile-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }

/* -- TABS ---------------------------------------------------------- */
.tabs {
    display: flex; gap: 0;
    border-bottom: 2px solid #000;
    margin-bottom: 12px;
}
.tab {
    padding: 6px 12px;
    border: 1px solid #000;
    border-bottom: none;
    background: #fff;
    text-decoration: none;
    color: inherit;
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
}
.tab:hover { background: var(--hover-bg); color: inherit; }
.tab.active { background: #000; color: #fff; }

/* -- CAMPAIGNS ----------------------------------------------------- */
.campaign-card { border: 1px solid #000; padding: 12px; background: #fff; }
.campaign-form { display: flex; flex-direction: column; gap: 10px; }
.campaign-meta { font-size: 11px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; }

/* -- SERVICES / TARIFFS -------------------------------------------- */
.svc-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.svc-card { border: 1px solid #000; padding: 10px; background: #fff; }
.tariff-groups { display: flex; flex-direction: column; gap: 14px; }
.tariff-group { border: 1px solid #000; }
.tariff-group-head { padding: 8px 10px; background: #f0f0f0; border-bottom: 1px solid #000; font-weight: 700; }
.price-list { display: flex; flex-direction: column; }
.price-row {
    display: grid; grid-template-columns: 1fr auto auto;
    gap: 8px; padding: 6px 10px;
    border-top: 1px dashed var(--border-soft);
    font-size: 12px;
}
.price-row:first-child { border-top: 0; }
.scale { font-weight: 700; }
.price { text-align: right; }

/* -- SEARCH RESULTS ------------------------------------------------ */
.search-results { display: flex; flex-direction: column; }
.search-results a, .search-results .lead-row {
    display: block;
    padding: 6px 8px;
    border-bottom: 1px dashed var(--border-soft);
    text-decoration: none; color: inherit;
    cursor: pointer;
}
.search-results a:hover, .search-results .lead-row:hover { background: var(--hover-bg); }
.search-empty { padding: 10px; color: var(--text-3); font-style: italic; font-size: 12px; }
.search-result-main { font-weight: 700; font-size: 12px; }
.search-result-meta { font-size: 11px; color: var(--text-3); }
.search-result-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }

/* -- USER ACTIVITY (sidebar / dashboard) --------------------------- */
.user-act-types { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.user-act-row { display: flex; justify-content: space-between; padding: 4px 0; border-top: 1px dashed var(--border-soft); }
.user-act-count { font-weight: 700; }

/* -- ACTIVITY FORM ------------------------------------------------- */
.activity-form-card { border: 1px solid #000; padding: 12px; background: #fff; }

/* -- CONTACT LINKS / COMPANY -------------------------------------- */
.contact-link {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid var(--border);
    padding: 1px 6px;
    text-decoration: none; color: inherit;
    background: #fff;
    font-size: 11px;
}
.contact-link:hover { background: #000; color: #fff; }
.company { font-weight: 700; }
.cell.conversion { font-weight: 700; text-align: right; }

/* -- HEATMAP TINTS (greyscale) ------------------------------------- */
.tint-1 { background: #fafafa; }
.tint-2 { background: #ebebeb; }
.tint-3 { background: #d1d1d1; }
.tint-4 { background: #a8a8a8; color: #000; }
.tint-5 { background: #707070; color: #fff; }
.tint-6 { background: #000000; color: #fff; }
.heat-empty { background: repeating-linear-gradient(45deg, #fff 0 4px, #ebebeb 4px 8px); }

/* -- MISC UTIL ----------------------------------------------------- */
.value { font-weight: 700; }
.empty { color: var(--text-3); font-style: italic; padding: 12px; text-align: center; border: 1px dashed var(--border-soft); }

/* SVG icon defaults */
svg { stroke-width: 1.5; }

/* Scrollbar (subtle wireframe) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #fff; border-left: 1px dashed var(--border-soft); }
::-webkit-scrollbar-thumb { background: #000; border: 2px solid #fff; }

/* Print-friendly */
@media print {
    .sidebar, .topbar-actions, .btn { display: none; }
    .main { padding: 0; border: 0; }
    .card, .kpi { box-shadow: none; }
}
