/* =========================================================
   Theme: deep blue-teal with gold accents.
   These override Radzen's Material theme colors (this file loads after it).
   Change the brand colors here and the whole app follows.
   ========================================================= */
:root {
    --brand-teal-50: #eef7fa;
    --brand-teal-100: #d3eaf1;
    --brand-teal-300: #7cc4d6;
    --brand-teal-400: #3ea6c0;
    --brand-teal-500: #1a88a6;
    --brand-teal-600: #0f6f8c;
    --brand-teal-700: #0c5a74;
    --brand-teal-800: #0a475d;
    --brand-teal-900: #08364a;
    --brand-teal-950: #052333;
    --brand-gold: #d4a62a;
    --brand-gold-light: #f3d98a;
    --brand-gold-dark: #a87b14;

    --rz-primary: var(--brand-teal-700);
    --rz-primary-light: var(--brand-teal-600);
    --rz-primary-lighter: rgba(15, 111, 140, 0.13);
    --rz-primary-dark: var(--brand-teal-800);
    --rz-primary-darker: var(--brand-teal-900);
    --rz-on-primary: #ffffff;
    --rz-on-primary-lighter: var(--brand-teal-800);

    --rz-secondary: var(--brand-gold);
    --rz-secondary-light: var(--brand-gold-light);
    --rz-secondary-lighter: rgba(212, 166, 42, 0.16);
    --rz-secondary-dark: var(--brand-gold-dark);
    --rz-secondary-darker: #7d5b0e;
    --rz-on-secondary: #1f2937;
    --rz-on-secondary-lighter: var(--brand-gold-dark);

    /* App surfaces (light mode): dark header and sidebar, light work area */
    --app-header-bg: linear-gradient(90deg, #020b14, var(--brand-teal-950) 45%, var(--brand-teal-800));
    --app-sidebar-bg: linear-gradient(180deg, var(--brand-teal-950), #020b14);
    --app-sidebar-border: var(--brand-teal-950);
    --app-sidebar-text: #cfe6ee;
    --app-sidebar-hover: rgba(255, 255, 255, 0.07);
    --app-active-bg: rgba(62, 166, 192, 0.22);
    --app-active-text: #ffffff;
    --app-body-bg: #f2f6f8;
    --app-card-edge: var(--brand-teal-600);
    --app-heading-color: var(--brand-teal-800);
    --app-login-bg:
        radial-gradient(circle at 20% 15%, rgba(243, 217, 138, 0.22), transparent 40%),
        linear-gradient(135deg, var(--brand-teal-950), var(--brand-teal-900) 55%, var(--brand-teal-600));
    --app-error-bg: #fdecea;
    --app-error-text: #b71c1c;
}

/* =========================================================
   Dark mode: brighter blue-teal and gold on near-black surfaces.
   Radzen's material-dark theme supplies the base colors; these keep the brand on top.
   ========================================================= */
:root[data-theme="dark"] {
    color-scheme: dark;

    --brand-gold: #e3bc55;
    --brand-gold-light: #f6e2a4;
    --brand-gold-dark: #b98d24;

    --rz-primary: var(--brand-teal-400);
    --rz-primary-light: var(--brand-teal-300);
    --rz-primary-lighter: rgba(62, 166, 192, 0.18);
    --rz-primary-dark: var(--brand-teal-500);
    --rz-primary-darker: var(--brand-teal-600);
    --rz-on-primary: #04161f;
    --rz-on-primary-lighter: var(--brand-teal-300);

    --rz-secondary: var(--brand-gold);
    --rz-secondary-light: var(--brand-gold-light);
    --rz-secondary-lighter: rgba(227, 188, 85, 0.18);
    --rz-secondary-dark: var(--brand-gold-dark);
    --rz-on-secondary: #1c1406;
    --rz-on-secondary-lighter: var(--brand-gold-light);

    --app-header-bg: linear-gradient(90deg, #020d14, #041a26 55%, #08364a);
    --app-sidebar-bg: linear-gradient(180deg, #06161f, #030c12);
    --app-sidebar-border: #10293a;
    --app-sidebar-text: #b9d3dd;
    --app-sidebar-hover: rgba(255, 255, 255, 0.05);
    --app-active-bg: rgba(62, 166, 192, 0.18);
    --app-active-text: var(--brand-teal-300);
    --app-body-bg: #0b1218;
    --app-card-edge: var(--brand-teal-500);
    --app-heading-color: var(--brand-teal-300);
    --app-login-bg:
        radial-gradient(circle at 20% 15%, rgba(227, 188, 85, 0.12), transparent 40%),
        linear-gradient(135deg, #01080d, #041a26 55%, #0a475d);
    --app-error-bg: rgba(239, 83, 80, 0.15);
    --app-error-text: #ff8a80;
}

html, body {
    margin: 0;
    height: 100%;
}

h1:focus {
    outline: none;
}

/* Header: near-black blue-teal with a gold edge */
.rz-header {
    background: var(--app-header-bg);
    color: #ffffff;
    border-bottom: 3px solid var(--brand-gold);
}

.rz-header .rz-sidebar-toggle,
.rz-header .rz-button,
.rz-header .rzi,
.rz-header a {
    color: #ffffff;
}

.rz-header .app-title {
    color: #ffffff;
    letter-spacing: 0.02em;
}

/* Light/dark switch in the header */
.rz-header .theme-toggle.rz-button {
    border: 1px solid rgba(243, 217, 138, 0.55);
    border-radius: 999px;
    color: var(--brand-gold-light);
    padding-inline: 0.75rem;
}

.rz-header .theme-toggle.rz-button .rzi {
    color: var(--brand-gold-light);
}

/* Sidebar: dark blue-teal, gold marker on the active item */
.rz-sidebar {
    background: var(--app-sidebar-bg);
    border-right: 1px solid var(--app-sidebar-border);
}

.rz-sidebar .rz-navigation-item-link,
.rz-sidebar .rz-navigation-item-icon,
.rz-sidebar .rz-navigation-item-text {
    color: var(--app-sidebar-text);
}

.rz-sidebar .rz-navigation-item-link:hover {
    background: var(--app-sidebar-hover);
}

.rz-sidebar .rz-navigation-item-link.rz-state-active,
.rz-sidebar .rz-navigation-item-wrapper-active,
.rz-sidebar .rz-navigation-item-wrapper-active .rz-navigation-item-link {
    background: var(--app-active-bg);
    box-shadow: inset 4px 0 0 var(--brand-gold);
}

.rz-sidebar .rz-navigation-item-link.rz-state-active .rz-navigation-item-text,
.rz-sidebar .rz-navigation-item-link.rz-state-active .rz-navigation-item-icon,
.rz-sidebar .rz-navigation-item-wrapper-active .rz-navigation-item-text,
.rz-sidebar .rz-navigation-item-wrapper-active .rz-navigation-item-icon {
    color: var(--app-active-text);
}

/* Work area background */
.rz-body {
    background: var(--app-body-bg);
}

/* Page headings get a short gold underline */
.page-header h1 {
    position: relative;
    padding-bottom: 0.3rem;
}

.page-header h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 2.5rem;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--brand-gold-light), var(--brand-gold));
}

/* Cards: blue-teal top edge */
.rz-card.rz-variant-outlined {
    border-top: 3px solid var(--app-card-edge);
}

.app-logo {
    display: inline-block;
    vertical-align: middle;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

/* Light/dark switch on the sign-in page */
.login-theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(243, 217, 138, 0.6);
    background: rgba(0, 0, 0, 0.25);
    color: var(--brand-gold-light);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.login-theme-toggle:hover {
    background: rgba(0, 0, 0, 0.4);
}

.login-theme-toggle .to-light {
    display: none;
}

:root[data-theme="dark"] .login-theme-toggle .to-light {
    display: inline;
}

:root[data-theme="dark"] .login-theme-toggle .to-dark {
    display: none;
}


/* =========================================================
   Space theme (Huntsville - Rocket City): starfield, orbit, rocket.
   ========================================================= */
:root {
    --app-stars:
        radial-gradient(1px 1px at 8% 18%, rgba(255, 255, 255, 0.85) 50%, transparent 51%),
        radial-gradient(1px 1px at 23% 62%, rgba(255, 255, 255, 0.55) 50%, transparent 51%),
        radial-gradient(1.6px 1.6px at 41% 28%, rgba(243, 217, 138, 0.9) 50%, transparent 51%),
        radial-gradient(1px 1px at 57% 80%, rgba(255, 255, 255, 0.6) 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 69% 12%, rgba(255, 255, 255, 0.75) 50%, transparent 51%),
        radial-gradient(1px 1px at 84% 52%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
        radial-gradient(1.4px 1.4px at 93% 86%, rgba(243, 217, 138, 0.7) 50%, transparent 51%),
        radial-gradient(1px 1px at 33% 92%, rgba(255, 255, 255, 0.45) 50%, transparent 51%);
}

.rz-header,
.rz-sidebar,
.account-page,
.pay-page {
    position: relative;
    overflow: hidden;
}

.rz-header::before,
.rz-sidebar::before,
.account-page::before,
.pay-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--app-stars);
    background-size: 280px 150px;
    pointer-events: none;
    z-index: 0;
}

.rz-header::before { opacity: 0.55; }
.rz-sidebar::before { opacity: 0.35; background-size: 230px 260px; }

.rz-header > *,
.rz-sidebar > *,
.account-page > *,
.pay-page > * {
    position: relative;
    z-index: 1;
}

/* Keep the sign-in page's light/dark button pinned to the corner */
.account-page > .login-theme-toggle {
    position: fixed;
    z-index: 2;
}

/* The sidebar footer sits at the bottom of the menu */
.rz-sidebar {
    display: flex;
    flex-direction: column;
}

/* Dark mode: a faint starfield behind the work area too */
:root[data-theme="dark"] .rz-body {
    background-image: var(--app-stars);
    background-size: 340px 220px;
    background-attachment: fixed;
}

/* Sign-in and pay pages: an orbit ring and a rocket on the way up */
.space-orbit {
    position: absolute !important;
    left: -25vmax;
    top: 58%;
    width: 150vmax;
    height: 42vmax;
    border: 2px solid rgba(243, 217, 138, 0.22);
    border-radius: 50%;
    transform: rotate(-12deg);
    pointer-events: none;
    z-index: 0 !important;
}

.space-orbit::after {
    content: "";
    position: absolute;
    inset: 6vmax 14vmax;
    border: 1px dashed rgba(124, 196, 214, 0.18);
    border-radius: 50%;
}

.space-rocket {
    position: absolute !important;
    right: 9vw;
    top: 12vh;
    font-size: 64px !important;
    color: rgba(243, 217, 138, 0.85);
    transform: rotate(0deg);
    filter: drop-shadow(0 0 18px rgba(243, 217, 138, 0.45));
    pointer-events: none;
    z-index: 0 !important;
}

.space-rocket::after {
    content: "";
    position: absolute;
    left: -150px;
    top: 58px;
    width: 170px;
    height: 3px;
    border-radius: 3px;
    transform: rotate(-38deg);
    transform-origin: right center;
    background: linear-gradient(90deg, transparent, rgba(243, 217, 138, 0.7));
}

.space-footer {
    margin-top: auto;
    padding: 1rem 1.25rem 1.1rem;
    font-size: 0.72rem;
    color: rgba(207, 230, 238, 0.6);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.3;
}

.space-footer .rzi {
    font-size: 1.05rem;
    color: var(--brand-gold-light);
}

@media (max-width: 640px) {
    .space-rocket { display: none; }
}

@media print {
    .space-orbit, .space-rocket { display: none !important; }
}

/* ---------- Scanner integrations ---------- */

.scanner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.scanner-badge .rzi {
    font-size: 1rem;
}

.scanner-threeshape { background: rgba(15, 111, 140, 0.12); color: var(--rz-primary); border-color: rgba(15, 111, 140, 0.35); }
.scanner-shining { background: rgba(212, 166, 42, 0.14); color: var(--brand-gold-dark); border-color: rgba(212, 166, 42, 0.45); }
.scanner-demo { background: rgba(120, 120, 140, 0.12); color: var(--rz-text-secondary-color, #555); border-color: rgba(120, 120, 140, 0.35); }
.scanner-manual, .scanner-other { background: rgba(46, 125, 50, 0.1); color: var(--rz-success, #2e7d32); border-color: rgba(46, 125, 50, 0.35); }

:root[data-theme="dark"] .scanner-shining { color: var(--brand-gold-light); }

.scan-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(212, 166, 42, 0.5);
    border-left: 5px solid var(--brand-gold);
    background: var(--rz-secondary-lighter);
}

.scan-banner .rzi {
    font-size: 1.6rem;
    color: var(--brand-gold-dark);
}

.scan-banner > div {
    flex: 1;
}

.upload-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.4rem;
    border: 2px dashed var(--rz-primary);
    border-radius: 10px;
    background: var(--rz-primary-lighter);
    cursor: pointer;
    text-align: center;
}

.upload-drop .rzi {
    font-size: 2.2rem;
    color: var(--rz-primary);
}

.upload-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.file-list a, .file-table a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--rz-primary);
    text-decoration: none;
}

.file-list a:hover, .file-table a:hover {
    text-decoration: underline;
}

.file-list .rzi, .file-table .rzi {
    font-size: 1.1rem;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.file-table th {
    text-align: left;
    font-size: 0.78rem;
    color: var(--rz-text-secondary-color, #666);
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--rz-base-300, #ddd);
}

.file-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--rz-base-200, #eee);
}

.info-table {
    width: 100%;
    font-size: 0.9rem;
    border-collapse: collapse;
}

.info-table td {
    padding: 0.3rem 0;
    vertical-align: top;
}

.info-table td:first-child {
    width: 6.5rem;
    color: var(--rz-text-secondary-color, #666);
    font-size: 0.8rem;
    padding-top: 0.4rem;
}

/* ---------- Accounting ---------- */

.stat-mini {
    background: var(--rz-base-background-color, #fff);
    border: 1px solid var(--rz-base-300, #dfe6ea);
    border-top: 3px solid var(--app-card-edge);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    height: 100%;
    box-sizing: border-box;
}

.stat-mini .stat-value {
    font-size: 1.45rem;
}

.stat-mini.warn {
    border-top-color: var(--rz-danger, #c62828);
}

.stat-mini.warn .stat-value {
    color: var(--rz-danger, #c62828);
}

.totals {
    margin-left: auto;
    margin-top: 0.75rem;
    width: 100%;
    max-width: 280px;
    font-size: 0.95rem;
}

.totals > div {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
}

.totals .grand {
    border-top: 2px solid var(--rz-text-color, #222);
    margin-top: 0.25rem;
    padding-top: 0.4rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.totals.print {
    max-width: 3.2in;
}

.saved-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rz-base-200, #eee);
}

.saved-card:last-child {
    border-bottom: none;
}

.saved-card > .rzi {
    font-size: 1.5rem;
    color: var(--rz-primary);
}

.statement-page {
    page-break-after: always;
}

.statement-page:last-of-type {
    page-break-after: auto;
}

/* Card entry (processor's secure fields) */
.card-entry {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.card-entry-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.card-entry-field {
    flex: 1;
    min-width: 7rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-entry-field.wide {
    flex-basis: 100%;
}

.card-entry-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rz-text-secondary-color, #666);
}

.card-entry-slot {
    min-height: 2.6rem;
    border: 1px solid var(--rz-base-400, #c5d0d6);
    border-radius: 4px;
    background: var(--rz-base-background-color, #fff);
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
}

.card-entry-slot iframe {
    width: 100%;
    height: 2.4rem;
    border: 0;
}

.test-card-input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 15px;
    color: var(--rz-text-color, #222);
    padding: 0.55rem 0;
}

.card-entry-test-note {
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    background: var(--rz-secondary-lighter);
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
}

.card-entry-error {
    color: var(--rz-danger, #c62828);
    font-size: 0.85rem;
}

.card-entry-secure {
    font-size: 0.78rem;
    color: var(--rz-text-secondary-color, #666);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.card-entry-secure .rzi {
    font-size: 1rem;
}

/* Public pay page */
.pay-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1rem;
    box-sizing: border-box;
    background: var(--app-login-bg);
    font-family: var(--rz-text-font-family, Inter, system-ui, sans-serif);
}

.pay-card {
    width: 100%;
    max-width: 460px;
    background: var(--rz-base-background-color, #fff);
    border-radius: 12px;
    border-top: 4px solid var(--brand-gold);
    padding: 1.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pay-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rz-base-200, #eee);
}

.pay-lab {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--app-heading-color);
}

.pay-amount {
    text-align: center;
    padding: 0.75rem;
    border-radius: 10px;
    background: var(--rz-primary-lighter);
}

.pay-amount-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--app-heading-color);
}

.pay-invoices {
    font-size: 0.9rem;
}

.pay-invoices > div {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
}

.pay-save {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.pay-success {
    text-align: center;
}

.pay-success .rzi {
    font-size: 3.5rem;
    color: var(--rz-success, #2e7d32);
}

.pay-success h2 {
    margin: 0.25rem 0;
}

/* ---------- Shared bits ---------- */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    margin: 0;
}

.sub-text {
    font-size: 0.8rem;
    color: var(--rz-text-secondary-color, #666);
}

.text-late {
    color: var(--rz-danger, #c62828);
    font-weight: 600;
}

.case-grid .rz-data-row {
    cursor: pointer;
}

.stat-card {
    cursor: pointer;
    height: 100%;
}

.stat-card .rz-card {
    height: 100%;
    transition: box-shadow 0.15s;
}

.stat-card:hover .rz-card {
    box-shadow: var(--rz-shadow-3, 0 2px 8px rgba(0, 0, 0, 0.15));
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--rz-text-secondary-color, #666);
}

.section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.money-total {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Case history */
.history {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 420px;
    overflow-y: auto;
}

.history-item {
    border-left: 3px solid var(--rz-primary, #4340d2);
    padding: 0.2rem 0 0.2rem 0.6rem;
}

.history-meta {
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color, #666);
}

.history-message {
    font-size: 0.9rem;
}

/* ---------- Sign-in page ---------- */

.account-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-login-bg);
    padding: 1rem;
    box-sizing: border-box;
    font-family: var(--rz-text-font-family, system-ui, sans-serif);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--rz-base-background-color, #fff);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    border-top: 4px solid var(--brand-gold);
    box-sizing: border-box;
}

.login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-brand h1 {
    font-size: 1.5rem;
    margin: 0.5rem 0 0.25rem;
    color: var(--app-heading-color);
}

.login-brand p {
    margin: 0;
    color: var(--rz-text-secondary-color, #666);
}

.login-icon {
    font-size: 3rem;
    color: var(--rz-primary, #4340d2);
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.login-field label {
    font-size: 0.85rem;
    font-weight: 600;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
}

.login-validation {
    color: var(--rz-danger, #c62828);
    font-size: 0.8rem;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.login-submit {
    width: 100%;
}

.login-error {
    background: var(--app-error-bg);
    color: var(--app-error-text);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ---------- Work ticket (print) ---------- */

.print-root {
    color-scheme: light;
    --rz-base-background-color: #ffffff;
    --rz-text-color: #222222;
    --rz-text-secondary-color: #555555;
    --rz-base-400: #bbbbbb;
    --rz-primary: #0d9488;
    --rz-on-primary: #ffffff;
    background: #fff;
    color: #000;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
}

.print-toolbar {
    color-scheme: light;
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #ddd;
    background: #f7f7f7;
}

.ticket {
    max-width: 8in;
    margin: 0 auto;
    padding: 0.4in 0.4in;
    font-size: 11pt;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #000;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.ticket-lab-name {
    font-size: 16pt;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ticket-case-no {
    text-align: right;
    font-size: 9pt;
    text-transform: uppercase;
}

.ticket-case-no span {
    display: block;
    font-size: 26pt;
    font-weight: 700;
    line-height: 1;
}

.ticket-banner {
    text-align: center;
    font-weight: 700;
    font-size: 14pt;
    letter-spacing: 0.2em;
    padding: 0.2rem;
    margin-bottom: 0.6rem;
    border: 2px solid #000;
}

.ticket-info {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
}

.ticket-info td {
    padding: 0.2rem 0.4rem;
    vertical-align: top;
}

.ticket-info td.label {
    font-weight: 700;
    width: 1in;
    font-size: 9pt;
    text-transform: uppercase;
}

.ticket h3 {
    font-size: 11pt;
    text-transform: uppercase;
    border-bottom: 1px solid #000;
    margin: 0.8rem 0 0.4rem;
    padding-bottom: 0.1rem;
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
}

.ticket-table th,
.ticket-table td {
    border: 1px solid #999;
    padding: 0.25rem 0.4rem;
    text-align: left;
    vertical-align: top;
}

.ticket-table th {
    background: #eee;
    font-size: 9pt;
    text-transform: uppercase;
}

.ticket-table.production td {
    height: 0.32in;
}

.ticket-instructions {
    white-space: pre-wrap;
    border: 1px solid #999;
    padding: 0.4rem;
    min-height: 0.6in;
}

@media print {
    .no-print {
        display: none !important;
    }

    .ticket {
        padding: 0;
        max-width: none;
    }

    .ticket-table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        size: letter;
        margin: 0.4in;
    }
}

/* ---------- Blazor error bar ---------- */

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---------- Products: each lab's own catalog ---------- */
.product-option {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.product-option-category {
    color: var(--rz-text-tertiary-color);
    font-size: 0.8em;
    white-space: nowrap;
}

.empty-catalog {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.5rem;
}

.empty-catalog > .rzi {
    font-size: 2.5rem;
    color: var(--brand-gold);
}

.category-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--rz-base-300);
    border-radius: 8px;
    max-height: 50vh;
    overflow-y: auto;
}

.category-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--rz-base-200);
}

.category-row:last-child { border-bottom: none; }
.category-row.inactive .category-name strong { opacity: 0.55; }

.category-order {
    display: flex;
    flex-direction: column;
}

.category-name {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---------- Data migration (super admin) ---------- */
.launch-steps {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.launch-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem 0.45rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--rz-base-300);
    background: var(--rz-base-background-color);
    color: var(--rz-text-color);
    font: inherit;
    cursor: pointer;
}

.launch-step:disabled { opacity: 0.45; cursor: default; }

.launch-step-num {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--rz-base-200);
    font-weight: 600;
    font-size: 0.85rem;
}

.launch-step.active {
    border-color: var(--rz-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--rz-primary) 25%, transparent);
}

.launch-step.active .launch-step-num { background: var(--rz-primary); color: #fff; }
.launch-step.done .launch-step-num { background: var(--brand-gold); color: #1b1300; }

.migration-indent { padding-left: 1.9rem; }
.coming-next { opacity: 0.55; }

.migration-counts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.5rem;
}

.migration-counts > div {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--rz-base-100);
}

.migration-counts strong { font-size: 1.25rem; }
.migration-counts span { font-size: 0.8rem; color: var(--rz-text-secondary-color); }
.migration-counts .warn strong { color: var(--brand-gold-dark); }
.migration-counts .err strong { color: var(--rz-danger); }

.migration-progress { border-left: 4px solid var(--rz-primary); }
.migration-progress.ok { border-left-color: var(--rz-success); }
.migration-progress.warn { border-left-color: var(--brand-gold); }
.migration-progress.failed { border-left-color: var(--rz-danger); }

.migration-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.migration-status {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rz-text-secondary-color);
}

.migration-log {
    margin-top: 0.75rem;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.8rem;
    background: #041520;
    color: #cfe6ee;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    max-height: 220px;
    overflow: auto;
}

.log-line { display: flex; gap: 0.75rem; padding: 1px 0; }
.log-line .log-area { color: var(--brand-teal-300); min-width: 70px; }
.log-line.warning { color: var(--brand-gold-light); }
.log-line.error { color: #ff8a80; }

.migration-tables {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.25rem 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.migration-tables > div { display: flex; justify-content: space-between; opacity: 0.7; }
.migration-tables > div.used { opacity: 1; font-weight: 600; color: var(--rz-primary); }

.preview-table {
    border: 1px solid var(--rz-base-300);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.875rem;
}

.preview-row {
    display: grid;
    grid-template-columns: 1fr 28px 1fr;
    gap: 0.5rem;
    align-items: start;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--rz-base-200);
}

.preview-row:last-child { border-bottom: none; }
.preview-row.head { font-weight: 600; background: var(--rz-base-100); }
.preview-row .before { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; color: var(--rz-text-secondary-color); }
.preview-row .after { display: flex; flex-direction: column; }

.preview-issue {
    font-size: 0.78rem;
    color: var(--brand-gold-dark);
}

.launch-summary {
    display: grid;
    gap: 0.4rem;
}

.launch-summary > div { display: flex; gap: 1rem; }
.launch-summary span { width: 90px; color: var(--rz-text-secondary-color); }

@media (max-width: 640px) {
    .preview-row { grid-template-columns: 1fr; }
    .preview-row .rzi { transform: rotate(90deg); }
}

/* ---------- Modules (super admin) ---------- */
.module-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.75rem; }
.module-card {
    border: 1px solid var(--rz-base-300); border-top: 3px solid var(--brand-gold); border-radius: 6px;
    padding: 0.75rem 1rem; background: var(--rz-base-background-color);
}
.module-card-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.module-card-head .rzi { color: var(--rz-primary); }
.module-card-head .sub-text { margin-left: auto; }
.module-table { width: 100%; border-collapse: collapse; }
.module-table th, .module-table td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--rz-base-300); text-align: left; vertical-align: middle; }
.module-table th { font-size: 0.8rem; color: var(--rz-text-secondary-color); font-weight: 600; white-space: nowrap; }
.module-table th .rzi { font-size: 1rem; vertical-align: -3px; }
.module-table tr.inactive td { opacity: 0.55; }
.module-cell { display: flex; align-items: center; gap: 0.5rem; }
.module-cell-text { display: flex; flex-direction: column; min-width: 0; }
.module-note { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.module-locked {
    max-width: 620px; margin: 3rem auto; text-align: center; padding: 2rem;
    border: 1px solid var(--rz-base-300); border-top: 3px solid var(--brand-gold); border-radius: 10px;
    background: var(--rz-base-background-color);
}
.module-locked-icon {
    width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center;
    background: color-mix(in srgb, var(--rz-primary) 14%, transparent); color: var(--rz-primary);
}
.module-locked-icon .rzi { font-size: 2rem; }
.module-features { list-style: none; padding: 0; margin: 0 auto 1.5rem; display: inline-block; text-align: left; }
.module-features li { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; }
.module-features .rzi { color: var(--rz-success); font-size: 1.1rem; }
.module-contact { font-weight: 600; }

/* ---------- CRM: shared ---------- */
.crm-kpis { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.crm-kpis > * {
    display: flex; flex-direction: column; padding: 0.45rem 0.9rem; border-radius: 8px; min-width: 110px;
    border: 1px solid var(--rz-base-300); background: var(--rz-base-background-color); color: inherit; text-decoration: none;
}
.crm-kpis strong { font-size: 1.15rem; }
.crm-kpis span { font-size: 0.75rem; color: var(--rz-text-secondary-color); }
.crm-kpis .warn { border-color: var(--rz-warning); }
.crm-kpis .warn strong { color: var(--rz-warning-dark, var(--rz-warning)); }
.crm-kpis .ok strong { color: var(--rz-success); }
.new-office {
    display: inline-block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; padding: 0.05rem 0.4rem; margin-left: 0.35rem;
    border-radius: 999px; background: var(--brand-gold); color: #1b1300; vertical-align: 2px;
}
.crm-inline { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; cursor: pointer; }
.crm-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.crm-selection {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.45rem 0.6rem; border-radius: 8px;
    background: color-mix(in srgb, var(--brand-gold) 16%, transparent); border: 1px solid color-mix(in srgb, var(--brand-gold) 45%, transparent);
}
.crm-selection strong { margin-right: 0.25rem; }
.text-danger { color: var(--rz-danger); font-weight: 600; }
.back-link { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.85rem; text-decoration: none; margin-bottom: 0.25rem; }
.btn-link { text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.crm-tag { display: inline-block; padding: 0.05rem 0.5rem; margin: 0 0.25rem 0.25rem 0; border-radius: 999px; font-size: 0.75rem; background: var(--rz-base-200); }
.status-pick {
    display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.55rem 0.75rem; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--rz-base-300); background: var(--rz-base-background-color); color: inherit; font: inherit; text-align: left;
}
.status-pick:hover { border-color: var(--rz-primary); }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; display: inline-block; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(0,0,0,0.12); }

/* ---------- CRM: territory map ---------- */
.crm-layout { display: grid; grid-template-columns: 370px 1fr; gap: 1rem; height: calc(100vh - 230px); min-height: 560px; }
.crm-side { display: flex; flex-direction: column; gap: 0.6rem; min-height: 0; }
.crm-main { display: flex; flex-direction: column; gap: 0.75rem; min-height: 0; }
.crm-main > .crm-map-wrap { flex: 1; min-height: 360px; }
.crm-filter-row { display: flex; gap: 0.4rem; align-items: center; }
.crm-toggles { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; }
.crm-toggles label { display: flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.crm-radius { padding: 0.6rem; border: 1px dashed var(--rz-base-400); border-radius: 8px; display: flex; flex-direction: column; gap: 0.4rem; }
.crm-radius .section-title { display: flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; }
.pick-hint { color: var(--brand-gold-dark); font-weight: 600; }
.crm-list-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; }
.crm-list { flex: 1; overflow-y: auto; border: 1px solid var(--rz-base-300); border-radius: 8px; background: var(--rz-base-background-color); }
.crm-list-item {
    display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.6rem; cursor: pointer;
    border-bottom: 1px solid var(--rz-base-200);
}
.crm-list-item:hover { background: var(--rz-base-100); }
.crm-list-item.active { background: color-mix(in srgb, var(--rz-primary) 12%, transparent); }
.crm-list-text { min-width: 0; }
.crm-list-text .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-list-text .sub-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-empty { padding: 1.5rem; text-align: center; color: var(--rz-text-secondary-color); }
.crm-empty .rzi { font-size: 2rem; color: var(--brand-gold); }

.crm-map-wrap { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--rz-base-300); background: #dfe7ea; }
.crm-map { position: absolute; inset: 0; }
.crm-map-wrap.picking .crm-map { cursor: crosshair; }
.crm-map-failed {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
    text-align: center; padding: 2rem; color: var(--rz-text-secondary-color); z-index: 500;
}
.crm-map-failed .rzi { font-size: 2.5rem; }
/* Free dark map: invert the light tiles in dark mode. */
:root[data-theme="dark"] .crm-map .leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(0.92) contrast(0.88) saturate(0.6); }
:root[data-theme="dark"] .crm-map-wrap { background: #10202b; }
.crm-map .leaflet-control-attribution { font-size: 10px; }

.crm-legend {
    position: absolute; right: 10px; bottom: 22px; z-index: 450; display: flex; flex-direction: column; gap: 0.2rem;
    padding: 0.5rem 0.65rem; border-radius: 8px; font-size: 0.75rem; max-height: 50%; overflow: auto;
    background: color-mix(in srgb, var(--rz-base-background-color) 92%, transparent); box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.crm-legend span { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.crm-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.crm-card {
    position: absolute; left: 12px; bottom: 22px; z-index: 460; width: min(380px, calc(100% - 24px));
    padding: 0.85rem 1rem; border-radius: 10px; border-top: 3px solid var(--brand-gold);
    background: var(--rz-base-background-color); box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.crm-card-close { position: absolute; top: 4px; right: 4px; }
.crm-card-title { font-weight: 700; font-size: 1.05rem; padding-right: 1.5rem; }
.crm-card-title a { color: inherit; text-decoration: none; }
.crm-card-title a:hover { text-decoration: underline; }
.crm-card-line { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; margin-top: 0.3rem; }
.crm-card-line .rzi { font-size: 1rem; color: var(--rz-text-secondary-color); }
.crm-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.55rem 0; }
.crm-card-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.crm-route {
    border: 1px solid var(--rz-base-300); border-top: 3px solid var(--rz-primary); border-radius: 10px; padding: 0.75rem 1rem;
    background: var(--rz-base-background-color); max-height: 34vh; overflow: auto;
}
.crm-route-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.crm-route-head .section-title { display: flex; align-items: center; gap: 0.35rem; }
.crm-route-stops { margin: 0.5rem 0 0; padding-left: 1.4rem; columns: 2 320px; }
.crm-route-stops li { margin-bottom: 0.3rem; break-inside: avoid; }
.crm-route-stops .sub-text { display: block; }
.crm-route-num span {
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: 12px;
    background: #0c5a74; color: #fff; border: 2px solid #d4a62a; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ---------- CRM: pipeline ---------- */
.pipeline { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; align-items: stretch; min-height: 60vh; }
.pipeline-col {
    flex: 0 0 260px; display: flex; flex-direction: column; border-radius: 10px; background: var(--rz-base-100);
    border: 1px solid var(--rz-base-300); transition: border-color 0.15s, background 0.15s;
}
.pipeline-col.drag-over { border-color: var(--brand-gold); background: color-mix(in srgb, var(--brand-gold) 10%, var(--rz-base-100)); }
.pipeline-col-head { padding: 0.6rem 0.75rem; border-bottom: 2px solid var(--rz-primary); }
.pipeline-col-name { font-weight: 700; display: flex; justify-content: space-between; }
.pipeline-cards { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.pipeline-empty { text-align: center; padding: 1.5rem 0.5rem; color: var(--rz-text-disabled-color); font-size: 0.85rem; border: 1px dashed var(--rz-base-400); border-radius: 8px; }
.pipeline-col.outcome {
    flex: 0 0 110px; align-items: center; justify-content: center; gap: 0.25rem; text-align: center; font-weight: 700;
    border-style: dashed;
}
.pipeline-col.outcome .rzi { font-size: 2rem; }
.pipeline-col.outcome small { font-weight: 400; color: var(--rz-text-secondary-color); }
.pipeline-col.won { color: var(--rz-success); }
.pipeline-col.lost { color: var(--rz-danger); }

.deal-card {
    padding: 0.6rem 0.7rem; border-radius: 8px; cursor: grab; background: var(--rz-base-background-color);
    border: 1px solid var(--rz-base-300); border-left: 4px solid var(--rz-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.deal-card:hover { border-color: var(--rz-primary); }
.deal-card.dragging { opacity: 0.4; }
.deal-card.rotting { border-left-color: var(--rz-danger); }
.deal-card.static { cursor: pointer; margin-bottom: 0.5rem; }
.deal-card.won { border-left-color: var(--rz-success); }
.deal-card.lost { border-left-color: var(--rz-base-500); opacity: 0.8; }
.deal-title { font-weight: 600; }
.deal-org { font-size: 0.8rem; color: var(--rz-text-secondary-color); margin-bottom: 0.35rem; }
.deal-foot { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8rem; }
.deal-next { margin-left: auto; display: inline-flex; align-items: center; gap: 0.2rem; color: var(--rz-text-secondary-color); }
.deal-next .rzi { font-size: 0.95rem; }
.deal-next.late { color: var(--rz-danger); font-weight: 600; }
.deal-next.none { color: var(--rz-warning-dark, #b7791f); }
.deal-rot { margin-top: 0.3rem; font-size: 0.72rem; color: var(--rz-danger); font-weight: 600; }
.closed-list { display: flex; flex-direction: column; }
.closed-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0; border-bottom: 1px solid var(--rz-base-200); cursor: pointer; flex-wrap: wrap; }

.stage-edit { display: grid; grid-template-columns: 56px 1fr 90px 130px 40px; gap: 0.5rem; align-items: center; }
.stage-edit.head { font-size: 0.75rem; color: var(--rz-text-secondary-color); font-weight: 600; }
.stage-order { display: flex; }

/* ---------- CRM: prospect page ---------- */
.crm-details { display: grid; grid-template-columns: 90px 1fr; gap: 0.45rem 0.75rem; margin: 0; font-size: 0.9rem; }
.crm-details dt { color: var(--rz-text-secondary-color); }
.crm-details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.crm-notes { margin-top: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 6px; background: var(--rz-base-100); white-space: pre-wrap; font-size: 0.9rem; }
.crm-mini-map { overflow: hidden; }
.crm-mini-map .crm-map-wrap { border: 0; border-radius: 0; }
.crm-mini-map-note { padding: 0.45rem 0.75rem; display: flex; align-items: center; gap: 0.3rem; }
.crm-nudge { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.65rem; border-radius: 6px; font-size: 0.9rem; background: color-mix(in srgb, var(--rz-warning) 14%, transparent); }
.activity-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rz-base-200); }
.activity-row.overdue strong { color: var(--rz-danger); }
.activity-row > .rzi { color: var(--rz-primary); }
.activity-text { cursor: pointer; flex: 1; }
.activity-link { cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; }
.activity-link .rzi { color: var(--rz-primary); font-size: 1.1rem; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 0.65rem; padding: 0.55rem 0; cursor: pointer; position: relative; }
.timeline-item:not(:last-child)::before {
    content: ""; position: absolute; left: 15px; top: 40px; bottom: -6px; width: 2px; background: var(--rz-base-300);
}
.timeline-icon {
    width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: color-mix(in srgb, var(--rz-primary) 14%, transparent); color: var(--rz-primary);
}
.timeline-icon .rzi { font-size: 1.05rem; }
.timeline-notes { margin-top: 0.2rem; font-size: 0.88rem; white-space: pre-wrap; }
.activity-types { flex-wrap: wrap; }

/* ---------- CRM: NPI import ---------- */
.crm-locate {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.55rem 0.8rem; border-radius: 8px;
    border: 1px solid var(--rz-base-300); background: var(--rz-base-background-color); font-size: 0.9rem;
}
.crm-import-bar { position: sticky; bottom: 0.5rem; z-index: 5; border-top: 3px solid var(--brand-gold) !important; }

@media (max-width: 1000px) {
    .crm-layout { grid-template-columns: 1fr; height: auto; }
    .crm-main > .crm-map-wrap { height: 60vh !important; flex: none; }
    .crm-list { max-height: 45vh; }
}

.crm-link-btn {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.7rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600;
    text-decoration: none; color: var(--rz-text-color); background: var(--rz-base-200); border: 1px solid var(--rz-base-300);
}
.crm-link-btn .rzi { font-size: 1rem; }
.crm-link-btn:hover { border-color: var(--rz-primary); }
.crm-link-btn.primary { background: var(--rz-primary); color: var(--rz-on-primary, #fff); border-color: var(--rz-primary); padding: 0.45rem 0.9rem; }
