/* ===== Admin Dashboard — Full Redesign ===== */

body {
    background-color: #f4f4f4 !important;
}

/* ===== Hero Banner ===== */
.admin-wrapper {
    margin-top: 80px;
    width: 100%;
    min-height: 100vh;
    background-color: #f4f4f4;
}

.admin-hero {
    background: linear-gradient(135deg, #0d1526 0%, #1e2f52 100%);
    border-bottom: 3px solid #da1515;
    padding: 32px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    /* A hero with more buttons than fit must wrap, never run past the page
       edge (the Executive Dashboard carries ten). */
    flex-wrap: wrap;
}
.admin-hero-content { flex: 1 1 280px; min-width: 0; }
/* A hero's buttons grouped so they wrap as a block, right-aligned beside the
   title and dropping under it on narrow screens. */
.admin-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    flex: 1 1 520px;
    min-width: 0;
}

.admin-hero-content h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.85rem !important;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0 !important;
    text-align: left !important;
}

.admin-hero-content p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    margin: 0;
    font-family: Arial, sans-serif;
}

.hero-back-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 8px !important;
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.hero-back-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: none !important;
}

/* The hero's button group. Its flex rule used to exist only in
   dealershipPage.css, which the admin pages do not load — so the buttons were
   inline elements, and inline vertical padding does NOT grow the line box:
   the moment a long hero paragraph squeezed the group onto two lines, the
   second button overlapped the first (seen on Monthly Reports, 2026-08-29).
   It belongs here, next to .hero-back-btn, so every admin hero gets it. */
.hero-btn-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* ===== Main Container ===== */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 28px 48px;
}

