/* =====================================================================
   ETCRM design system - layered on Bootstrap 5.3 through CSS variables.

   Light theme built around one ink colour, #0f172a:
   - Ink is used for text, headings, the primary button and active states.
   - Neutrals are the slate greys that belong to that ink.
   - Colour only ever means something: teal = a link or the thing in focus,
     amber = due, red = overdue or lost, green = won.
   - Surfaces are white on a very light grey page, with a hairline border
     and the faintest shadow.
   - The team is on the phone all day, so TIME leads: follow-up times and
     big numbers are set in a condensed face, like a timetable.
   ===================================================================== */

/* ---------- Typefaces (served locally, no CDN at run time) ---------- */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
    src: url("../lib/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap;
    src: url("../lib/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap;
    src: url("../lib/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-weight: 500; font-style: normal; font-display: swap;
    src: url("../lib/fonts/ibm-plex-sans-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-weight: 600; font-style: normal; font-display: swap;
    src: url("../lib/fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
    --et-ink: #0f172a;          /* text, headings, primary button */
    --et-ink-soft: #1e293b;
    --et-lagoon: #0e7490;       /* links, focus, accents */
    --et-lagoon-dark: #155e75;
    --et-lagoon-tint: #ecfeff;
    --et-marigold: #f59e0b;     /* due */
    --et-red: #dc2626;          /* overdue, lost */
    --et-green: #16a34a;        /* won */
    --et-sky: #7dd3fc;
    --et-slate: #64748b;
    --et-mist: #f8fafc;         /* page background */
    --et-hover: #f1f5f9;        /* hovered and selected rows, menu items */
    --et-paper: #ffffff;        /* panels */
    --et-line: #e2e8f0;
    --et-line-strong: #cbd5e1;
    --et-text: #1e293b;
    --et-muted: #64748b;

    --et-radius: 0.5rem;
    --et-radius-lg: 0.75rem;
    --et-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    --et-shadow-pop: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);

    --et-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --et-font-condensed: "IBM Plex Sans Condensed", "IBM Plex Sans", "Arial Narrow", system-ui, sans-serif;
    --et-sidebar-width: 244px;

    /* Bootstrap variables */
    --bs-body-font-family: var(--et-font);
    --bs-body-font-size: 0.9375rem;
    --bs-body-line-height: 1.5;
    --bs-body-color: var(--et-text);
    --bs-body-color-rgb: 30, 41, 59;
    --bs-body-bg: var(--et-mist);
    --bs-secondary-color: var(--et-muted);
    --bs-emphasis-color: var(--et-ink);
    --bs-heading-color: var(--et-ink);
    --bs-border-color: var(--et-line);
    --bs-border-radius: var(--et-radius);
    --bs-border-radius-sm: 0.375rem;
    --bs-border-radius-lg: var(--et-radius-lg);
    --bs-link-color: var(--et-lagoon);
    --bs-link-color-rgb: 14, 116, 144;
    --bs-link-hover-color: var(--et-lagoon-dark);
    --bs-link-hover-color-rgb: 21, 94, 117;
    --bs-primary: var(--et-ink);
    --bs-primary-rgb: 15, 23, 42;
    --bs-secondary: var(--et-slate);
    --bs-secondary-rgb: 100, 116, 139;
    --bs-success: var(--et-green);
    --bs-success-rgb: 22, 163, 74;
    --bs-info: var(--et-sky);
    --bs-info-rgb: 125, 211, 252;
    --bs-warning: var(--et-marigold);
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger: var(--et-red);
    --bs-danger-rgb: 220, 38, 38;
    --bs-dark: var(--et-ink);
    --bs-dark-rgb: 15, 23, 42;
    --bs-light-rgb: 248, 250, 252;
    --bs-focus-ring-color: rgba(14, 116, 144, 0.25);
}

html { font-size: 16px; }

body {
    min-height: 100vh;
    font-feature-settings: "tnum" 1;   /* figures line up in columns everywhere */
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 600; letter-spacing: -0.01em; }

.num, .time-figure { font-variant-numeric: tabular-nums; }
.font-condensed { font-family: var(--et-font-condensed); }

:focus-visible { outline: 2px solid var(--et-lagoon); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Bootstrap components retuned ---------- */
.btn { --bs-btn-font-weight: 500; --bs-btn-border-radius: var(--et-radius); --bs-btn-padding-x: 0.85rem; }
.btn-sm { --bs-btn-border-radius: 0.4rem; --bs-btn-padding-x: 0.6rem; }
.btn-lg { --bs-btn-border-radius: 0.625rem; }

.btn-primary {
    --bs-btn-bg: var(--et-ink); --bs-btn-border-color: var(--et-ink);
    --bs-btn-hover-bg: var(--et-ink-soft); --bs-btn-hover-border-color: var(--et-ink-soft);
    --bs-btn-active-bg: #334155; --bs-btn-active-border-color: #334155;
    --bs-btn-disabled-bg: #94a3b8; --bs-btn-disabled-border-color: #94a3b8;
    --bs-btn-focus-shadow-rgb: 14, 116, 144;
}
.btn-outline-primary {
    --bs-btn-color: var(--et-lagoon-dark); --bs-btn-border-color: #a5d8e3; --bs-btn-bg: var(--et-paper);
    --bs-btn-hover-bg: var(--et-lagoon-tint); --bs-btn-hover-color: var(--et-lagoon-dark); --bs-btn-hover-border-color: #67b9cb;
    --bs-btn-active-bg: #cffafe; --bs-btn-active-color: var(--et-lagoon-dark); --bs-btn-active-border-color: #67b9cb;
    --bs-btn-disabled-color: #94a3b8; --bs-btn-disabled-border-color: var(--et-line); --bs-btn-disabled-bg: var(--et-paper);
    --bs-btn-focus-shadow-rgb: 14, 116, 144;
}
.btn-outline-secondary {
    --bs-btn-color: var(--et-ink); --bs-btn-border-color: var(--et-line-strong); --bs-btn-bg: var(--et-paper);
    --bs-btn-hover-bg: var(--et-hover); --bs-btn-hover-color: var(--et-ink); --bs-btn-hover-border-color: #94a3b8;
    --bs-btn-active-bg: var(--et-line); --bs-btn-active-color: var(--et-ink); --bs-btn-active-border-color: #94a3b8;
    --bs-btn-disabled-color: #94a3b8; --bs-btn-disabled-border-color: var(--et-line); --bs-btn-disabled-bg: var(--et-paper);
    --bs-btn-focus-shadow-rgb: 100, 116, 139;
}
.btn-outline-secondary.active { --bs-btn-active-bg: var(--et-ink); --bs-btn-active-color: #fff; --bs-btn-active-border-color: var(--et-ink); }
.btn-warning { --bs-btn-bg: var(--et-marigold); --bs-btn-border-color: var(--et-marigold);
    --bs-btn-hover-bg: #d97706; --bs-btn-hover-border-color: #d97706; --bs-btn-color: #2b1d00; --bs-btn-hover-color: #2b1d00; }
.btn-danger { --bs-btn-bg: var(--et-red); --bs-btn-border-color: var(--et-red);
    --bs-btn-hover-bg: #b91c1c; --bs-btn-hover-border-color: #b91c1c; }
.btn-outline-danger { --bs-btn-color: #b91c1c; --bs-btn-border-color: #fecaca; --bs-btn-bg: var(--et-paper);
    --bs-btn-hover-bg: #fef2f2; --bs-btn-hover-color: #b91c1c; --bs-btn-hover-border-color: #fca5a5;
    --bs-btn-active-bg: #fee2e2; --bs-btn-active-color: #b91c1c; --bs-btn-active-border-color: #fca5a5; }
.btn-success { --bs-btn-bg: var(--et-green); --bs-btn-border-color: var(--et-green);
    --bs-btn-hover-bg: #15803d; --bs-btn-hover-border-color: #15803d; }
.btn-link { --bs-btn-color: var(--et-lagoon); --bs-btn-hover-color: var(--et-lagoon-dark); text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

.form-label { font-weight: 500; font-size: 0.875rem; margin-bottom: 0.35rem; color: var(--et-ink); }
.form-control, .form-select { border-color: var(--et-line-strong); background-color: var(--et-paper); border-radius: var(--et-radius); }
.form-control::placeholder { color: #94a3b8; }
.form-control:disabled, .form-select:disabled { background-color: var(--et-hover); }
.form-control:focus, .form-select:focus { border-color: var(--et-lagoon); box-shadow: 0 0 0 0.2rem rgba(14, 116, 144, 0.15); }
.form-check-input { border-color: #94a3b8; }
.form-check-input:checked { background-color: var(--et-ink); border-color: var(--et-ink); }
.form-check-input:focus { border-color: var(--et-lagoon); box-shadow: 0 0 0 0.2rem rgba(14, 116, 144, 0.15); }
.form-text { color: var(--et-muted); }

.card { --bs-card-border-color: var(--et-line); --bs-card-border-radius: var(--et-radius-lg);
    --bs-card-inner-border-radius: calc(var(--et-radius-lg) - 1px);
    --bs-card-cap-bg: var(--et-paper); --bs-card-bg: var(--et-paper); box-shadow: var(--et-shadow) !important; }
.card-header { font-weight: 600; color: var(--et-ink); padding: 0.85rem 1.1rem; font-size: 0.9375rem; }
.card-body { --bs-card-spacer-x: 1.1rem; }

.dropdown-menu { --bs-dropdown-border-color: var(--et-line); --bs-dropdown-border-radius: 0.625rem;
    --bs-dropdown-link-active-bg: var(--et-ink); --bs-dropdown-link-hover-bg: var(--et-hover);
    --bs-dropdown-font-size: 0.9375rem; --bs-dropdown-padding-y: 0.35rem; box-shadow: var(--et-shadow-pop); }
.dropdown-item { border-radius: 0.375rem; margin: 0 0.35rem; width: calc(100% - 0.7rem); padding-left: 0.65rem; padding-right: 0.65rem; }

.nav-tabs { --bs-nav-tabs-border-color: var(--et-line); --bs-nav-tabs-link-active-color: var(--et-ink);
    --bs-nav-tabs-link-active-border-color: var(--et-line) var(--et-line) var(--et-paper);
    --bs-nav-link-color: var(--et-muted); --bs-nav-link-hover-color: var(--et-ink);
    --bs-nav-tabs-border-radius: var(--et-radius); }
.nav-tabs .nav-link { font-weight: 500; }
.nav-tabs .nav-link.active { box-shadow: inset 0 2px 0 var(--et-ink); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--et-ink); --bs-nav-link-color: var(--et-text);
    --bs-nav-pills-border-radius: 999px; --bs-nav-link-hover-color: var(--et-ink); }

.pagination { --bs-pagination-color: var(--et-ink); --bs-pagination-hover-color: var(--et-ink);
    --bs-pagination-hover-bg: var(--et-hover); --bs-pagination-bg: var(--et-paper);
    --bs-pagination-active-bg: var(--et-ink); --bs-pagination-active-border-color: var(--et-ink);
    --bs-pagination-border-color: var(--et-line); --bs-pagination-disabled-bg: var(--et-paper);
    --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(14, 116, 144, 0.15); }

.progress { --bs-progress-bg: var(--et-line); --bs-progress-bar-bg: var(--et-lagoon); --bs-progress-height: 0.5rem;
    --bs-progress-border-radius: 999px; }

.alert { --bs-alert-border-radius: 0.625rem; }
.alert-warning { --bs-alert-bg: #fffbeb; --bs-alert-border-color: #fde68a; --bs-alert-color: #78350f; }
.alert-info { --bs-alert-bg: var(--et-lagoon-tint); --bs-alert-border-color: #a5f3fc; --bs-alert-color: #164e63; }
.alert-success { --bs-alert-bg: #f0fdf4; --bs-alert-border-color: #bbf7d0; --bs-alert-color: #14532d; }
.alert-danger { --bs-alert-bg: #fef2f2; --bs-alert-border-color: #fecaca; --bs-alert-color: #7f1d1d; }

.modal-content { border: 1px solid var(--et-line); border-radius: 0.875rem; box-shadow: var(--et-shadow-pop); }
.modal-header { border-bottom-color: var(--et-line); padding: 1rem 1.25rem; }
.modal-body { padding: 1.25rem; }
.modal-footer { border-top-color: var(--et-line); padding: 0.85rem 1.25rem; }
.modal-title { font-size: 1.05rem; }
.modal-backdrop { --bs-backdrop-bg: var(--et-ink); --bs-backdrop-opacity: 0.4; }

code { color: #be185d; }
pre code { color: var(--et-text); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--et-line); --bs-table-hover-bg: var(--et-mist);
    --bs-table-striped-bg: var(--et-mist); margin-bottom: 0; }
.table > thead > tr > th { font-size: 0.8125rem; font-weight: 600; color: var(--et-muted); background: var(--et-mist);
    border-bottom: 1px solid var(--et-line); white-space: nowrap; vertical-align: bottom; }
.table > tbody > tr:last-child > td { border-bottom-width: 0; }
.table > tfoot > tr > td { background: var(--et-mist); border-bottom-width: 0; }
.table > :not(caption) > * > * { padding: 0.7rem 0.75rem; }
.card > .table-responsive > .table > :not(caption) > * > *,
.card > .table > :not(caption) > * > * { padding-left: 1.1rem; padding-right: 1.1rem; }
.card > .table-responsive:first-child > .table > thead > tr > th:first-child { border-top-left-radius: calc(var(--et-radius-lg) - 1px); }
.card > .table-responsive:first-child > .table > thead > tr > th:last-child { border-top-right-radius: calc(var(--et-radius-lg) - 1px); }
.table-tight > :not(caption) > * > * { padding-top: 0.5rem; padding-bottom: 0.5rem; }
td.num, th.num { text-align: right; }

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

.app-sidebar { --bs-offcanvas-width: var(--et-sidebar-width); --bs-offcanvas-bg: var(--et-paper); color: var(--et-text);
    border-right: 1px solid var(--et-line); }
/* Bootstrap makes .offcanvas-lg transparent on wide screens with !important, so this needs it too. */
.app-sidebar.offcanvas-lg { background-color: var(--et-paper) !important; }
@media (min-width: 992px) {
    .app-sidebar { width: var(--et-sidebar-width); flex: 0 0 var(--et-sidebar-width); position: sticky; top: 0;
        height: 100vh; overflow-y: auto; }
}
.app-brand { display: flex; align-items: center; gap: 0.65rem; padding: 1.05rem 1.1rem 0.9rem; color: var(--et-ink); text-decoration: none; }
.app-brand:hover { color: var(--et-ink); }
.app-brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    background: var(--et-ink); color: #fff; font-size: 1.05rem; }
.app-brand-name { font-family: var(--et-font-condensed); font-weight: 600; font-size: 1.3rem; letter-spacing: 0.01em; line-height: 1; }
.app-brand-sub { font-size: 0.75rem; color: var(--et-muted); line-height: 1.2; margin-top: 3px; }

.app-nav { list-style: none; margin: 0; padding: 0.35rem 0.7rem 1rem; }
.app-nav li + li { margin-top: 2px; }
.app-nav-heading { font-size: 0.75rem; font-weight: 500; color: #94a3b8; padding: 1.1rem 0.65rem 0.35rem; }
.app-nav-link { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.65rem; border-radius: var(--et-radius);
    color: #475569; text-decoration: none; font-weight: 500; position: relative; }
.app-nav-link .bi { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #94a3b8; }
.app-nav-link:hover { background: var(--et-hover); color: var(--et-ink); }
.app-nav-link:hover .bi { color: var(--et-slate); }
.app-nav-link.active { background: var(--et-hover); color: var(--et-ink); font-weight: 600; }
.app-nav-link.active .bi { color: var(--et-lagoon); }
.app-nav-link.active::before { content: ""; position: absolute; left: -0.7rem; top: 0.4rem; bottom: 0.4rem; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--et-ink); }

.app-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { display: flex; align-items: center; gap: 0.75rem; min-height: 60px; padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.9); backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--et-line); position: sticky; top: 0; z-index: 1020; }
.app-title { font-weight: 600; font-size: 1.2rem; color: var(--et-ink); margin: 0; line-height: 1.2; letter-spacing: -0.015em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.app-topbar .btn-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--et-radius);
    border: 1px solid transparent; background: transparent; color: var(--et-ink); position: relative; flex: none; }
.app-topbar .btn-icon:hover { background: var(--et-hover); }
.app-topbar .btn-icon .bi { font-size: 1.15rem; }
.app-main { padding: 1.5rem; flex: 1 1 auto; }
@media (max-width: 575.98px) { .app-main { padding: 1rem 0.75rem; } .app-topbar { padding: 0.5rem 0.75rem; } }

/* "Find a lead" in the top bar */
.topbar-search { position: relative; flex: 0 1 320px; margin-left: auto; }
.topbar-search .bi { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.topbar-search input { padding-left: 2.2rem; background: var(--et-hover); border-color: transparent; height: 38px; }
.topbar-search input:focus { background: var(--et-paper); }

.user-chip { display: inline-flex; align-items: center; gap: 0.5rem; border: 1px solid var(--et-line); background: var(--et-paper);
    border-radius: 999px; padding: 0.2rem 0.75rem 0.2rem 0.25rem; color: var(--et-ink); font-weight: 500; flex: none; }
.user-chip:hover { background: var(--et-hover); }
.user-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--et-ink); color: #fff; font-size: 0.75rem; font-weight: 600; }

/* Notification bell */
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: var(--et-red); color: #fff; font-size: 0.6875rem; font-weight: 600; line-height: 18px; text-align: center;
    box-shadow: 0 0 0 2px #fff; }
.bell-menu { width: min(360px, 92vw); padding: 0; overflow: hidden; }
.bell-item { display: block; padding: 0.65rem 1rem; border-bottom: 1px solid var(--et-line); color: var(--et-text); text-decoration: none; }
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: var(--et-mist); color: var(--et-ink); }
.bell-item.unread { box-shadow: inset 3px 0 0 var(--et-marigold); background: #fffbeb; }
.bell-item-time { font-size: 0.8125rem; color: var(--et-muted); }

/* ---------- Page pieces ---------- */
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.page-intro { color: var(--et-muted); margin-bottom: 1rem; }
.page-intro strong { color: var(--et-ink); font-weight: 600; }
.section-title { font-size: 1rem; font-weight: 600; color: var(--et-ink); margin: 0; }
.muted { color: var(--et-muted); }
.empty-state { padding: 2.25rem 1rem; text-align: center; color: var(--et-muted); }
.empty-state .bi { font-size: 1.5rem; display: block; margin-bottom: 0.5rem; color: #cbd5e1; }

/* Pills: a status or label with a coloured dot on a soft tint */
.pill { --pill: var(--et-slate); display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.14rem 0.6rem 0.14rem 0.5rem;
    border-radius: 999px; font-size: 0.8125rem; font-weight: 500; line-height: 1.4; white-space: nowrap; color: var(--et-ink);
    background: color-mix(in srgb, var(--pill) 10%, #fff); border: 1px solid color-mix(in srgb, var(--pill) 24%, #fff); }
.pill::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--pill); flex: none; }
.pill-primary { --pill: var(--et-lagoon); }
.pill-secondary { --pill: var(--et-slate); }
.pill-success { --pill: var(--et-green); }
.pill-danger { --pill: var(--et-red); }
.pill-warning { --pill: #d97706; }
.pill-info { --pill: #0284c7; }
.pill-dark { --pill: var(--et-ink); }
.pill-plain::before { display: none; }
.pill-plain { padding-left: 0.6rem; }

/* Lead score as phone-signal bars: Low 1, Moderate 2, High 3 */
.score { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; font-weight: 500; white-space: nowrap; color: var(--et-ink); }
.score-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.score-bars i { display: block; width: 4px; border-radius: 1px; background: var(--et-line-strong); }
.score-bars i:nth-child(1) { height: 6px; }
.score-bars i:nth-child(2) { height: 10px; }
.score-bars i:nth-child(3) { height: 14px; }
.score-1 .score-bars i:nth-child(-n+1) { background: var(--et-slate); }
.score-2 .score-bars i:nth-child(-n+2) { background: var(--et-marigold); }
.score-3 .score-bars i:nth-child(-n+3) { background: var(--et-red); }
.score-0 { color: #94a3b8; font-weight: 400; }

/* Stat tiles */
.stat { background: var(--et-paper); border: 1px solid var(--et-line); border-radius: var(--et-radius-lg); padding: 0.95rem 1.1rem;
    height: 100%; display: block; color: inherit; text-decoration: none; box-shadow: var(--et-shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease; }
a.stat:hover { border-color: var(--et-line-strong); box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06); color: inherit; }
.stat-label { font-size: 0.8125rem; color: var(--et-muted); font-weight: 500; }
.stat-value { font-family: var(--et-font-condensed); font-weight: 600; font-size: 2rem; line-height: 1.15; color: var(--et-ink); }
.stat-note { font-size: 0.8125rem; color: var(--et-muted); }
.stat-overdue .stat-value { color: var(--et-red); }
.stat-due .stat-value { color: #b45309; }
.delta-up { color: #15803d; }
.delta-down { color: var(--et-red); }

/* ---------- Call sheet: follow-ups, time first ---------- */
.callsheet { list-style: none; margin: 0; padding: 0; }
.callsheet-row { display: grid; grid-template-columns: 6.6rem 1fr auto; align-items: center; gap: 0.25rem 0.9rem;
    padding: 0.8rem 1.1rem 0.8rem 0.9rem; border-bottom: 1px solid var(--et-line); border-left: 3px solid transparent;
    transition: background-color 0.12s ease; }
.callsheet-row:hover { background: var(--et-mist); }
.callsheet-row:last-child { border-bottom: 0; }
.callsheet-row.is-overdue { border-left-color: var(--et-red); }
.callsheet-row.is-soon { border-left-color: var(--et-marigold); background: #fffbeb; }
.callsheet-time { font-family: var(--et-font-condensed); font-weight: 600; font-size: 1.55rem; line-height: 1; color: var(--et-ink); white-space: nowrap; }
.callsheet-time .ampm { font-size: 0.8rem; font-weight: 500; margin-left: 0.2rem; color: var(--et-muted); }
.callsheet-time small { display: block; white-space: normal; font-family: var(--et-font); font-weight: 400; font-size: 0.75rem; color: var(--et-muted); margin-top: 0.3rem; }
.callsheet-row.is-overdue .callsheet-time small { color: var(--et-red); font-weight: 500; }
.callsheet-row.is-soon .callsheet-time small { color: #92400e; font-weight: 500; }
.callsheet-company { font-weight: 600; color: var(--et-ink); text-decoration: none; }
.callsheet-company:hover { color: var(--et-lagoon); text-decoration: underline; }
.callsheet-meta { font-size: 0.8125rem; color: var(--et-muted); margin-top: 0.1rem; }
@media (max-width: 575.98px) {
    .callsheet-row { grid-template-columns: 5.6rem 1fr; }
    .callsheet-actions { grid-column: 1 / -1; }
}

/* ---------- Follow-ups page: overdue, today and the next 7 days on one screen ---------- */
.followup-board { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 1200px) { .followup-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Each column is a container, so its rows can adapt to the column's width (see below). */
.followup-column { container-type: inline-size; scroll-margin-top: 76px; }
/* The heading stays under the top bar while a long column is scrolled. */
.followup-column > .card-header { display: flex; align-items: center; gap: 0.5rem; position: sticky; top: 60px; z-index: 2;
    background: var(--et-paper); border-radius: var(--et-radius-lg) var(--et-radius-lg) 0 0; }
.followup-count { margin-left: auto; min-width: 1.75rem; padding: 0.1rem 0.5rem; border-radius: 999px; text-align: center;
    font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--et-slate); background: var(--et-hover); }
.followup-column.is-overdue .followup-count { color: #b91c1c; background: #fee2e2; }
.followup-day { display: flex; justify-content: space-between; padding: 0.4rem 1.1rem; font-size: 0.8125rem; font-weight: 600;
    color: var(--et-slate); background: var(--et-mist); border-bottom: 1px solid var(--et-line); font-variant-numeric: tabular-nums; }
.callsheet + .followup-day { border-top: 1px solid var(--et-line); }
/* Stacked layout (narrow screens): links that jump to each section. */
.followup-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.followup-jump a { padding: 0.3rem 0.75rem; border: 1px solid var(--et-line); border-radius: 999px; background: var(--et-paper);
    color: var(--et-text); text-decoration: none; font-size: 0.875rem; }
.followup-jump a:hover { border-color: var(--et-slate); }
.followup-jump a strong { margin-left: 0.25rem; color: var(--et-ink); font-variant-numeric: tabular-nums; }
.followup-jump a.is-overdue strong { color: var(--et-red); }
/* A row in a narrow column: smaller time, buttons under the details, long text cut off. */
.callsheet-row > div { min-width: 0; }
@container (max-width: 560px) {
    .callsheet-row { grid-template-columns: 4.9rem 1fr; align-items: start; padding-right: 0.9rem; }
    .callsheet-time { font-size: 1.3rem; }
    .callsheet-actions { grid-column: 2; margin-top: 0.3rem; }
}

/* ---------- Timeline on the lead page ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { display: grid; grid-template-columns: 2rem 1fr; gap: 0.8rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--et-line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-icon { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
    background: var(--et-hover); color: var(--et-ink-soft); font-size: 0.9rem; }
.timeline-item.is-scheduled .timeline-icon { background: #fef3c7; color: #92400e; }
.timeline-item.is-cancelled { color: var(--et-muted); }
.timeline-when { font-size: 0.8125rem; color: var(--et-muted); }
.timeline-text { white-space: pre-line; overflow-wrap: anywhere; }

/* Lead header facts */
.fact-label { font-size: 0.8125rem; color: var(--et-muted); margin-bottom: 0.1rem; }
.fact-value { font-weight: 500; color: var(--et-ink); overflow-wrap: anywhere; }

/* ---------- Leads grid ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.search-box { position: relative; flex: 1 1 220px; max-width: 300px; }
.search-box .bi { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.search-box input { padding-left: 2.3rem; }

.check-menu { max-height: 300px; overflow-y: auto; min-width: 230px; }
.check-menu label { display: flex; align-items: center; gap: 0.55rem; padding: 0.35rem 0.65rem; margin: 0 0.35rem;
    border-radius: 0.375rem; cursor: pointer; }
.check-menu label:hover { background: var(--et-hover); }
.date-menu { min-width: 250px; padding: 0.85rem; }

/* A filter is a button that names itself and, once used, shows its value. */
.filter-toggle { background: var(--et-paper); border: 1px solid var(--et-line-strong); color: var(--et-text); font-weight: 400;
    border-radius: var(--et-radius); }
.filter-toggle:hover, .filter-toggle.show { background: var(--et-hover); border-color: #94a3b8; color: var(--et-ink); }
.filter-toggle.has-value { background: var(--et-ink); border-color: var(--et-ink); color: #fff; font-weight: 500; }
select.filter-toggle { padding: 0.375rem 2rem 0.375rem 0.85rem; width: auto; }
select.filter-toggle.has-value { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
select.filter-toggle option { background: #fff; color: var(--et-text); }

table.dataTable { margin-top: 0 !important; margin-bottom: 0 !important; }
table.dataTable > tbody > tr > td { vertical-align: middle; }
div.dt-container div.dt-layout-row { margin: 0 !important; }
div.dt-container div.dt-layout-row:last-child { padding: 0.75rem 1.1rem; border-top: 1px solid var(--et-line); align-items: center; }
div.dt-container .dt-paging .page-link { font-size: 0.875rem; }
div.dt-container div.dt-info, div.dt-container div.dt-length label { color: var(--et-muted); font-size: 0.875rem; padding-top: 0 !important; }
div.dt-container div.dt-length select { border-radius: 0.4rem; margin-right: 0.4rem; }
div.dt-container div.dt-processing { border: 1px solid var(--et-line); border-radius: var(--et-radius); background: var(--et-paper);
    box-shadow: var(--et-shadow-pop); color: var(--et-ink); }
table.dataTable thead > tr > th.dt-orderable-asc:hover, table.dataTable thead > tr > th.dt-orderable-desc:hover { outline: none !important; color: var(--et-ink); }

/* Leads grid cells stay on one line (the table scrolls sideways if needed); only long text wraps. */
#leadsTable > tbody > tr > td { white-space: nowrap; }
#leadsTable > tbody > tr > td.col-wrap { white-space: normal; min-width: 13rem; }
#leadsTable > thead > tr > th { white-space: nowrap; }
#leadsTable > tbody > tr { cursor: pointer; }
#leadsTable > tbody > tr > td.col-actions { width: 1%; }
#leadsTable .row-log { visibility: hidden; }
#leadsTable > tbody > tr:hover .row-log, #leadsTable .row-log:focus-visible { visibility: visible; }
@media (hover: none) { #leadsTable .row-log { visibility: visible; } }

.grid-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--et-line); }
.lead-link { font-weight: 600; color: var(--et-ink); text-decoration: none; }
.lead-link:hover { color: var(--et-lagoon); text-decoration: underline; }
.due-overdue { color: var(--et-red); font-weight: 500; }
.due-today { color: #b45309; font-weight: 500; }

/* ---------- Funnel bars (performance report, pipeline) ---------- */
.funnel-row { display: grid; grid-template-columns: 9.5rem 1fr 3.5rem; align-items: center; gap: 0.75rem; padding: 0.4rem 0; }
.funnel-track { background: var(--et-hover); border-radius: 999px; height: 0.65rem; overflow: hidden; }
.funnel-fill { background: var(--et-ink); height: 100%; border-radius: 999px; min-width: 3px; }
.funnel-row:last-child .funnel-fill { background: var(--et-green); }
.funnel-value { font-family: var(--et-font-condensed); font-weight: 600; font-size: 1.15rem; text-align: right; color: var(--et-ink); }

/* ---------- Wizard steps (import): a real sequence, so it is numbered ---------- */
.steps { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; list-style: none; padding: 0; margin: 0 0 1.25rem; counter-reset: step; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 0.55rem; color: #94a3b8; font-weight: 500; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
    border: 1px solid var(--et-line-strong); font-size: 0.8125rem; background: var(--et-paper); color: var(--et-muted); }
.steps li.is-current { color: var(--et-ink); }
.steps li.is-current::before { background: var(--et-ink); border-color: var(--et-ink); color: #fff; }
.steps li.is-done { color: var(--et-text); }
.steps li.is-done::before { background: var(--et-green); border-color: var(--et-green); color: #fff; content: "\2713"; }

/* ---------- Sign-in ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--et-paper); }
.auth-aside { background: var(--et-ink); color: #cbd5e1; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside-name { font-family: var(--et-font-condensed); font-weight: 600; font-size: clamp(3rem, 7vw, 5.5rem); line-height: 0.95; color: #fff; }
.auth-aside-line { width: 4rem; height: 4px; border-radius: 2px; background: var(--et-marigold); margin: 1.25rem 0; }
.auth-aside p { max-width: 26rem; font-size: 1.05rem; }
.auth-aside-foot { color: #94a3b8; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-form { width: 100%; max-width: 380px; }
@media (max-width: 767.98px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-aside { padding: 1.5rem 1.25rem; }
    .auth-aside-name { font-size: 2.6rem; }
    .auth-aside p, .auth-aside-foot { display: none; }
    .auth-aside-line { margin: 0.75rem 0 0; }
}

/* ---------- Labelled filter controls in a row (performance report) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.filter-bar .form-label { font-size: 0.8125rem; margin-bottom: 0.25rem; color: var(--et-muted); }
.filter-bar .filter { min-width: 150px; flex: 1 1 150px; max-width: 220px; }

/* Leads grid: tighter cells, and the "Log" action stays in view while the table scrolls sideways. */
#leadsTable > :not(caption) > * > * { padding-left: 0.7rem; padding-right: 0.7rem; }
#leadsTable > :not(caption) > * > *:first-child { padding-left: 1.1rem; }
#leadsTable > thead > tr > th.col-actions,
#leadsTable > tbody > tr > td.col-actions { position: sticky; right: 0; background-color: var(--et-paper); padding-right: 1.1rem; }
#leadsTable > thead > tr > th.col-actions { background-color: var(--et-mist); }
#leadsTable > tbody > tr:hover > td.col-actions { background-color: var(--et-mist); }
