﻿:root {
    --color-primary: #4A90B8;
    --color-secondary: #6B7280;
    --color-accent: #F97316;
    --color-white: #FFFFFF;
    --color-sidebar-bg: #1F2937;
    --color-sidebar-text: #D1D5DB;
    --color-sidebar-hover: #374151;
    --color-header-bg: #1F2937;
    --color-body-bg: #F3F4F6;
    --sidebar-width: 260px;
    --header-height: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-body-bg);
    color: #111827;
}

/* ── LAYOUT SHELL ──────────────────────────────────────── */
.layout-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ── HEADER ────────────────────────────────────────────── */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    background-color: var(--color-header-bg);
    padding: 0 1.25rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.header-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--color-white);
    font-weight: 600;
}

.header-user svg { fill: var(--color-primary); }

.header-nav {
    display: flex;
    align-items: center;
    gap: .5rem;
    position: relative;
}

.header-nav .nav-btn {
    background: transparent;
    border: none;
    color: var(--color-sidebar-text);
    font-size: .9rem;
    cursor: pointer;
    padding: .4rem .75rem;
    border-radius: 6px;
    transition: background .2s, color .2s;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.header-nav .nav-btn:hover,
.header-nav .nav-btn.active {
    background: var(--color-accent);
    color: var(--color-white);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--color-white);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    overflow: hidden;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .65rem 1rem;
    font-size: .875rem;
    color: #374151;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: #F3F4F6;
    color: var(--color-accent);
}

.dropdown-logout-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .65rem 1rem;
    font-size: .875rem;
    color: #374151;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}

.dropdown-logout-btn:hover {
    background: #F3F4F6;
    color: var(--color-accent);
}

.dropdown-divider { height: 1px; background: #E5E7EB; }

/* ── BODY AREA ─────────────────────────────────────────── */
.body-area {
    display: flex;
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

/* ── SIDEBAR ───────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%; /* fill the body-area height exactly */
    overflow: hidden; /* outer shell does NOT scroll */
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .75rem 1rem;
    border-bottom: 1px solid #374151;
    background-color: whitesmoke;
    overflow: hidden;
    flex-shrink: 0;
    max-height: 80px; /* ← caps the logo area to a fixed band */
}

.sidebar-logo img {
    max-width: 100%;
    max-height: 56px; /* ← image never taller than this */
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ── NEW: scrollable nav wrapper ─────────────────────────── */
.sidebar-nav-scroll {
    flex: 1 1 0; /* takes all remaining height */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #374151 transparent;
}

.sidebar-nav-scroll::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

.nav-sections {
    padding: .25rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

/* ── NAV GROUP LABELS (Subsystem / Global) ─────────────── */
.nav-group-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #9CA3AF;
    padding: .7rem .9rem .15rem;
    user-select: none;
}

.nav-group-label-global {
    margin-top: .35rem;
    border-top: 1px solid #374151;
}

/* Right-hand cluster in a section header: active dot + chevron */
.section-flags {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex-shrink: 0;
}

.section-active-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 5px rgba(249, 115, 22, .7);
    flex-shrink: 0;
}

.nav-standalone-section .section-header.has-active {
    color: var(--color-white);
    border-left-color: var(--color-accent);
}

/* Collapse toggle inside the subsystem switcher row */
.switcher-collapse {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: .2rem .3rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 4px;
    flex-shrink: 0;
    transition: background .15s;
}

.switcher-collapse:hover { background: rgba(255, 255, 255, .14); }

.nav-section-tab {
    background: linear-gradient(135deg, #2D3748, #374151);
    border: 1px solid #4B5563;
    border-radius: 7px;
    overflow: hidden;
}

.nav-section-tab .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem .9rem;
    cursor: pointer;
    color: var(--color-white);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    transition: background .2s;
    user-select: none;
}

.nav-section-tab .section-header:hover        { background: var(--color-primary); }
.nav-section-tab .section-header.expanded     { background: var(--color-primary); border-bottom: 1px solid #3B82F6; }

.section-chevron       { transition: transform .25s; font-size: .7rem; color: var(--color-sidebar-text); }
.section-chevron.open  { transform: rotate(180deg); }

.section-sub-menu { display: flex; flex-direction: column; background: #111827; }

.section-sub-menu a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .9rem .5rem 1.2rem;
    font-size: .825rem;
    color: var(--color-sidebar-text);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background .15s, border-color .15s, color .15s;
}

.section-sub-menu a:hover,
.section-sub-menu a.active {
    background: #1F2937;
    border-left-color: var(--color-accent);
    color: var(--color-white);
}

.nav-standalone {
    padding: .25rem .5rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.nav-standalone a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .9rem;
    font-size: .875rem;
    color: var(--color-sidebar-text);
    text-decoration: none;
    border-radius: 7px;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}

.nav-standalone a:hover,
.nav-standalone a.active {
    background: var(--color-sidebar-hover);
    color: var(--color-white);
    border-left-color: var(--color-accent);
}

.nav-item-icon { font-size: 1rem; width: 20px; text-align: center; color: var(--color-secondary); }
.nav-standalone a:hover .nav-item-icon,
.nav-standalone a.active .nav-item-icon { color: var(--color-accent); }

.nav-standalone-section {
    border-radius: 7px;
    overflow: hidden;
}

.nav-standalone-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem .9rem;
    cursor: pointer;
    color: var(--color-sidebar-text);
    font-size: .875rem;
    font-weight: 400;
    border-radius: 7px;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
    user-select: none;
}

.nav-standalone-section .section-header:hover,
.nav-standalone-section .section-header.expanded {
    background: var(--color-sidebar-hover);
    color: var(--color-white);
    border-left-color: var(--color-accent);
}

.nav-standalone-section .section-header.expanded {
    border-radius: 7px 7px 0 0;
}

.nav-standalone-section .section-sub-menu {
    display: flex;
    flex-direction: column;
    background: transparent;
}

.nav-standalone-section .section-sub-menu a {
    padding-left: 2rem;
    border-radius: 0 0 7px 7px;
}

/* ── MAIN CONTENT ──────────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; padding: 1.5rem 2rem; background: var(--color-body-bg); }

/* ── PAGE CARD ─────────────────────────────────────────── */
.page-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    padding: 1.5rem;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 1rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--color-primary);
}