/* ===== KPI Strip ===== */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.kpi-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 22px 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    border-top: 4px solid #1d4ed8;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.kpi-card.kpi-blue    { border-top-color: #1d4ed8; }
.kpi-card.kpi-teal    { border-top-color: #00bcd4; }
.kpi-card.kpi-green   { border-top-color: #28a745; }
.kpi-card.kpi-purple  { border-top-color: #6f42c1; }
.kpi-card.kpi-red     { border-top-color: #da1515; }
.kpi-card.kpi-gray    { border-top-color: #6c757d; }

.kpi-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.kpi-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
}

.kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

/* ===== Section Cards ===== */
.dash-section {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    margin-bottom: 28px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.section-header {
    background: linear-gradient(135deg, #0d1526 0%, #1e2f52 100%);
    padding: 16px 24px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* h3 shares the h2 treatment: .section-header paints a navy gradient, so any
   heading left at the default dark colour is unreadable on top of it. */
.section-header h2,
.section-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem !important;
    font-weight: 600;
    color: #ffffff !important;
    margin: 0 !important;
    text-align: left !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 1.15rem;
}

/* ===== Metric Cards Grid ===== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding: 24px 24px 20px;
}

.metric-card {
    background: #f8f9fb;
    border-radius: 10px;
    padding: 15px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-left: 3px solid #e5e7eb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    border-left-color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.metric-card.accent {
    border-left-color: #1d4ed8;
    background: #f0f7ff;
}

.metric-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.1;
}

.metric-value small {
    font-size: 0.72rem;
    font-weight: 500;
    color: #6b7280;
}

/* ===== Two-Column Chart + Table Layout ===== */
.chart-table-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 20px 24px 24px;
}

.chart-col,
.table-col {
    padding: 0 20px;
}

.chart-col:first-child,
.table-col:first-child {
    padding-left: 0;
    border-right: 1px solid #eaecf0;
    padding-right: 28px;
}

.chart-col:last-child,
.table-col:last-child {
    padding-right: 0;
    padding-left: 28px;
}

.subsection-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem !important;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 14px 0 !important;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
    text-align: left !important;
}

.dash-chart {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 14px;
    display: block;
}

.full-width-chart-wrap {
    padding: 4px 24px 24px;
}

.full-width-chart-wrap .subsection-title {
    margin-bottom: 14px !important;
}

.full-width-chart-wrap .dash-chart {
    margin-top: 0;
    width: 100%;
}

/* ===== Tables ===== */
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.metrics-table th {
    background: #1e40af;
    color: #ffffff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metrics-table th:last-child,
.metrics-table td:last-child {
    text-align: right;
}

.metrics-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f0f2f5;
    color: #374151;
}

.metrics-table tbody tr:nth-child(even) td {
    background: #f8f9fb;
}

.metrics-table tbody tr:hover td {
    background: #eef4ff;
}

.metrics-table a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
}

.metrics-table a:hover {
    text-decoration: underline;
}

.dealership-table-wrapper {
    max-height: 280px;
    overflow-y: auto;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.dealership-table-wrapper .metrics-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* ===== Support Staff Launcher ===== */
.support-launcher {
    padding: 24px;
}

.support-desc {
    font-size: 0.88rem;
    color: #4b5563;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.support-desc code {
    background: #f0f2f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
    color: #374151;
}

.support-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.support-selector-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.support-select {
    flex: 1;
    min-width: 260px;
    max-width: 480px;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #1a1a2e;
    background: #fff;
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: border-color 0.2s;
}

.support-select:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

.support-go-btn {
    white-space: nowrap;
}

/* ===== Responsive Card Tables ===== */
/* Wrap any .metrics-table in this div for card-style mobile layout */
.table-cards-mobile {
    overflow-x: auto; /* desktop fallback */
}

@media (max-width: 680px) {
    .table-cards-mobile thead { display: none; }

    .table-cards-mobile .metrics-table,
    .table-cards-mobile .metrics-table tbody { display: block; }

    .table-cards-mobile .metrics-table tr {
        display: block;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        margin: 12px 16px;
        padding: 4px 0;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }

    .table-cards-mobile .metrics-table tr:nth-child(even) td { background: transparent; }
    .table-cards-mobile .metrics-table tr:hover td { background: transparent; }

    .table-cards-mobile .metrics-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 16px;
        border-bottom: 1px solid #f3f4f6;
        font-size: 0.85rem;
        white-space: normal !important;
        max-width: none !important;
        text-align: right;
    }

    .table-cards-mobile .metrics-table td:last-child { border-bottom: none; }

    /* Value content — right-align so wrapped lines stay flush right */
    .table-cards-mobile .metrics-table td > div,
    .table-cards-mobile .metrics-table td > span {
        text-align: right;
    }

    .table-cards-mobile .metrics-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.7rem;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        flex-shrink: 0;
        width: 80px;
        padding-top: 2px;
        text-align: left;
    }

    /* Action cells (no label) — right-align buttons, hide pseudo-element */
    .table-cards-mobile .metrics-table td[data-label=""] {
        justify-content: flex-end;
        gap: 6px;
        flex-wrap: wrap;
    }
    .table-cards-mobile .metrics-table td[data-label=""]::before { display: none; }

    /* Sub-content hidden from parent cell, shown in its own card row */
    .table-cards-mobile .td-card-sub { display: none; }
    .table-cards-mobile .td-mobile-card-row { display: flex; }
}

/* Desktop: mobile-only rows are hidden */
.table-cards-mobile .td-mobile-card-row { display: none; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .kpi-strip {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 820px) {
    .chart-table-row {
        grid-template-columns: 1fr;
    }

    .chart-col:first-child,
    .table-col:first-child {
        border-right: none;
        border-bottom: 1px solid #eaecf0;
        padding-right: 0;
        padding-bottom: 24px;
    }

    .chart-col:last-child,
    .table-col:last-child {
        padding-left: 0;
        padding-top: 24px;
    }
}

@media (max-width: 400px) {
    .kpi-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .kpi-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Phone band. This used to switch the hero to a column, which turned
       .admin-hero-content's 280px flex-BASIS into a forced 280px HEIGHT and
       made every band 389px tall (the thread page showed one message under
       it, 2026-10-01). It stays a wrapping row instead: title + subtitle on
       the left, the FIRST .hero-back-btn as a compact pill on the same row,
       and everything after it (extra pills, .admin-hero-actions,
       .hero-btn-group) on one row underneath. The ::before item is a
       zero-height, full-width line break that forces that split without any
       markup change on the 79 pages that carry the band. Row gap is 0 and
       the second row carries its own margin-top, so a band with nothing
       below the title row pays nothing for the break. */
    .admin-hero {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 12px 16px;
        gap: 0 10px;
    }
    .admin-hero::before {
        content: "";
        order: 1;
        flex: 0 0 100%;
        height: 0;
    }
    .admin-hero-content { flex: 1 1 0; min-width: 0; order: 0; }
    .admin-hero-content h1 {
        font-size: 1.2rem !important;
        line-height: 1.35;
        margin: 0 0 2px 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .admin-hero-content p {
        font-size: 0.85rem;
        line-height: 1.4;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .admin-hero-content .admin-hero-meta { margin-top: 0; font-size: 0.75rem; }
    .admin-hero .hero-back-btn {
        flex: 0 0 auto;
        padding: 6px 12px;
        font-size: 0.78rem;
        line-height: 1.3;
        border-radius: 999px !important;
    }
    /* The first button of the band (direct child, or first inside a
       .hero-btn-group, which is flattened into the band here) rides the
       title row; the rest drop below it. */
    .hero-btn-group { display: contents; }
    .admin-hero > .hero-back-btn:first-of-type,
    .hero-btn-group > .hero-back-btn:first-of-type { order: 0; }
    .admin-hero > .hero-back-btn:not(:first-of-type),
    .hero-btn-group > .hero-back-btn:not(:first-of-type) {
        order: 2;
        margin-top: 8px;
    }
    /* A button group (the Executive Dashboard's ten) becomes one
       horizontally scrollable row of pills bleeding to the band's edges;
       never a stack. */
    .admin-hero-actions {
        order: 2;
        flex: 0 0 calc(100% + 32px);
        box-sizing: border-box;
        margin: 8px -16px 0;
        padding: 0 16px;
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .admin-hero-actions::-webkit-scrollbar { display: none; }

    .admin-container {
        padding: 20px 16px 40px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
    }

    .chart-table-row {
        padding: 16px;
    }
}

/* Metrics grid padding variants */
.metrics-grid--pb { padding-bottom: 24px; }
.metrics-grid--full-pad { padding: 24px; }

/* Inventory / bulk upload shared utility classes */
.inv-template-wrap {
    padding: 20px 24px;
}
.inv-template-desc {
    color: #4b5563;
    font-size: 0.9rem;
    margin: 0 0 16px;
}
.inv-template-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.btn--inv-action {
    width: auto;
    padding: 10px 20px;
}
.btn--inv-secondary {
    width: auto;
    padding: 10px 20px;
    background: #6b7280;
}
.inv-upload-form-wrap {
    padding: 24px 28px;
    max-width: 560px;
}
.inv-required-tag {
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.inv-mapping-hint {
    padding: 16px 24px 0;
    color: #4b5563;
    font-size: 0.88rem;
    margin: 0;
}
.inv-form-footer {
    padding: 20px 24px;
}
.inv-form-footer-mt {
    margin-top: 8px;
}
.progress-status-text {
    color: #4b5563;
    font-size: 0.9rem;
    margin: 0;
}
.progress-status-value {
    font-weight: 600;
    color: #1e40af;
}
.table-scroll-x {
    overflow-x: auto;
}
.inv-preview-actions {
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* Sub-text within section headers (lighter weight, smaller size) */
.section-header-sub {
    font-weight: 400;
    font-size: 0.82rem;
    opacity: 0.8;
}

/* ===== Utility classes ===== */

/* Standard content padding inside a dash-section */
.section-body { padding: 20px 28px; }

/* Flex row of action buttons */
.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* Danger-zone dash-section */
.dash-section--danger { border: 1px solid #fca5a5; }
.dash-section--danger .section-header { background: #dc2626; }

/* Fix: metrics-table link rule overrides .btn white text */
.metrics-table a.btn,
.metrics-table a.btn:hover { color: #fff !important; text-decoration: none !important; }

/* Fix: metric-card and section-header btn text colour */
.metric-card .btn    { color: #fff !important; }
.section-header .btn { color: #fff !important; }

.section-header--spread { justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.btn--sm { font-size: 0.85rem !important; padding: 6px 16px !important; width: auto !important; }

/* Shared action buttons (matches listing.css action-btn) */
.action-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
}
.btn-edit   { background: #0d1526; color: #fff; }
.btn-edit:hover { background: #1e2f52; color: #fff; }
.btn-delete { background: #da1515; color: #fff; }
.btn-delete:hover { filter: brightness(.92); color: #fff; }

/* Delete confirmation page */
.delete-confirm-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 24px;
}

.delete-confirm-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
    flex-direction: column;
}

.delete-confirm-list {
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    margin: 0 0 24px;
    padding-left: 20px;
}

.delete-confirm-list li { margin-bottom: 6px; }

.delete-confirm-label {
    font-size: .95rem;
    color: #374151;
}

/* Typing the address is the confirmation step, so the field needs to read as a
   deliberate action rather than an optional extra. */
.delete-confirm-input {
    width: 100%;
    max-width: 380px;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.delete-confirm-input:focus {
    outline: none;
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, .12);
}

.delete-confirm-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* ===== Listing-ownership transfer ===== */
/* Sits directly inside .dash-section rather than .section-body, so it has to
   supply its own padding or it runs flush to the card edge. */
.dash-subsection {
    padding: 20px 24px 24px;
    border-top: 1px solid #e5e7eb;
}

.dash-subsection:first-child { border-top: none; }

.form-inline--wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 0;
}

.form-inline--wrap label {
    font-size: .95rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.form-inline--wrap select {
    padding: 9px 12px;
    font-size: .95rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #0d1526;
    max-width: 100%;
}

.form-inline--wrap select:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

/* The intro paragraph above the control — muted, and never edge-to-edge. */
.transfer-intro {
    font-size: .95rem;
    line-height: 1.6;
    color: #6b7280;
    margin: 0 0 16px;
    max-width: 70ch;
}

/* Callout for "there is nobody left to hand these to" — the dead-end case. */
.transfer-empty {
    font-size: .95rem;
    line-height: 1.6;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 16px;
    max-width: 70ch;
}

@media (max-width: 640px) {
    .form-inline--wrap { flex-direction: column; align-items: stretch; }
    .form-inline--wrap select,
    .form-inline--wrap button { width: 100%; }
}

.conv-listing-removed {
    font-size: .95rem;
    line-height: 1.6;
    color: #6b7280;
    margin: 0 0 8px;
}

/* Table btn sizing */
.metrics-table .btn { display: inline-block; width: auto !important; }
.delete-message-btn { width: auto !important; }

/* Print — hide chrome (used by bulk upload guide) */
@media print {
    nav, footer, .navbar, .hero-back-btn, .print-btn { display: none !important; }
}

/* ── Community Form (newsletter & event create/edit) ── */
.community-form {
    padding: 0 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cf-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.cf-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 200px;
}

.cf-group--grow { flex: 2; }
.cf-group--sm   { flex: 0 0 80px; min-width: 80px; }

.cf-label {
    font-size: 0.83rem;
    font-weight: 700;
    color: #374151;
}

.cf-required { color: #ef4444; margin-left: 2px; }
.cf-optional { font-weight: 400; color: #9ca3af; font-size: 0.78rem; }

.cf-input {
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #fff;
    color: #111827;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.cf-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.cf-textarea { resize: vertical; line-height: 1.5; }
.cf-textarea--tall { min-height: 180px; }

.cf-select { cursor: pointer; }

.cf-file {
    padding: 7px 10px;
    background: #f9fafb;
    cursor: pointer;
}

.cf-hint {
    font-size: 0.78rem;
    color: #6b7280;
    margin: 0;
}

.cf-image-preview {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.cf-image-preview-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cf-image-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
}

.cf-image-preview-item img {
    max-width: 160px;
    max-height: 110px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    object-fit: cover;
}

.cf-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cf-image-grid img {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    object-fit: cover;
}

.cf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
}

.cf-checkbox-label--lg {
    font-size: 0.92rem;
    font-weight: 600;
}

.cf-section-header { margin-top: 8px; }

/* Virtual events have no location, so the Location block is hidden and this
   note takes its place — explaining where the join details should go, since
   there is no dedicated field for them. */
.cf-virtual-note {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 3px solid #1d4ed8;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 8px 0 4px;
}
.cf-virtual-note strong { color: #1e3a8a; display: block; margin-bottom: 4px; }
.cf-virtual-note p { margin: 0; color: #374151; font-size: 0.9rem; line-height: 1.55; }
.cf-virtual-note[hidden] { display: none; }

.cf-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 4px;
    border-top: 1px solid #f0f2f5;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .community-form { padding: 0 16px 20px; }
    .cf-row { flex-direction: column; }
    .cf-group--sm { flex: 1; min-width: unset; }

    /* about.ejs / faq.ejs — tighten padding on small phones */
    .section-body {
        padding: 16px;
    }

    /* (hero h1/p phone sizes live in the 640px block above) */
}

/* ===== Metric value size modifiers ===== */
.metric-value--lg  { font-size: 1.3rem; }
.metric-value--md  { font-size: 1.05rem; }
.metric-value--sm-lg { font-size: 1rem; }
.metric-value--sm  { font-size: 0.85rem; }
.metric-value--xs  { font-size: 0.82rem; }
.metric-value--detail { font-size: 0.95rem; font-weight: 500; }
.metric-value--capitalize { text-transform: capitalize; }
.metric-value--break { word-break: break-word; }
.metric-value--stripe-id { font-size: 0.72rem; font-weight: 500; word-break: break-all; color: #6b7280; line-height: 1.4; }
.metric-value--error { color: #dc2626; }
.metric-card--span2 { grid-column: span 2; }

/* ===== Metrics grid modifiers ===== */
.metrics-grid--auto-fill { padding: 0 0 20px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ===== Dash section modifiers ===== */
.dash-section--mb { margin-bottom: 20px; }

/* ===== Inventory options grid (inventorySettings.ejs) ===== */
.inv-options-grid {
    padding: 28px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

@media (max-width: 520px) {
    .inv-options-grid {
        grid-template-columns: 1fr;
        padding: 20px 16px;
    }
}
.inv-option-btn {
    margin-top: 16px;
    width: 100%;
    text-align: center;
}

/* ===== Form section bodies ===== */
.inv-form-section-body { padding: 24px 28px; }
.inv-feed-form-body    { padding: 24px 28px; max-width: 560px; }

/* ===== Two-column grid in forms ===== */
.inv-two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== Flex button row ===== */
.inv-btn-flex-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== Danger zone body layout ===== */
.dash-section--danger .section-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.danger-zone-text {
    font-size: 0.92rem;
    color: #4b5563;
    margin: 0;
    flex: 1;
}

/* ===== Button sizes ===== */
.btn--form-submit  { width: auto; padding: 10px 28px; }
.btn--form-cancel  { width: auto !important; padding: 10px 20px; }
.btn--acct-action  { width: auto !important; flex-shrink: 0; }
.btn--acct-delete  { width: auto !important; flex-shrink: 0; }
.btn--inv-submit   { width: auto; padding: 10px 20px; }
.btn--inv-copy     { width: auto; white-space: nowrap; flex-shrink: 0; padding: 10px 18px; }
.btn--callout-action { display: inline-block; margin-top: 12px; width: auto; padding: 8px 20px; font-size: 0.88rem; }
.btn--grant-access { padding: 8px 20px; background: #28a745; }
.btn--sr-action    { padding: 8px 20px; }
.btn--sr-act       { margin: 0; width: auto; padding: 10px 24px; }
.btn--send-msg     { padding: 9px 24px; }
.btn--support-sm   { padding: 6px 14px; font-size: 0.82rem; }
.btn--support-remove { margin: 0; width: auto; padding: 8px 20px; }
.btn--support-remove-auto { width: auto; margin: 0; }
.btn--support-close { margin: 0; width: auto; padding: 5px 14px; font-size: 0.82rem; }

/* ===== Push API input+copy row ===== */
.inv-input-copy-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}
.inv-input-copy-row--mt { margin-top: 10px; }

/* ===== API key UI ===== */
.inv-label       { display: block; font-size: 0.88rem; font-weight: 600; color: #374151; margin-bottom: 4px; }
.inv-mono-input  { font-family: monospace; font-size: 0.85rem; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 8px 12px; flex: 1; min-width: 0; }
.inv-mono-input--highlight { background: #fffde7; }
.inv-endpoint-meta { margin-top: 10px; font-size: 0.85rem; color: #6b7280; }
.inv-no-key-hint   { color: #6b7280; margin-bottom: 20px; font-size: 0.9rem; }
/* A note (and a pager) that follows a full-bleed table inside a card: the
   section-body gives it the card's padding; the table above keeps its own. */
.inv-note-body { padding: 4px 24px 20px; }  /* same left edge as .support-empty-padded above it */
.inv-note-body > .inv-no-key-hint:last-child { margin-bottom: 0; }
.inv-api-generate-form { max-width: 480px; }

/* ===== Push API callout modifiers ===== */
.inv-callout--mb { margin-bottom: 16px; }
.inv-callout--mt { margin-top: 20px; }
.inv-callout--margin { margin: 24px; }

/* ===== How It Works list ===== */
.how-it-works-list {
    padding: 24px 28px 24px 44px;
    line-height: 2;
    color: #374151;
    font-size: 0.92rem;
    margin: 0;
}
.how-it-works-note {
    padding: 0 28px 20px;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* ===== Table cell utilities (support pages) ===== */
.td-id         { color: #6b7280; font-size: 0.82rem; }
.td-bold       { font-weight: 600; }
.td-title      { font-weight: 600; max-width: 240px; word-break: break-word; }
.td-sub        { font-size: 0.78rem; color: #6b7280; }
.td-capitalize { text-transform: capitalize; }
.td-sm         { font-size: 0.85rem; }

/* ===== Support page layout ===== */
.support-summary-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.support-section-pad  { padding: 20px 24px; }
.support-search-wrap  { padding: 16px 24px 8px; }
.support-table-wrap            { padding: 0 0 8px; overflow-x: auto; }
.support-table-wrap--no-scroll { padding: 0 0 8px; }
.support-table-wrap--scrollable { max-height: 480px; overflow-y: auto; overflow-x: auto; }
.support-empty-text   { color: #6b7280; font-size: 0.9rem; margin: 0; }
.support-empty-padded { padding: 20px 24px; color: #6b7280; font-size: 0.9rem; margin: 0; }
.support-link         { color: #1d4ed8; text-decoration: none; }
.support-scope-hint   { font-size: 0.82rem; color: #6b7280; margin-top: 6px; }

/* ===== Support access panel ===== */
.support-access-wrap  { padding: 24px; display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.support-access-col   { flex: 1; min-width: 260px; }
.support-access-msg   { font-size: 0.9rem; padding: 12px 16px; border-radius: 8px; line-height: 1.6; margin: 0 0 16px; }
.support-access-msg--granted  { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }
.support-access-msg--no-ticket { color: #92400e; background: #fef3c7; border: 1px solid #fde68a; margin-bottom: 0; }
.support-access-desc  { font-size: 0.9rem; color: #4b5563; margin: 0 0 16px; line-height: 1.6; }

/* ===== Support request detail ===== */
.sr-related-row   { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.sr-related-title { font-weight: 700; font-size: 1rem; color: #1a1a2e; }
.sr-related-id    { font-size: 0.85rem; color: #6b7280; margin-left: 8px; }
.sr-message-body  { font-size: 0.95rem; color: #374151; line-height: 1.7; white-space: pre-wrap; }
.sr-msg-count     { font-size: 0.8rem; font-weight: 400; color: #6b7280; }
.sr-actions-row   { padding: 20px 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.sr-user-actions-row { padding: 20px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sr-user-close-hint  { font-size: 0.88rem; color: #6b7280; margin: 0; flex: 1; min-width: 200px; }

/* ===== Bulk Upload Guide ===== */
.guide-body  { padding: 20px 24px; color: #374151; font-size: 0.92rem; line-height: 1.7; }
.guide-hint  { padding: 16px 24px 0; color: #4b5563; font-size: 0.88rem; margin: 0; }
.guide-p     { margin: 0 0 12px; }
.guide-p--sm { margin: 0 0 8px; }
.guide-p--xs { margin: 0 0 4px; }
.guide-list  { padding-left: 20px; margin: 0 0 12px; }
.guide-ol    { padding-left: 20px; margin: 0; }
.guide-link  { color: #1e40af; }
.guide-required-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
}
.guide-optional-badge {
    display: inline-block;
    background: #6b7280;
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 3px;
}

/* Payment pages: .payment-btn-row now lives in sitewide.css — the payment
   views never loaded this stylesheet, so the rule here never applied. */

/* ===== Navbar header ===== */
.form-inline { display: inline; margin: 0; }

/* ===== Sync status badges ===== */
.status-success { color: #16a34a; font-weight: 600; }
.status-failed  { color: #dc2626; font-weight: 600; }

/* ===== Dealership settings — Current Information card ===== */
.edit-form-wrap {
    padding: 24px 28px;
}

.btn-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.dealer-logo-preview {
    display: block;
    max-width: 160px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid #e5e7eb;
}

.dealer-logo-preview-sm {
    max-width: 80px;
    max-height: 44px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.dealer-website-link {
    color: #1d4ed8;
    text-decoration: none;
    word-break: break-all;
}

.dealer-website-link:hover {
    text-decoration: underline;
}

.dealer-not-provided {
    color: #9ca3af;
    font-size: 0.85rem;
    font-style: italic;
}

/* ===== Revenue & Needs Attention (Executive Dashboard) ===== */
.kpi-card.kpi-gold   { border-top-color: #f59e0b; }
.kpi-card.kpi-orange { border-top-color: #ea580c; }

/* Timestamp under the hero title */
.admin-hero-meta {
    margin-top: 6px;
    font-size: 0.82rem;
    opacity: 0.85;
}

/* Warning banner: Stripe unreachable, partial data, unrecognized plans.
   Horizontal inset matches .metrics-grid's 24px content padding. */
.stripe-unavailable {
    margin: 16px 24px 0;
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
}

.attention-clear {
    padding: 20px 24px;
    color: #15803d;
    font-weight: 600;
    line-height: 1.55;
}

.attention-clear-note {
    display: block;
    margin-top: 8px;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.9rem;
}

.dash-section--attention { border: 1px solid #fca5a5; }
.dash-section--attention .section-header { background: #dc2626; }

.attention-table-wrap { padding: 0 24px 20px; }

/* Keep a long past-due or invoice list from running away with the page,
   mirroring the Top Dealerships table treatment. */
.attention-scroll {
    max-height: 320px;
    overflow-y: auto;
}

.subsection-note {
    margin-left: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: none;
    letter-spacing: 0;
}

.chart-note {
    padding: 8px 0 16px;
    color: #6b7280;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Explanatory sub-label under a metric value, for figures whose definition
   isn't obvious from the label alone. */
.metric-hint {
    font-size: 0.72rem;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.35;
}

/* Emphasised total row inside a metrics table */
.metrics-table__total td {
    font-weight: 700;
    background: #f8f9fb;
}

/* Small clarifying note under a table row's label */
.metrics-table__note {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.3;
}