/* ── PAGE HEADER ROW ───────────────────────────────────── */
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.toolbar-label { font-size: .875rem; font-weight: 600; color: #374151; }
.status-text   { color: #9CA3AF; font-size: .875rem; }
.record-count  { margin-top: .75rem; font-size: .8rem; color: #6B7280; }

/* ── STAT REPORT DATE ─────────────────────────────────── */
.stat-report-date {
    font-size: .875rem;
    color: #6B7280;
    white-space: nowrap;
}

/* ── STAT TILE GRID ───────────────────────────────────── */
.stat-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-tile {
    background: #fff;
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    border: 1px solid #E5E7EB;
    transition: transform .15s, box-shadow .15s;
}

.stat-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.stat-tile-label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6B7280;
    margin-bottom: .35rem;
}

.stat-tile-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Tile color variants */
.stat-tile-primary  { border-left: 4px solid var(--color-primary); }
.stat-tile-primary  .stat-tile-value { color: var(--color-primary); }

.stat-tile-success  { border-left: 4px solid #22C55E; }
.stat-tile-success  .stat-tile-value { color: #16A34A; }

.stat-tile-info     { border-left: 4px solid #3B82F6; }
.stat-tile-info     .stat-tile-value { color: #2563EB; }

.stat-tile-warning  { border-left: 4px solid #F59E0B; }
.stat-tile-warning  .stat-tile-value { color: #D97706; }

.stat-tile-danger   { border-left: 4px solid #EF4444; }
.stat-tile-danger   .stat-tile-value { color: #DC2626; }

/* ── STAT SUBSYSTEM SECTION ───────────────────────────── */
.stat-subsystem-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #E5E7EB;
}

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    transition: opacity .2s, transform .1s;
}

.btn:hover  { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--color-primary);   color: var(--color-white); }
.btn-accent  { background: var(--color-accent);    color: var(--color-white); }
.btn-grey    { background: var(--color-secondary); color: var(--color-white); }
.btn-outline { background: transparent; border: 1px solid var(--color-primary); color: var(--color-primary); }
.btn-primary { background: var(--color-primary); color: var(--color-white); }
.btn-accent  { background: var(--color-accent); color: var(--color-white);}
.btn-grey    { background: var(--color-secondary); color: var(--color-white); }
.btn-warning { background: #D97706; color: var(--color-white); }
.btn-danger  { background: #DC2626; color: var(--color-white); }
.btn-sm      { padding: .3rem .65rem; font-size: .78rem; }

/* ── BUTTON SPINNER ──────────────────────────────────────── */
.btn-spinner {
    display: inline-block;
    width: .85rem;
    height: .85rem;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin-right: .3rem;
    vertical-align: middle;
}

/* ── TABLE ─────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

    .data-table th {
        background: var(--color-primary);
        color: var(--color-white);
        padding: .65rem 1rem;
        text-align: left;
        font-weight: 600;
        white-space: nowrap;
    }

        .data-table th:first-child {
            border-radius: 7px 0 0 0;
        }

        .data-table th:last-child {
            border-radius: 0 7px 0 0;
        }

    .data-table td {
        padding: .6rem 1rem;
        border-bottom: 1px solid #E5E7EB;
        color: #374151;
        background: #ffffff; /* ← explicit white, prevents header colour bleeding */
        vertical-align: middle; /* ← keeps the new Test icon cell aligned */
    }

    .data-table tr:hover td {
        background: #F9FAFB;
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

/* ── TABLE-WRAPPER (generic styled tables) ────────────── */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #fff;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.table-wrapper thead th {
    background: var(--color-primary);
    color: #fff;
    padding: .65rem .85rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: .8rem;
    letter-spacing: .02em;
}

.table-wrapper thead th:first-child { border-radius: 9px 0 0 0; }
.table-wrapper thead th:last-child  { border-radius: 0 9px 0 0; }

.table-wrapper tbody td {
    padding: .55rem .85rem;
    border-bottom: 1px solid #F3F4F6;
    color: #374151;
    vertical-align: middle;
}

.table-wrapper tbody tr:hover td { background: #F0F9FF; }
.table-wrapper tbody tr:last-child td { border-bottom: none; }

.badge { display: inline-flex; align-items: center; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-phone { background: #DBEAFE; color: #1D4ED8; }
.badge-email { background: #D1FAE5; color: #065F46; }
.badge-ip    { background: #FEE2E2; color: #991B1B; }

/* ── OMNISUBSYSTEM BADGES ───────────────────────────────── */
.badge-db    { background: #EFF6FF; color: #1D4ED8; }
.badge-queue { background: #F0FDF4; color: #15803D; }

/* ── ALERTS ────────────────────────────────────────────── */
.alert-success {
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    border-radius: 8px;
    padding: .65rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    color: #15803D;
}

.alert-error {
    background: #FFF1F2;
    border: 1px solid #FECDD3;
    border-radius: 8px;
    padding: .65rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    color: #BE123C;
}

/* ── MODAL ─────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 300;
    animation: fadeIn .15s ease;
}

.modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 301;
    background: var(--color-white);
    border-radius: 12px;
    width: min(540px, 94vw);
    --modal-max-height: 88vh;   /* the sticky action bar (.cab) takes 30% of this */
    max-height: var(--modal-max-height);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: slideUp .2s ease;
}

.modal-dialog-wide { width: min(780px, 96vw); }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { transform: translate(-50%, -46%); opacity: 0; }
    to   { transform: translate(-50%, -50%); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #E5E7EB;
    font-size: 1rem;
    font-weight: 700;
    color: #1F2937;
    background: linear-gradient(135deg, #F8FAFC, #EFF6FF);
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1rem;
    color: #9CA3AF;
    cursor: pointer;
    padding: .25rem .5rem;
    border-radius: 4px;
    transition: background .15s, color .15s;
}

.modal-close:hover { background: #FEE2E2; color: #DC2626; }

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .6rem;
    padding: .9rem 1.25rem;
    border-top: 1px solid #E5E7EB;
    background: #F9FAFB;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

/* ── FORM FIELDS ───────────────────────────────────────── */
.field-group {
    display: flex;
    flex-direction: column;   /* ← this is what was missing */
    gap: .4rem;
    width: 100%;
}

.field-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.4;
}

.field-hint {
    font-weight: 400;
    color: #9CA3AF;
    font-size: .75rem;
    margin-left: .3rem;
}

.required { color: #EF4444; }

.form-select,
.form-input {
    width: 100%;
    padding: .45rem .75rem;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: .875rem;
    color: #374151;
    background: var(--color-white);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-select:focus,
.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74,144,184,0.15);
}

/* Campaign list targeting rules (CampaignList.razor): Off / Include only / Exclude segmented control,
   then the list picker and a hint for the selected mode. The fieldset keeps the group label and the
   disabled-while-saving behaviour; the browser's fieldset border and legend inset are reset. */
.rule-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.rule-fieldset > legend { padding: 0; margin-bottom: .45rem; }
.rule-modes {
    display: inline-flex;
    align-self: flex-start;
    max-width: 100%;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    overflow: hidden;
}
.rule-mode {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: .4rem .85rem;
    font-size: .82rem;
    color: #374151;
    background: var(--color-white);
    border-left: 1px solid #D1D5DB;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.rule-mode:first-child { border-left: 0; }
.rule-mode input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rule-mode:hover { background: #F3F4F6; }
.rule-mode:focus-within { box-shadow: inset 0 0 0 2px rgba(74,144,184,0.45); }
.rule-mode.is-active { font-weight: 600; color: var(--color-white); }
.rule-mode.is-active.mode-off     { background: #6B7280; }
.rule-mode.is-active.mode-include { background: var(--color-primary); }
.rule-mode.is-active.mode-exclude { background: #B45309; }
.rule-fieldset:disabled .rule-mode { cursor: not-allowed; opacity: .6; }
.rule-fieldset .form-select:disabled { background: #F9FAFB; color: #9CA3AF; cursor: not-allowed; }
@media (max-width: 560px) {
    .rule-modes { flex-direction: column; align-self: stretch; }
    .rule-mode { border-left: 0; border-top: 1px solid #D1D5DB; }
    .rule-mode:first-child { border-top: 0; }
}
.rule-hint { margin-left: 0; }

.form-textarea {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: .825rem;
    font-family: 'Consolas', monospace;
    color: #374151;
    background: var(--color-white);
    resize: vertical;
    min-height: 130px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    line-height: 1.6;
    display: block;      /* ← ensures it sits below the label */
}

.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74,144,184,0.15);
}

/* ── PARSE SUMMARY BAR ──────────────────────────────────── */
.parse-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 7px;
    padding: .55rem .9rem;
    font-size: .82rem;
    color: #374151;
}

.summary-type { display: flex; align-items: center; gap: .4rem; }

/* ── PARSE RESULTS GRID ─────────────────────────────────── */
.parse-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.parse-col {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.parse-col-valid   { border-color: #BBF7D0; }
.parse-col-invalid { border-color: #FECDD3; }

.parse-col-header {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .75rem;
    font-size: .78rem;
    font-weight: 700;
    color: #374151;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.parse-col-valid   .parse-col-header { background: #F0FDF4; border-color: #BBF7D0; }
.parse-col-invalid .parse-col-header { background: #FFF1F2; border-color: #FECDD3; }

.parse-dot       { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.parse-dot-green { background: #22C55E; }
.parse-dot-red   { background: #EF4444; }

.parse-count     { margin-left: auto; font-weight: 700; color: #15803D; }
.parse-count-red { color: #DC2626; }

.parse-col-scroll {
    overflow-y: auto;
    max-height: 220px;
    padding: .4rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    background: var(--color-white);
}

.parse-empty { font-size: .8rem; color: #9CA3AF; padding: .4rem; text-align: center; }

.parse-item {
    font-size: .78rem;
    font-family: 'Consolas', monospace;
    padding: .25rem .45rem;
    border-radius: 4px;
    word-break: break-all;
}

.parse-item-valid   { background: #DCFCE7; color: #166534; }
.parse-item-invalid { background: #FEF2F2; color: #991B1B; display: flex; flex-direction: column; gap: .1rem; }
.parse-item-value   { font-weight: 600; }
.parse-item-reason  { font-size: .72rem; color: #B91C1C; font-style: italic; }

.parse-warn {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 7px;
    padding: .55rem .9rem;
    font-size: .8rem;
    color: #92400E;
} 

/* ── SEARCH BOX ────────────────────────────────────────── */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 320px;
}

.search-icon {
    position: absolute;
    left: .6rem;
    font-size: .85rem;
    pointer-events: none;
    line-height: 1;
}

.search-input {
    width: 100%;
    padding: .45rem .75rem .45rem 2rem;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: .875rem;
    color: #374151;
    background: var(--color-white);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74,144,184,0.15);
}

.search-clear {
    position: absolute;
    right: .4rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    font-size: .8rem;
    padding: .2rem .35rem;
    border-radius: 4px;
    line-height: 1;
    transition: color .15s, background .15s;
}

.search-clear:hover { color: #DC2626; background: #FEE2E2; }

/* ── SEARCH RESULTS ────────────────────────────────────── */
.search-highlight {
    background: #FEF08A;
    color: #713F12;
    border-radius: 2px;
    padding: 0 1px;
    font-weight: 600;
}

.search-hint { color: #9CA3AF; font-style: italic; }

.search-no-results {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #F9FAFB;
    border: 1px dashed #D1D5DB;
    border-radius: 8px;
    font-size: .875rem;
    color: #6B7280;
}

/* ── CONTENT KEYWORD BADGES ────────────────────────────── */
.badge-warning  { background: #FEF3C7; color: #92400E; }
.badge-critical { background: #FEE2E2; color: #991B1B; }
.badge-active   { background: #D1FAE5; color: #065F46; }
.badge-inactive { background: #F3F4F6; color: #6B7280; }  /* kept for any static use */

/* Light-red variant used on the inactive toggle pill */
.badge-inactive-red { background: #FEE2E2; color: #991B1B; }

/* ── ACTIVE/INACTIVE TOGGLE BUTTON ─────────────────────── */
.badge-toggle {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: filter .15s, transform .1s, opacity .15s;
    white-space: nowrap;
    font-family: inherit;
}

.badge-toggle:hover  { filter: brightness(.92); transform: translateY(-1px); }
.badge-toggle:active { transform: translateY(0); }

.badge-toggle:disabled {
    opacity: .6;
    cursor: wait;
    transform: none;
}

/* ── SORTABLE TABLE HEADERS ─────────────────────────────── */
.sort-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sort-th:hover { background: #3a7fa8; }

.sort-th .sort-icons {
    display: inline-flex;
    flex-direction: column;
    margin-left: .35rem;
    gap: 1px;
    vertical-align: middle;
    line-height: 1;
    opacity: .45;
    font-size: .6rem;
}

.sort-th.sorted .sort-icons { opacity: 1; }

.sort-th .sort-asc  { line-height: 1; }
.sort-th .sort-desc { line-height: 1; }

.sort-th.asc  .sort-desc,
.sort-th.desc .sort-asc  { opacity: .25; }
/* ── MARKETING SOURCE BADGES ────────────────────────────── */
.badge-spark  { background: #EDE9FE; color: #5B21B6; }
.badge-market { background: #FEF3C7; color: #92400E; }

/* ── LOGIN PAGE ────────────────────────────────────────── */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-sidebar-bg);
}

.login-card {
    background: var(--color-white);
    border-radius: 14px;
    padding: 2.5rem 2rem;
    width: min(420px, 96vw);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    gap: .6rem;
    overflow: hidden; /* ← prevents any child from bleeding outside the rounded card */
}

.login-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    letter-spacing: 1px;
}

.login-logo img {
    max-width: 100%; /* ← constrain to the card's content width */
    height: auto; /* ← preserve aspect ratio */
    display: block;
    margin: 0 auto; /* ← center it since it's now block-level */
}

.login-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1F2937;
    text-align: center;
    margin: 0;
}

.login-subtitle {
    font-size: .875rem;
    color: #6B7280;
    text-align: center;
    margin-bottom: .5rem;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: #374151;
    margin-top: .75rem;
}

.login-btn {
    width: 100%;
    justify-content: center;
    padding: .65rem;
    font-size: .95rem;
    margin-top: 1rem;
}

/* ── APPROVAL PAGE ──────────────────────────────────────── */
.approval-th {
    text-align: center;
    padding: .5rem .6rem;
    white-space: nowrap;
}

.approval-cell {
    text-align: center;
    padding: .5rem .6rem;
    white-space: nowrap;
}

.approval-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.approval-yes {
    background: #D1FAE5;
    color: #065F46;
}

.approval-no {
    background: #FEE2E2;
    color: #991B1B;
}

.approval-missing {
    background: #F3F4F6;
    color: #9CA3AF;
}

/* ── APPROVAL EDIT CHECKLIST ────────────────────────────── */
.approval-check-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.approval-check-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .85rem;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    font-size: .875rem;
}

.approval-check-item.check-approved {
    background: #F0FDF4;
    border-color: #86EFAC;
}

.approval-check-item.check-unapproved {
    background: #FFF1F2;
    border-color: #FECDD3;
}

.approval-check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.check-label {
    flex: 1;
}

.check-saving {
    font-size: .75rem;
    color: #9CA3AF;
    font-style: italic;
}

/* ── LEADS PAGE ─────────────────────────────────────────── */
.leads-date-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

.leads-quick-dates {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.leads-date-range {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-left: auto;
}

/* ── FILTER CHIPS ────────────────────────────────────────── */
.leads-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .75rem;
}

.leads-chip {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}

.leads-chip-clear {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FECACA;
    cursor: pointer;
    border: 1px solid #FECACA;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    padding: .2rem .6rem;
}

.leads-chip-clear:hover { background: #FCA5A5; }

/* ── LEADS TABLE ─────────────────────────────────────────── */
.leads-table tbody tr.lead-row {
    cursor: pointer;
    transition: background .12s;
}

.leads-table tbody tr.lead-row:hover td { background: #EFF6FF; }

.leads-chip-x {
    background: transparent;
    border: none;
    color: #1D4ED8;
    cursor: pointer;
    font-size: .7rem;
    line-height: 1;
    margin-left: .35rem;
    padding: 0 0 0 .1rem;
    opacity: .6;
}

.leads-chip-x:hover { opacity: 1; color: #991B1B; }

/* ── HOVER POPUP (legacy — still used by the per-client leads grid) ──────── */
.lead-popup {
    background: #1E293B;
    color: #F1F5F9;
    border-radius: 8px;
    padding: .9rem 1.1rem;
    font-size: .78rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    animation: fadeIn .1s ease;
}

.lead-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .3rem .75rem;
}

.lead-popup-grid div {
    display: flex;
    flex-direction: column;
    gap: .05rem;
}

.lp-label {
    font-size: .68rem;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.lp-val  { color: #F1F5F9; }
.lp-mono { font-family: 'Consolas', monospace; font-size: .73rem; }

.lead-popup-hint {
    margin-top: .6rem;
    font-size: .7rem;
    color: #64748B;
    text-align: right;
}

/* ── PAGINATION ──────────────────────────────────────────── */
.leads-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .9rem;
    gap: .5rem;
}

/* ── SEARCH MODAL GRID ───────────────────────────────────── */
.leads-search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
}

/* ── BUTTON SPINNER ──────────────────────────────────────── */
.btn-spinner {
    display: inline-block;
    width: .85rem;
    height: .85rem;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin-right: .3rem;
    vertical-align: middle;
}

/* ── Lead Detail ─────────────────────────────────────────── */
.lead-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.lead-detail-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}

.lead-detail-heading {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    margin-bottom: .6rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid #e2e8f0;
}

.lead-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    padding: .3rem 0;
    font-size: .85rem;
    border-bottom: 1px solid #f1f5f9;
}

.lead-detail-row:last-child {
    border-bottom: none;
}

.lead-detail-row span:first-child {
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.lead-detail-row span:last-child {
    text-align: right;
    word-break: break-all;
}

/* ── DASHBOARD TILES ──────────────────────────────────────── */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dash-tile {
    background: var(--color-white);
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    transition: box-shadow .2s, border-color .2s;
}

.dash-tile:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border-color: var(--color-primary);
}

.dash-tile-icon {
    font-size: 1.5rem;
    margin-bottom: .15rem;
}

.dash-tile-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1F2937;
    line-height: 1.1;
}

.dash-tile-label {
    font-size: .78rem;
    color: #6B7280;
    font-weight: 500;
}

.dash-tile-sub {
    font-size: .7rem;
    color: #9CA3AF;
    font-family: 'Consolas', 'Courier New', monospace;
}

/* Tile variants */
.dash-tile-healthy { border-left: 4px solid #22C55E; }
.dash-tile-warning { border-left: 4px solid #F59E0B; }
.dash-tile-error   { border-left: 4px solid #EF4444; }
.dash-tile-info    { border-left: 4px solid var(--color-primary); }
.dash-tile-muted   { border-left: 4px solid #D1D5DB; }

/* ── DASHBOARD SECTION HEADER ────────────────────────────── */
.dash-section-header {
    font-size: 1rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.dash-section-header span {
    font-size: 1.15rem;
}

/* ── QUEUE CARD GRID ─────────────────────────────────────── */
.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: .85rem;
    margin-bottom: 1.5rem;
}

.queue-card {
    background: var(--color-white);
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    transition: box-shadow .2s, border-color .2s;
}

.queue-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border-color: var(--color-primary);
}

.queue-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.queue-card-name {
    font-size: .85rem;
    font-weight: 700;
    color: #1F2937;
    font-family: 'Consolas', 'Courier New', monospace;
}

.queue-card-count {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-primary);
}

.queue-card-count.has-messages { color: #F59E0B; }
.queue-card-count.has-error    { color: #EF4444; }

.queue-card-status {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 999px;
}

.queue-status-active { background: #D1FAE5; color: #065F46; }
.queue-status-error  { background: #FEE2E2; color: #991B1B; }
.queue-status-empty  { background: #F3F4F6; color: #6B7280; }

/* ── SERVICE / TABLE LIST ────────────────────────────────── */
.dash-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .65rem;
    margin-bottom: 1.5rem;
}

.dash-list-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--color-white);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: .7rem 1rem;
    font-size: .82rem;
    transition: background .15s;
}

.dash-list-item:hover { background: #F9FAFB; }

.dash-list-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #EFF6FF;
}

.dash-list-icon.fn-icon  { background: #EFF6FF; }
.dash-list-icon.tbl-icon { background: #F0FDF4; }
.dash-list-icon.sp-icon  { background: #FEF3C7; }

.dash-list-text {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}

.dash-list-name {
    font-weight: 600;
    color: #1F2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-list-desc {
    font-size: .72rem;
    color: #9CA3AF;
}

/* ── STATUS DOT ──────────────────────────────────────────── */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green  { background: #22C55E; box-shadow: 0 0 4px rgba(34,197,94,.4); }
.dot-yellow { background: #F59E0B; box-shadow: 0 0 4px rgba(245,158,11,.4); }
.dot-red    { background: #EF4444; box-shadow: 0 0 4px rgba(239,68,68,.4); }
.dot-grey   { background: #D1D5DB; }

/* ── MESSAGE STATUS BADGES ──────────────────────────────── */
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-gray   { background: #F3F4F6; color: #6B7280; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }
.badge-orange { background: #FFEDD5; color: #9A3412; }

/* Brand mark in the top header (moved out of the sidebar to give nav the vertical space).
   Grouped with the user chip so the header keeps its 3-way space-between layout. */
.header-left  { display: flex; align-items: center; gap: 1.1rem; }
.header-brand { display: flex; align-items: center; flex-shrink: 0; }
.header-brand img { height: 34px; display: block; }

/* Per-subsystem identity badges (approvals page, global Activity, cross-subsystem grids).
   These classes were referenced before but never defined — badges fell back to unstyled. */
.badge-sys-ahoi       { background: #D1FAE5; color: #065F46; }
.badge-sys-infobip64  { background: #DBEAFE; color: #1D4ED8; }
.badge-sys-infobip27  { background: #EDE9FE; color: #5B21B6; }
.badge-sys-infobip485 { background: #FFEDD5; color: #9A3412; }

/* ── HEADER BREADCRUMB ──────────────────────────────────── */
.header-breadcrumb {
    flex: 1;
    text-align: center;
    font-size: .85rem;
    font-weight: 600;
    color: #CBD5E1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 1rem;
}

/* ── SUBSYSTEM SWITCHER (sidebar) ───────────────────────── */
.subsystem-switcher-row {
    cursor: default !important;
    gap: .5rem;
    /* The poison badge can grow to "0 · 976 poison"; wrapping keeps it off the switcher's row
       instead of squeezing the select down to its chevron (seen 2026-09-22). */
    flex-wrap: wrap;
}

.switcher-select {
    flex: 1 1 6rem;
    min-width: 6rem;
    background: rgba(255, 255, 255, .08);
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 6px;
    padding: .3rem .4rem;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}

.switcher-select:focus { outline: 2px solid var(--color-accent); }
.switcher-select option { color: #1F2937; background: #FFFFFF; }

.switcher-badge {
    background: #F59E0B;
    color: #78350F;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    padding: .12rem .45rem;
    min-width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.switcher-badge-zero {
    background: rgba(255, 255, 255, .15);
    color: #D1D5DB;
}

/* Phase 4c: any *-poison depth > 0 turns the badge red; the text carries "· N poison" so colour is never the only signal.
   It sits on its own row under the switcher (order + full basis) because the count can reach four digits and the
   switcher must stay usable. */
.switcher-badge-poison {
    background: #DC2626;
    color: #FEF2F2;
    white-space: nowrap;
    order: 3;
    flex: 0 0 100%;
    text-align: left;
    padding: .18rem .5rem;
    margin-top: -.15rem;
}

/* ── PAGINATION BAR ─────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid #E5E7EB;
}

/* ── CLICKABLE DASHBOARD TABLE TILES ────────────────────── */
.dash-list-item-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    transition: background .15s, transform .1s;
    cursor: pointer;
}

.dash-list-item-link:hover {
    background: #F0F9FF;
    transform: translateX(2px);
}

.dash-list-item-link .dash-list-count {
    margin-left: auto;
    font-size: .82rem;
    font-weight: 600;
    color: var(--color-primary);
    background: #EFF6FF;
    padding: .15rem .5rem;
    border-radius: 999px;
    white-space: nowrap;
}

/* ── Shared table and validation styles ── */
.page-header {
    margin-bottom: 1.25rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
}

.search-bar-container {
    margin-bottom: 1.25rem;
}

.search-group {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    min-width: 260px;
}

.results-summary {
    font-size: .85rem;
    color: var(--color-muted);
    margin-bottom: .6rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--color-muted);
}

.table-container {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

    .data-table thead th {
        background: var(--color-primary);
        padding: .65rem .85rem;
        text-align: left;
        font-weight: 600;
        border-bottom: 2px solid var(--color-border);
        white-space: nowrap;
    }

    .data-table tbody tr:nth-child(even) {
        background: var(--color-surface-alt, #f9fafb);
    }

    .data-table tbody tr:hover {
        background: var(--color-hover, #f1f5f9);
    }

    .data-table tbody td {
        padding: .6rem .85rem;
        border-bottom: 1px solid var(--color-border);
        vertical-align: top;
    }

.phone-cell {
    white-space: nowrap;
    font-family: monospace;
}

.api-response-cell {
    max-width: 340px;
    word-break: break-word;
    font-size: .8rem;
    color: var(--color-muted);
}

.badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-neutral {
    background: #f3f4f6;
    color: #6b7280;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── JSON VIEWER ──────────────────────────────────────── */
.json-viewer {
    background: #1E293B;
    color: #E2E8F0;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: .8rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* ── ICON BUTTONS (table row actions) ───────────────────── */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    border: 1px solid #D1D5DB;
    background: #ffffff;
    color: #374151;
    font-size: .95rem;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
    padding: 0;
    flex-shrink: 0;
    margin-right: .25rem;
}

    .btn-icon:hover {
        background: #EFF6FF;
        border-color: var(--color-primary);
        transform: translateY(-1px);
    }

    .btn-icon:active {
        transform: translateY(0);
    }

    .btn-icon:disabled {
        opacity: .45;
        cursor: not-allowed;
        transform: none;
    }

.btn-icon-accent:hover {
    background: #FFF7ED;
    border-color: var(--color-accent);
}
/* ════════════════════════════════════════════════════════════════════════════
   LEAD REQUESTS REPORT (/lead-requests) + shared lead-request detail panel
   ════════════════════════════════════════════════════════════════════════════ */

/* .btn-link was used across several pages without ever being defined, so those
   cells rendered as raw browser buttons. */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-link:hover { text-decoration: underline; color: #2F6E92; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.lr-scope {
    margin-top: .2rem;
    font-size: .8rem;
    color: #6B7280;
}

.lr-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.lr-search {
    position: relative;
    display: flex;
    align-items: center;
}

.lr-search .form-input {
    width: 268px;
    padding-left: 2rem;
    padding-right: 1.9rem;
}

.lr-search-icon {
    position: absolute;
    left: .6rem;
    font-size: .78rem;
    opacity: .55;
    pointer-events: none;
}

.lr-search-clear {
    position: absolute;
    right: .45rem;
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: .75rem;
    cursor: pointer;
    padding: .15rem .25rem;
    border-radius: 4px;
}

.lr-search-clear:hover { background: #FEE2E2; color: #DC2626; }

.lr-notice {
    margin: .25rem 0 .75rem;
    padding: .55rem .85rem;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    font-size: .8rem;
    color: #92400E;
}

.lr-notice code {
    font-family: 'Consolas', monospace;
    font-size: .76rem;
    background: #FEF3C7;
    padding: .05rem .3rem;
    border-radius: 4px;
}

/* ── Outcome breakdown strip ─────────────────────────────────────────────── */
.lr-stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: .6rem;
    margin: .25rem 0 1rem;
}

.lr-stat {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    align-items: flex-start;
    padding: .6rem .8rem;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-left: 3px solid #D1D5DB;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, box-shadow .15s, transform .1s;
}

.lr-stat:hover { box-shadow: 0 4px 12px rgba(0,0,0,.07); transform: translateY(-1px); }

.lr-stat.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(74,144,184,.18);
}

.lr-stat-static { cursor: default; }
.lr-stat-static:hover { box-shadow: none; transform: none; }

.lr-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.lr-stat-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6B7280;
}

.lr-stat.tile-all   { border-left-color: var(--color-primary); }
.lr-stat.tile-good  { border-left-color: #22C55E; }
.lr-stat.tile-warn  { border-left-color: #F59E0B; }
.lr-stat.tile-bad   { border-left-color: #EF4444; }
.lr-stat.tile-muted { border-left-color: #D1D5DB; }

/* ── Grid ────────────────────────────────────────────────────────────────── */
.lr-table-wrap {
    max-height: calc(100vh - 430px);
    min-height: 220px;
    overflow: auto;
}

.lr-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.lr-table tbody tr.lr-row { cursor: pointer; }
.lr-table tbody tr.lr-row:hover td { background: #F0F9FF; }
.lr-table tbody tr.lr-row.is-open td { background: #E0F2FE; }

.lr-table td { font-size: .82rem; }
.lr-nowrap   { white-space: nowrap; }
.lr-num      { text-align: right; }
.lr-dim      { color: #9CA3AF; }

.lr-ellipsis {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lr-row-chevron {
    color: #CBD5E1;
    font-size: 1.1rem;
    text-align: right;
    width: 1.5rem;
}

.lr-row:hover .lr-row-chevron { color: var(--color-primary); }

.lr-check-ok {
    display: inline-block;
    color: #16A34A;
    font-weight: 700;
}

.lr-check-fail {
    display: inline-block;
    margin-right: .25rem;
    padding: .1rem .4rem;
    border-radius: 999px;
    background: #FEE2E2;
    color: #991B1B;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .03em;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.lr-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .9rem;
    flex-wrap: wrap;
}

.lr-page-size { display: flex; align-items: center; gap: .45rem; }
.lr-page-nav  { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }

.lr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 2.5rem 1rem;
    color: #6B7280;
}

.lr-empty-title { font-size: .95rem; font-weight: 600; color: #374151; }

/* ── Detail dialog ───────────────────────────────────────────────────────── */
.modal-dialog-xl { width: min(1240px, 96vw); --modal-max-height: 92vh; max-height: var(--modal-max-height); }

/* A validation-result modal opened from inside the detail dialog. */
.modal-backdrop-stacked { z-index: 320; }
.modal-dialog-stacked   { z-index: 321; }

.lr-dialog-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.lr-dialog-title .lr-dim { font-weight: 400; font-size: .8rem; }

.lr-dialog-nav-hint { margin-right: auto; }

/* ── Shared detail panel ─────────────────────────────────────────────────── */
.lr-detail {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.lr-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.lr-section {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding-top: 1rem;
    border-top: 1px solid #E5E7EB;
}

.lr-section-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .95rem;
    font-weight: 700;
    color: #1F2937;
}

.lr-section-sub  { font-weight: 400; font-size: .85rem; color: #6B7280; }
.lr-section-action { margin-left: auto; font-size: .8rem; }

.lr-raw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.lr-raw-grid > div { min-width: 0; display: flex; flex-direction: column; gap: .5rem; }

.lr-subsystems { display: flex; flex-direction: column; gap: .5rem; }

.lr-copy-cell,
.lr-check-cell {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    justify-content: flex-end;
}

.lr-copy {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: .8rem;
    line-height: 1;
    padding: .1rem .2rem;
    border-radius: 4px;
}

.lr-copy:hover { background: #EFF6FF; color: var(--color-primary); }

.lr-inline-btn {
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 5px;
    color: #374151;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 600;
    padding: .15rem .45rem;
}

.lr-inline-btn:hover { background: #EFF6FF; border-color: var(--color-primary); color: var(--color-primary); }

@media (max-width: 1100px) {
    .lr-raw-grid { grid-template-columns: 1fr; }
    .lr-search .form-input { width: 200px; }
}

/* ── Campaign "Follow" navigation (OmniCore campaign → subsystem run panel) ── */

.follow-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    border-radius: 999px;
    color: #3730A3;
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .55rem;
    text-decoration: none;
    white-space: nowrap;
}

.follow-pill:hover {
    background: #E0E7FF;
    border-color: #818CF8;
    color: #312E81;
}

.follow-arrow { transition: transform .12s ease-out; }
.follow-pill:hover .follow-arrow { transform: translateX(2px); }

/* Banner shown on a subsystem run list that was opened via Follow */
.run-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    border-radius: 8px;
    color: #3730A3;
    font-size: .82rem;
    margin-bottom: 1rem;
    padding: .55rem .9rem;
}

/* The rows that matched the followed campaign */
.run-row-followed > td { background: #F5F3FF; }
.run-row-followed > td:first-child { box-shadow: inset 3px 0 0 #818CF8; }


.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .75rem;
    flex-wrap: wrap;
    gap: .5rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.page-btn {
    min-width: 2rem;
    padding: .25rem .5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    cursor: pointer;
}

    .page-btn:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

.page-btn-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

.page-ellipsis {
    padding: 0 .25rem;
}

.page-size-select {
    width: auto;
    margin-left: .5rem;
}

/* ── TWO-FACTOR AUTHENTICATION ─────────────────────────── */
.field-error {
    font-size: .78rem;
    font-weight: 600;
    color: #BE123C;
}

/* One-time codes and recovery codes are read off a screen and typed digit by digit. */
.otp-input {
    font-family: 'Consolas', monospace;
    font-size: 1.1rem;
    letter-spacing: .35em;
    text-align: center;
}

.enroll-grid {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 640px) {
    .enroll-grid { grid-template-columns: 1fr; }
}

.enroll-step {
    font-size: .82rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: .5rem;
}

.enroll-step-second { margin-top: 1.5rem; }
.enroll-note   { margin-bottom: .45rem; }
.enroll-submit { margin-top: 1rem; }

.enroll-qr {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: .5rem;
    background: #FFFFFF;
}

.enroll-qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.enroll-key {
    display: block;
    font-family: 'Consolas', monospace;
    font-size: .9rem;
    letter-spacing: .08em;
    color: #1F2937;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: .55rem .75rem;
    word-break: break-all;
}

/* Blazor's FocusOnNavigate focuses the page heading after every navigation, which made the browser
   draw its default ring around every title. Headings carry tabindex="-1" purely so that focus call
   can land, so they are never keyboard-tabbable — suppressing the ring here costs no affordance,
   and real interactive controls keep theirs. */
h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus { outline: none; }

/* ── ACCOUNT MANAGEMENT (/Account/Manage/*) ────────────── */
/* Buttons are anchors as often as they are <button>; without this they keep the link underline. */
a.btn { text-decoration: none; }

.manage-shell { max-width: 900px; }

.manage-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 1.5rem;
}

.manage-tab {
    padding: .55rem .9rem;
    font-size: .85rem;
    font-weight: 600;
    color: #6B7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}

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

.manage-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.manage-section { margin-bottom: 2rem; }
.manage-section:last-child { margin-bottom: 0; }

.manage-section-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .5rem;
}

.manage-h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 .5rem;
}

.manage-section-head .manage-h2 { margin-bottom: 0; }

.manage-hint {
    font-size: .85rem;
    color: #6B7280;
    margin: 0 0 .9rem;
    max-width: 62ch;
    line-height: 1.5;
}

.manage-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.manage-status { margin-bottom: 1.25rem; }

.manage-warn {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    padding: .65rem 1rem;
    font-size: .82rem;
    color: #92400E;
    line-height: 1.5;
    margin-bottom: .9rem;
}

.manage-warn a { color: #92400E; font-weight: 600; }

.manage-pill {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-radius: 999px;
    padding: .2rem .55rem;
    white-space: nowrap;
}

.manage-pill-on   { background: #DCFCE7; color: #15803D; }
.manage-pill-off  { background: #F3F4F6; color: #6B7280; }
.manage-pill-warn { background: #FEF3C7; color: #92400E; }

.recovery-code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .5rem;
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.recovery-code {
    display: block;
    font-family: 'Consolas', monospace;
    font-size: .9rem;
    letter-spacing: .06em;
    color: #1F2937;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: .45rem .6rem;
    text-align: center;
}

/* Bootstrap is not loaded in this app. The remaining scaffolded Identity pages still carry its
   class names, so map the handful they use onto the admin's own styles — scoped to the account
   area so nothing leaks into the rest of the app. */
.manage-shell .row { display: flex; flex-wrap: wrap; gap: 1rem; }
.manage-shell [class*="col-"] { flex: 1 1 100%; min-width: 0; }
.manage-shell .mb-3 { margin-bottom: 1rem; }
.manage-shell .w-100 { width: 100%; }
.manage-shell .btn-lg { padding: .6rem 1.1rem; font-size: .95rem; }

.manage-shell h3 { font-size: 1.05rem; font-weight: 700; color: #1F2937; margin-bottom: .75rem; }
.manage-shell h4 { font-size: .95rem; font-weight: 700; color: #1F2937; margin: 1.25rem 0 .5rem; }
.manage-shell hr { border: none; border-top: 1px solid #E5E7EB; margin: 1rem 0; }
.manage-shell p  { font-size: .85rem; color: #4B5563; line-height: 1.55; margin-bottom: .75rem; }

/* The scaffold puts the label after the input, so reversing the column puts it back on top. */
.manage-shell .form-floating {
    display: flex;
    flex-direction: column-reverse;
    gap: .4rem;
}

.manage-shell .form-control {
    width: 100%;
    padding: .45rem .75rem;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: .875rem;
    color: #374151;
    background: var(--color-white);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.manage-shell .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74,144,184,0.15);
}

.manage-shell .form-label,
.manage-shell .control-label {
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
}

.manage-shell .text-danger { font-size: .78rem; font-weight: 600; color: #BE123C; }
.manage-shell .text-danger:empty { display: none; }

.manage-shell .alert {
    border-radius: 8px;
    padding: .65rem 1rem;
    font-size: .82rem;
    line-height: 1.5;
    margin-bottom: .9rem;
}

.manage-shell .alert p:last-child { margin-bottom: 0; }
.manage-shell .alert-danger  { background: #FFF1F2; border: 1px solid #FECDD3; color: #BE123C; }
.manage-shell .alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.manage-shell .alert-info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1D4ED8; }
.manage-shell .alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #15803D; }
/* Live indicator for the Dashboard's "Running now" band — a slow pulse so an
   in-flight campaign reads as moving even between 5 s polls. Honours reduced
   motion: the dot stays solid rather than pulsing. */
.live-dot {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: #DC2626;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, .55);
    animation: live-pulse 2s ease-out infinite;
}

@keyframes live-pulse {
    70%  { box-shadow: 0 0 0 .5rem rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot { animation: none; }
}

/* ── Status legend strip (StatusLegend.razor) ──────────────────────────────
   Entries reuse the .badge shape; the three extra badge classes copy hex pairs
   the presenter already emits (Draft #4B5563 passes AA on #F3F4F6, the stock
   .badge-gray #6B7280 does not; Deferred = follow-pill indigo; Cancelled = the
   presenter's grey/red). No new colours. */
.status-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .45rem;
    font-size: .75rem;
    color: #4B5563;
    margin: .25rem 0 .75rem;
}
.status-legend-caption { font-weight: 600; margin-right: .15rem; }
.status-legend-item    { gap: .3rem; }
.status-legend-glyph   { font-size: .8rem; line-height: 1; }
.badge-draft     { background: #F3F4F6; color: #4B5563; }
.badge-indigo    { background: #E0E7FF; color: #3730A3; }
.badge-cancelled { background: #F3F4F6; color: #991B1B; }

/* ── Toast host (Toast.razor, rendered once in MainLayout) ────────────────── */
.toast-host {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 340;               /* above stacked modals (321) so a result is never hidden */
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: min(26rem, calc(100vw - 2.5rem));
    pointer-events: none;       /* clicks fall through the empty column */
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .65rem .8rem;
    border-radius: 8px;
    border: 1px solid;
    box-shadow: 0 8px 24px rgba(17, 24, 39, .18);
    font-size: .85rem;
    line-height: 1.35;
    background: #EFF6FF; border-color: #BFDBFE; color: #1E3A8A;   /* info */
}
.toast-success { background: #F0FDF4; border-color: #BBF7D0; color: #14532D; }
.toast-warning { background: #FFFBEB; border-color: #FDE68A; color: #78350F; }
.toast-error   { background: #FFF1F2; border-color: #FECDD3; color: #881337; }
.toast-glyph   { font-weight: 700; flex: 0 0 auto; }
.toast-body    { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.toast-kind    { font-weight: 700; margin-right: .25rem; }
.toast-link    { margin-left: .4rem; font-weight: 600; color: inherit; text-decoration: underline; white-space: nowrap; }
.toast-close {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .1rem;
    opacity: .7;
}
.toast-close:hover, .toast-close:focus-visible { opacity: 1; outline: 2px solid currentColor; outline-offset: 1px; border-radius: 3px; }

/* ── Sidebar: collapsed "Engineering" sub-group inside the subsystem menu ─── */
.nav-subgroup-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .5rem .9rem .5rem 1.2rem;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    color: var(--color-sidebar-text);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
}
.nav-subgroup-toggle:hover,
.nav-subgroup-toggle.has-active { background: #1F2937; color: var(--color-white); }
.section-sub-menu a.nav-subgroup-item { padding-left: 2rem; }

/* ── Dashboard "Running now" band: finished rows kept for 30 min ──────────── */
tr.run-finished td { color: #6B7280; }
.run-finished-note { font-size: .78rem; color: #6B7280; white-space: nowrap; }

/* ── Campaign UX overhaul, Phase 0+1 (2026-09-21): launcher, sticky action bar, confirm sheet ─ */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Launcher refresh sentence (the ONLY aria-live region on /campaigns) and the Needs-you strip */
.cg-refresh-status { font-size: .78rem; color: #6B7280; margin: .25rem 0 .75rem; }
.needs-you {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    padding: .6rem .9rem;
    margin-bottom: 1rem;
}
.needs-you-title { font-size: .72rem; font-weight: 700; color: #92400E; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .4rem; }
.needs-you-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    background: #FEF9C3;
    border-radius: 6px;
    padding: .35rem .65rem;
    font-size: .8rem;
    color: #78350F;
    margin-bottom: .3rem;
}
.needs-you-row:last-child { margin-bottom: 0; }
.needs-you-row a { font-weight: 600; color: #1D4ED8; white-space: nowrap; }
.needs-you-kind { font-weight: 700; margin-right: .35rem; }

/* Status chip sub-text and the cancel caption under it */
.cg-status-sub {
    display: block;
    max-width: 220px;
    font-size: .68rem;
    color: #6B7280;
    margin-top: .15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cg-cancel-caption { display: block; font-size: .68rem; color: #9A3412; margin-top: .15rem; white-space: nowrap; }
.cg-unavailable { background: #F3F4F6; color: #4B5563; padding: .15rem .45rem; border-radius: 999px; font-size: .68rem; font-weight: 600; margin-left: .3rem; white-space: nowrap; }

/* Test column in words */
.cg-test-words { font-size: .75rem; white-space: nowrap; }
.cg-test-pending  { color: #92400E; }
.cg-test-approved { color: #065F46; }
.cg-test-reset    { color: #92400E; }
.cg-test-rejected { color: #991B1B; }
.cg-test-none     { color: #9CA3AF; }

/* Text row buttons (replace .btn-icon on the launcher) */
.cg-row-actions { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.cg-row-actions .btn { padding: .25rem .55rem; font-size: .72rem; white-space: nowrap; }
.cg-row-actions .btn:disabled { opacity: .55; cursor: not-allowed; }
.cg-row-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* Sticky action bar at the top of .modal-body (the modal body is the scroll container) */
.cab {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: -1.25rem -1.25rem 0;
    padding: .65rem 1.25rem .6rem;
    background: #F8FAFC;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: 0 4px 10px -8px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    gap: .45rem;
    /* .modal-body is a flex column: without flex-shrink:0 the sticky bar collapses to one line
       (smoke SM1). 30% of the MODAL height (plan 5.2), not of the viewport. */
    flex-shrink: 0;
    max-height: calc(var(--modal-max-height, 88vh) * 0.3);
    overflow: auto;
}
.cab-steps {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: .72rem;
    font-weight: 700;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.cab-step { display: flex; align-items: center; gap: .35rem; }
.cab-step-n {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.2rem; height: 1.2rem; border-radius: 999px;
    background: #E5E7EB; color: #374151; font-size: .68rem;
}
.cab-step-done { color: #065F46; }
.cab-step-done .cab-step-n { background: #D1FAE5; color: #065F46; }
.cab-step-state { font-weight: 500; text-transform: none; letter-spacing: 0; color: #9CA3AF; }
.cab-step-done .cab-step-state { color: #065F46; }
.cab-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.cab-buttons .btn:disabled { opacity: .55; cursor: not-allowed; }
.cab-provider { display: inline-flex; gap: .6rem; border: 0; padding: 0 .25rem; margin: 0; font-size: .75rem; color: #4B5563; }
.cab-provider:disabled { opacity: .55; }
.cab-radio { display: inline-flex; align-items: center; gap: .25rem; cursor: pointer; }
.cab-radio-live { color: #991B1B; font-weight: 600; }
.cab-reject { color: #991B1B; border-color: #FCA5A5; }
.cab-sentences { font-size: .78rem; color: #374151; line-height: 1.45; }
.cab-status { color: #1F2937; }
.cab-next { color: #4B5563; }
.cab-warning { color: #92400E; font-weight: 600; margin-top: .15rem; }
.cab-advisory { color: #6B7280; font-size: .72rem; margin-top: .15rem; }
.cab-link { color: #1D4ED8; font-weight: 600; text-decoration: none; border-bottom: 1px dotted #93C5FD; }
.cab-notice { margin: 0; font-size: .78rem; }
@media (max-height: 700px) {
    .cab-next { display: none; }   /* the "Next:" sentence collapses first on short viewports */
}

/* Lock glyph on approval-bound fields once a test is approved; "resets the approval" line */
.field-lock { font-size: .75rem; margin-left: .3rem; cursor: help; }
.approval-reset-line { font-size: .75rem; color: #92400E; font-weight: 600; margin-top: .25rem; }

/* Enqueue confirm sheet (stacked above the editor) */
.enqueue-backdrop { z-index: 320; }
.enqueue-sheet { z-index: 321; width: min(560px, 94vw); }
.enqueue-recap { display: grid; grid-template-columns: 7rem 1fr; gap: .4rem .75rem; margin: 0; font-size: .82rem; }
.enqueue-recap dt { font-weight: 700; color: #6B7280; text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; padding-top: .15rem; }
.enqueue-recap dd { margin: 0; color: #1F2937; }
.enqueue-ok  { color: #065F46; }
.enqueue-bad { color: #991B1B; font-weight: 600; }
.enqueue-note { color: #B45309; }
.enqueue-check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: #374151; cursor: pointer; }
.enqueue-ack { color: #991B1B; font-weight: 600; }

/* "Queued!" panel shown inside the editor after a successful enqueue */
.queued-panel {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
    padding: .75rem 1rem;
    color: #14532D;
    font-size: .85rem;
}
.queued-panel-title { font-weight: 700; font-size: 1rem; margin: 0 0 .35rem; }
.queued-panel-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.queued-panel-links a.btn { text-decoration: none; }

/* ── Campaign Hub (/campaigns/{id}, plan 2026-09-17 sections 5.3–5.6; Phase 2) ── */
.hub-title { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.hub-id { font-size: .85rem; color: #6B7280; font-weight: 500; }
.hub-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .35rem; font-size: .8rem; }
.hub-status-chip { padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.hub-guid { font-size: .78rem; user-select: all; }
.hub-guid-full { font-size: .78rem; user-select: all; word-break: break-all; }
.hub-header-actions { display: flex; align-items: center; gap: .5rem; }

/* The bar sits in the page flow (no modal negative margins) and sticks to the viewport top. */
.hub-bar { position: sticky; top: 0; z-index: 5; margin: 0 0 .75rem; }
.hub-bar .cab { margin: 0; border: 1px solid #E5E7EB; border-radius: 8px; max-height: none; overflow: visible; }
.hub-secondary { display: flex; flex-wrap: wrap; gap: .35rem; padding: .45rem .25rem 0; }
.hub-secondary .btn { font-size: .72rem; padding: .25rem .55rem; text-decoration: none; }
.hub-secondary .btn:disabled { opacity: .55; cursor: not-allowed; }
.hub-status-sentence { margin: .35rem .25rem 0; }
.hub-warnings { font-size: .78rem; color: #92400E; margin: 0 0 .75rem; }
.hub-warnings summary { cursor: pointer; }
.hub-warnings ul { margin: .25rem 0 0 1rem; }

.hub-tabs { display: flex; gap: .25rem; border-bottom: 2px solid #E5E7EB; margin: .25rem 0 1rem; flex-wrap: wrap; }
.hub-tab {
    padding: .45rem .9rem; font-size: .85rem; font-weight: 600; color: #4B5563; text-decoration: none;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.hub-tab:hover { color: #1F2937; }
.hub-tab-active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.hub-section { margin-top: 1rem; }
.hub-after { margin-top: .5rem; }
.hub-notice { color: #4B5563; }
.hub-notice-amber { color: #92400E; }
.hub-metrics { font-size: .72rem; margin-top: .25rem; }
.hub-window-note { margin-top: .4rem; font-size: .8rem; }
.hub-approval-note { margin-top: .5rem; }
.hub-setup-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.hub-setup-head a.btn { text-decoration: none; }

/* Live tab */
.hub-provider-banner { padding: .55rem .8rem; border-radius: 8px; font-weight: 700; font-size: .85rem; margin-bottom: 1rem; }
.hub-progress-caption { font-size: .95rem; font-weight: 700; color: #1F2937; margin-bottom: .5rem; }
.hub-progress-bar { display: flex; gap: 3px; height: 22px; border-radius: 6px; overflow: hidden; margin: .35rem 0 .5rem; }
.hub-seg { flex: 1 1 0; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #1F2937; background: #E5E7EB; }
.hub-seg-final     { background: #10B981; color: #FFFFFF; }
.hub-seg-live      { background: #3B82F6; color: #FFFFFF; animation: hub-pulse 1.6s ease-in-out infinite; }
.hub-seg-unknown   { background: #93C5FD; }
.hub-seg-waiting   { background: #F3F4F6; color: #6B7280; border: 1px dashed #D1D5DB; }
.hub-seg-cancelled { background: #F59E0B; color: #1F2937; }
.hub-seg-attention { background: #EF4444; color: #FFFFFF; }
@keyframes hub-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
.hub-progress-lines { margin: 0 0 .4rem 1rem; padding: 0; font-size: .8rem; color: #374151; }
.hub-progress-meta { font-size: .75rem; }
.hub-chunk-table .hub-source { font-size: .7rem; color: #6B7280; margin-left: .35rem; }
.hub-chunk-label { font-size: .72rem; color: #6B7280; }
.hub-chunk-row-live td { background: #EFF6FF; }
.hub-chunk-row-waiting td { color: #6B7280; }

.hub-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.hub-tile { background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 8px; padding: .5rem .65rem; display: flex; flex-direction: column; gap: .1rem; }
.hub-tile-label { font-size: .68rem; font-weight: 700; color: #6B7280; text-transform: uppercase; letter-spacing: .05em; }
.hub-tile-value { font-size: 1.15rem; color: #1F2937; }
.hub-tile-rate { font-size: .72rem; color: #4B5563; }
.hub-tile-source { font-size: .72rem; margin-top: .4rem; }

.hub-advanced summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: #374151; }
.hub-advanced-body { margin-top: .6rem; }
.hub-advanced-links { display: flex; flex-wrap: wrap; gap: .35rem; }
.hub-advanced-links .btn { text-decoration: none; }
.hub-run-select { max-width: 520px; }
.hub-history { margin: 0; padding-left: 1rem; font-size: .78rem; }

/* Test tab */
.hub-test-head { font-size: .85rem; margin-bottom: .75rem; }
.hub-test-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .75rem; }
@media (max-width: 900px) { .hub-test-grid { grid-template-columns: 1fr; } }
.hub-open-message { margin-left: .5rem; font-weight: 600; color: #1D4ED8; text-decoration: none; }
.hub-live-line { margin: .25rem 0 .5rem; }
.hub-skipped { font-size: .8rem; color: #4B5563; margin-top: .75rem; }
.hub-skipped-title { font-weight: 700; }
.hub-skipped ul { margin: .25rem 0 0 1rem; }
.hub-sender-rule { margin-top: .75rem; }
.hub-previous-tests { margin-top: .75rem; }
.hub-previous-tests summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: #374151; }
.hub-previous-table { margin-top: .5rem; font-size: .8rem; }
.hub-previous-table .status-text { display: block; }
.hub-csv-link { text-decoration: none; }

/* Messages tab */
.hub-messages-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.hub-control { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; }
.hub-phone-find input { width: 11rem; }
.hub-chips-row { display: flex; gap: .4rem; flex-wrap: wrap; margin: .35rem 0 .5rem; }
.hub-filter-detail { font-size: .72rem; }
.hub-inside { margin-top: 1rem; border-top: 1px solid #E5E7EB; padding-top: .75rem; }
.hub-inside-title { font-size: .72rem; font-weight: 700; color: #6B7280; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .4rem; }
.hub-inside-links { display: flex; flex-wrap: wrap; gap: .35rem; }
.hub-inside-links .btn { text-decoration: none; }
.hub-inside-note { font-size: .65rem; color: #6B7280; font-weight: 500; margin-left: .25rem; }
.hub-inside-caption { margin-top: .4rem; }

/* ── Campaign UX overhaul, Phase 3 (2026-09-21): Live tab funnel + alerts strip, launcher lanes ── */
.hub-phase-caption { font-size: .8rem; font-weight: 500; color: #4B5563; }
.hub-funnel-caption { margin-bottom: .4rem; }
.hub-funnel-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.hub-funnel-table th, .hub-funnel-table td { padding: .3rem .5rem; border-bottom: 1px solid #F3F4F6; text-align: left; vertical-align: top; }
.hub-funnel-table thead th { font-size: .68rem; font-weight: 700; color: #6B7280; text-transform: uppercase; letter-spacing: .05em; }
.hub-funnel-table .hub-source { font-size: .7rem; color: #6B7280; }
.hub-funnel-label { font-weight: 600; color: #1F2937; }
.hub-funnel-top .hub-funnel-label { font-weight: 700; }
.hub-funnel-sub .hub-funnel-label { padding-left: 2.2rem; font-weight: 500; color: #4B5563; }
.hub-funnel-detail .hub-funnel-label { padding-left: 1.1rem; }
.hub-funnel-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hub-funnel-pct { font-variant-numeric: tabular-nums; color: #4B5563; white-space: nowrap; }
.hub-funnel-note { font-size: .72rem; color: #6B7280; }
.hub-funnel-na td, .hub-funnel-na th { color: #9CA3AF; }
.hub-funnel-highlight td, .hub-funnel-highlight th { background: #FFFBEB; }
.hub-funnel-highlight-text { display: block; font-size: .68rem; font-weight: 700; color: #92400E; }
.hub-funnel-link a { font-weight: 600; color: #1D4ED8; text-decoration: none; white-space: nowrap; }
.hub-funnel-link a.hub-funnel-link-secondary { display: block; margin-top: .15rem; font-weight: 500; font-size: .75rem; color: #4B5563; }
.hub-chips-row .btn:disabled, .hub-messages-controls .btn:disabled { opacity: .55; cursor: not-allowed; }

.hub-alerts { display: flex; flex-direction: column; gap: .3rem; }
.hub-alert { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem; font-size: .8rem; padding: .35rem .6rem; border-radius: 6px; border: 1px solid #E5E7EB; background: #FFFFFF; color: #1F2937; }
.hub-alert-glyph { display: inline-block; min-width: 1.6rem; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: .72rem; border-radius: 4px; padding: .05rem .25rem; background: #F3F4F6; }
.hub-alert-ok    { border-color: #A7F3D0; background: #F0FDF4; }
.hub-alert-ok .hub-alert-glyph    { background: #D1FAE5; color: #065F46; }
.hub-alert-info  { border-color: #BFDBFE; background: #EFF6FF; }
.hub-alert-info .hub-alert-glyph  { background: #DBEAFE; color: #1E40AF; }
.hub-alert-amber { border-color: #FDE68A; background: #FFFBEB; }
.hub-alert-amber .hub-alert-glyph { background: #FEF3C7; color: #92400E; }
.hub-alert-red   { border-color: #FECACA; background: #FEF2F2; }
.hub-alert-red .hub-alert-glyph   { background: #FEE2E2; color: #991B1B; }
.hub-alert-grey  { border-color: #E5E7EB; background: #F9FAFB; color: #4B5563; }
.hub-alert-detail { color: #374151; }
.hub-alert-link { font-weight: 600; color: #1D4ED8; text-decoration: none; white-space: nowrap; }

/* Launcher lanes (RunningNowBand) */
.rnb { border: 1px solid #E5E7EB; border-radius: 10px; padding: .75rem .9rem; margin: 0 0 1rem; background: #FFFFFF; }
.rnb-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.rnb-status { font-size: .78rem; color: #6B7280; margin: 0; }
.rnb-lane { border-top: 1px solid #F3F4F6; padding: .55rem 0 .35rem; }
.rnb-lane-title { font-size: .72rem; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .4rem; display: flex; align-items: baseline; gap: .5rem; }
.rnb-lane-sub { font-weight: 500; text-transform: none; letter-spacing: 0; color: #9CA3AF; font-size: .7rem; }
.rnb-lane-running { border-top: 0; }
.rnb-empty { font-size: .78rem; color: #9CA3AF; margin: 0 0 .3rem; }
.rnb-row { border: 1px solid #E5E7EB; border-radius: 8px; padding: .45rem .65rem; margin-bottom: .35rem; background: #FAFAFA; font-size: .8rem; }
.rnb-row:last-child { margin-bottom: 0; }
.rnb-row-attention { border-color: #FCA5A5; background: #FFF7F7; }
.rnb-row-grey { color: #6B7280; background: #F9FAFB; border-style: dashed; }
.rnb-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.rnb-name { font-weight: 700; color: #1F2937; text-decoration: none; border-bottom: 1px dotted #93C5FD; }
.rnb-id { font-weight: 500; color: #6B7280; }
.rnb-sub { background: #F3F4F6; color: #374151; border-radius: 4px; }
.rnb-stamp { margin-left: auto; font-size: .72rem; color: #6B7280; white-space: nowrap; }
.rnb-health { font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; background: #F3F4F6; color: #374151; }
.rnb-health-ok    { background: #D1FAE5; color: #065F46; }
.rnb-health-info  { background: #DBEAFE; color: #1E40AF; }
.rnb-health-amber { background: #FEF3C7; color: #92400E; }
.rnb-health-red   { background: #FEE2E2; color: #991B1B; }
.rnb-health-grey  { background: #F3F4F6; color: #4B5563; }
.rnb-sentence { margin-top: .25rem; color: #1F2937; }
.rnb-counts { margin-top: .15rem; font-variant-numeric: tabular-nums; color: #374151; }
.rnb-note { margin-top: .1rem; font-size: .7rem; color: #6B7280; }
.rnb-alert { margin-top: .2rem; font-size: .76rem; padding: .2rem .45rem; border-radius: 4px; }
.rnb-alert a { margin-left: .35rem; font-weight: 600; color: #1D4ED8; text-decoration: none; }
.rnb-glyph { display: inline-block; min-width: 1.4rem; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: .72rem; }
.rnb-row-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.rnb-row-actions .btn { text-decoration: none; font-size: .72rem; padding: .25rem .55rem; }
.rnb-row-actions .btn:disabled { opacity: .55; cursor: not-allowed; }
.rnb-cancel { color: #DC2626; border-color: #FCA5A5; }
.rnb-row-needs { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rnb-row-needs.rnb-health-amber { background: #FFFBEB; border-color: #FDE68A; color: #78350F; }
.rnb-row-needs.rnb-health-red   { background: #FEF2F2; border-color: #FECACA; color: #7F1D1D; }
.rnb-row-needs.rnb-health-info, .rnb-row-needs.rnb-health-grey, .rnb-row-needs.rnb-health-ok { background: #F9FAFB; }
.rnb-needs-text { flex: 1 1 auto; }
.rnb-needs-link { font-weight: 600; color: #1D4ED8; text-decoration: none; white-space: nowrap; }
.rnb-row-finished { background: #F8FFFA; }

/* Phase 4c: the compact strip on / (one line per row) and the filtered copy on /{sub}/dashboard */
.rnb-compact { padding: .55rem .75rem; }
.rnb-compact .rnb-lane { padding: .35rem 0 .2rem; }
.rnb-compact .rnb-lane-needs { border-top: 0; padding-top: .1rem; }
.rnb-row-compact { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .3rem .55rem; margin-bottom: .25rem; }
.rnb-compact-text { flex: 1 1 12rem; min-width: 0; color: #374151; font-variant-numeric: tabular-nums; }
.rnb-row-compact .rnb-needs-link { margin-left: auto; }
.rnb-row-compact.rnb-row-needs .rnb-needs-text { flex: 1 1 auto; }

/* ── Phase 4a: scoped raw pages, run scope bar, "Following" chip, hub Messages views ── */

/* Header chip: what the current URL is scoped to (?run= / ?campaign=), with an "x" to the unscoped route */
.follow-chip {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    margin-left: .6rem;
    vertical-align: middle;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}
.follow-chip-link { color: #3730A3; text-decoration: none; padding: .15rem .3rem .15rem .55rem; }
.follow-chip-link:hover { color: #312E81; text-decoration: underline; }
.follow-chip-x { color: #6B7280; text-decoration: none; padding: .15rem .5rem .15rem .25rem; border-left: 1px solid #C7D2FE; }
.follow-chip-x:hover { color: #991B1B; background: #E0E7FF; border-radius: 0 999px 999px 0; }

/* The run scope bar (RunScopeBar) reuses .run-filter-bar; these only size its inner pieces */
.run-scope-main { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.run-scope-headline { font-weight: 600; }
.run-scope-unavailable { color: #92400E; font-weight: 600; }

/* Global twin of OutboundMessagesView's scoped .om-filter-bar for the shared DN / UR views */
.raw-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .25rem 0 1rem; }
.raw-filter-input { width: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.raw-filter-error { font-size: .8rem; color: var(--color-danger, #b91c1c); }

/* Reporting: the followed campaign's row (?campaign=) */
.report-row-highlight > th, .report-row-highlight > td { background: #F5F3FF; }
.report-row-highlight > th:first-child { box-shadow: inset 3px 0 0 #818CF8; }

/* Hub Messages tab: Recipients / Replies / STOP sub-view tabs, chips as links, paging strip */
.hub-view-tabs { display: flex; gap: .25rem; margin: 0 0 .6rem; flex-wrap: wrap; }
.hub-view-tab {
    padding: .3rem .75rem; font-size: .8rem; font-weight: 600; color: #4B5563; text-decoration: none;
    border: 1px solid #E5E7EB; border-radius: 999px; background: #F9FAFB;
}
.hub-view-tab:hover { color: #1F2937; background: #F3F4F6; }
.hub-view-tab-active { color: #fff; background: var(--color-primary); border-color: var(--color-primary); }
.hub-view-tab-active .hub-inside-note { color: #E0E7FF; }
.hub-chips-row .btn { text-decoration: none; }
.hub-messages-paging { margin: .25rem 0 .5rem; }
.hub-messages-paging .btn { text-decoration: none; }
.hub-reply-text { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-replies-table .status-text { display: block; font-size: .72rem; }

/* ── Phase 4b: the editor on the hub's Setup tab ─────────────────────────────────────────
   The sticky bar never exceeds 30% of the viewport on the hub (the modal rule was 30% of the
   modal); past that it scrolls inside itself, and the "Next:" sentence collapses first on
   short viewports (the existing max-height: 700px rule). The editor's own bar wrapper (.ce-bar)
   carries the host's link secondaries too, so the cap applies to the whole sticky region. */
.hub-bar { max-height: 30vh; overflow-y: auto; overflow-x: hidden; background: var(--color-white, #fff); padding-bottom: .35rem; }
.hub-bar .cab-steps { flex-wrap: wrap; row-gap: .15rem; }   /* narrow viewports: the three steps wrap instead of scrolling sideways */
.hub-bar .cab { max-height: none; overflow: visible; }
@media (max-height: 760px) {
    .hub-bar .cab-advisory { display: none; }   /* the grey advisory goes right after "Next:" */
}
