/* COMMAND CENTER — COMPONENTS (filters, cards, KPI/stat tiles, pills, banners, wizard, role pills, activity feed, dialogs, dealer, admin-context). Loaded after cc-chrome.css. */

/* ---------------- FILTER DROPDOWN BUTTON (admin filter bar) ---------------- */
/* Looks like a flat pill button; opens a MudMenu with options. Matches the
   height + border style of .cc-status-toggle so the whole toolbar lines up. */
.cc-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--cc-light-gray);
    border-radius: 8px;
    background: var(--cc-white);
    font-family: "DinotMedium", sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cc-dark-gray);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1;
}
.cc-filter-btn:hover {
    border-color: var(--cc-medium-gray);
    background: var(--cc-bg);
}
.cc-filter-btn.active {
    border-color: var(--cc-red);
    background: rgba(243, 0, 43, 0.06);
}
.cc-filter-btn-label {
    color: var(--cc-medium-gray);
    font-weight: 500;
}
.cc-filter-btn-value {
    color: var(--cc-black);
    font-weight: 600;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cc-filter-btn.active .cc-filter-btn-label { color: var(--cc-red); opacity: 0.8; }
.cc-filter-btn.active .cc-filter-btn-value { color: var(--cc-red); }
.cc-filter-btn .mud-icon-root {
    color: var(--cc-medium-gray);
    font-size: 16px !important;
}
.cc-filter-btn.active .mud-icon-root { color: var(--cc-red); }

/* Keep the search field locked at 38px and align with the rest. */
/* !important to beat the more-specific ".cc-filter-bar .mud-input-control"
   fixed-width rule below — the search needs room for its full placeholder,
   while the dropdowns stay at the standard 240px. */
.cc-filter-search {
    width: 360px !important;
    min-width: 360px !important;
    max-width: 360px !important;
    flex: 0 0 360px !important;
}
.cc-filter-search .mud-input-control { height: 38px; }

/* Support-page header: title block on the left, a single fixed-size serial
   search anchored top-right. Used app-wide so every support page's search box
   sits in the same place and is the same width (260px) and height (38px). */
.cc-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.cc-page-head > :first-child { min-width: 0; }
/* !important so MudBlazor's own .mud-input-control width can't stretch it back
   to full width — the Class lands on that same element, equal specificity. */
.cc-page-search {
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    flex: 0 0 240px;
}
.cc-page-search .mud-input-control { height: 38px; }
@media (max-width: 700px) {
    .cc-page-search {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: 1 1 100%;
    }
}

/* Standard field sizing — filter-bar dropdowns/inputs stay one fixed width so
   they never grow or shrink with their selected text (applies app-wide to
   every .cc-filter-bar). */
.cc-filter-bar .mud-select,
.cc-filter-bar .mud-input-control {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    flex: 0 0 auto;
}

/* Filters sit on the right, consistent with the page-head search across the
   app. Wraps gracefully on narrow widths. */
.cc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
    /* Stay anchored as the user scrolls long admin lists. Offset clears the
       fixed chrome (cc-header-h + cc-tab-bar-h) plus the page's own padding. */
    position: sticky;
    top: calc(var(--cc-header-h) + var(--cc-tab-bar-h));
    z-index: 5;
    background: var(--cc-bg);
    padding: 8px 4px;
}

/* ---------------- STATUS TOGGLE GROUP (admin filter bar) ---------------- */
.cc-status-toggle {
    display: inline-flex;
    border: 1px solid var(--cc-light-gray);
    border-radius: 8px;
    overflow: hidden;
    background: var(--cc-white);
    height: 38px;
}
.cc-status-toggle-btn {
    border: none;
    background: transparent;
    padding: 0 14px;
    font-family: "DinotMedium", sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cc-dark-gray);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-right: 1px solid var(--cc-light-gray);
}
.cc-status-toggle-btn:last-child { border-right: none; }
.cc-status-toggle-btn:hover { background: var(--cc-bg); }
.cc-status-toggle-btn.active {
    background: rgba(243, 0, 43, 0.08);
    color: var(--cc-red);
}
.cc-status-toggle-btn .cc-status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    flex-shrink: 0;
    background: var(--cc-medium-gray);
}
.cc-status-toggle-btn .cc-status-dot.active   { background: var(--cc-success); }
.cc-status-toggle-btn .cc-status-dot.disabled { background: var(--cc-medium-gray); }
.cc-status-toggle-btn .cc-status-dot.pending  { background: var(--cc-warning); }

/* ---------------- ACTIVE FILTER CHIP ROW ---------------- */
.cc-filter-chips {
    display: flex; flex-wrap: wrap; gap: 6px;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--cc-bg);
    border: 1px solid var(--cc-light-gray);
    border-radius: 8px;
}
.cc-filter-chips-label {
    font-family: "DinotBold", sans-serif;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cc-medium-gray);
    margin-right: 4px;
}
.cc-filter-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 26px;
    padding: 0 6px 0 10px;
    border-radius: 13px;
    background: var(--cc-white);
    border: 1px solid var(--cc-light-gray);
    font-size: 12px;
    font-weight: 600;
    color: var(--cc-dark-gray);
    line-height: 1;
}
.cc-filter-chip-key {
    color: var(--cc-medium-gray);
    font-weight: 500;
}
.cc-filter-chip-close {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: transparent;
    color: var(--cc-medium-gray);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    padding: 0;
}
.cc-filter-chip-close:hover {
    background: var(--cc-red);
    color: var(--cc-white);
}
.cc-filter-chip-close .mud-icon-root { font-size: 14px !important; }
.cc-filter-clear-all {
    margin-left: auto;
    background: transparent;
    border: none;
    font-family: "DinotMedium", sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--cc-red);
    cursor: pointer;
    padding: 4px 6px;
}
.cc-filter-clear-all:hover { text-decoration: underline; }

/* ---------------- BREADCRUMBS (admin pages) ---------------- */
.cc-breadcrumbs .mud-breadcrumbs {
    padding: 0 !important;
}
.cc-breadcrumbs .mud-breadcrumb-item,
.cc-breadcrumbs .mud-breadcrumb-item a {
    font-family: "DinotMedium", sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cc-medium-gray);
    text-decoration: none;
}
.cc-breadcrumbs .mud-breadcrumb-item a:hover {
    color: var(--cc-red);
}
.cc-breadcrumbs .mud-breadcrumb-item.mud-disabled,
.cc-breadcrumbs .mud-breadcrumb-item.mud-disabled a {
    color: var(--cc-dark-gray) !important;
    cursor: default;
}
.cc-breadcrumbs .mud-breadcrumb-separator {
    color: var(--cc-medium-gray);
    margin: 0 6px;
}

/* ---------------- ACCEPT-INVITE PAGE ---------------- */
.cc-accept-page {
    min-height: 70vh;
    display: flex; align-items: center; justify-content: center;
    padding: 36px 16px;
    background: transparent;
}
.cc-accept-card {
    width: 100%;
    max-width: 460px;
    background: var(--cc-white);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid var(--cc-light-gray);
}
.cc-accept-header {
    background: var(--cc-header-bg);
    color: var(--cc-white);
    padding: 26px 28px 22px;
    position: relative;
    text-align: center;
}
.cc-accept-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--cc-red);
}
.cc-accept-eyebrow {
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin: 0;
}
.cc-accept-title {
    font-family: "Klavika", "DinotBold", sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 6px 0 0 0;
    line-height: 1.2;
    color: var(--cc-white);
}
.cc-accept-body {
    padding: 24px 28px 28px;
}
.cc-accept-context {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 0 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--cc-light-gray);
}
.cc-accept-context-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--cc-red);
    color: var(--cc-white);
    display: flex; align-items: center; justify-content: center;
    font-family: "DinotBold", sans-serif;
    font-weight: 800; font-size: 14px;
    flex-shrink: 0;
}
.cc-accept-context-text { flex: 1; min-width: 0; }
.cc-accept-context-name {
    font-family: "DinotMedium", sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--cc-black);
    line-height: 1.2;
}
.cc-accept-context-meta {
    font-size: 12px;
    color: var(--cc-medium-gray);
    margin-top: 2px;
}
.cc-accept-context-meta strong {
    color: var(--cc-dark-gray);
    font-weight: 600;
}
.cc-accept-intro {
    font-size: 13.5px;
    color: var(--cc-dark-gray);
    line-height: 1.55;
    margin: 0 0 16px 0;
}
.cc-accept-state {
    text-align: center;
    padding: 12px 4px 4px;
}
.cc-accept-state-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
}
.cc-accept-state-icon.success { background: rgba(34,197,94,0.12); color: var(--cc-success-text); }
.cc-accept-state-icon.error   { background: rgba(243,0,43,0.10);  color: var(--cc-danger-text); }
.cc-accept-state-icon .mud-icon-root { font-size: 32px !important; }
.cc-accept-state-title {
    font-family: "Klavika", "DinotBold", sans-serif;
    font-size: 19px; font-weight: 800;
    margin: 0 0 6px 0;
}
.cc-accept-state-text {
    font-size: 13.5px;
    color: var(--cc-dark-gray);
    line-height: 1.55;
    margin: 0;
}
/* Inline support link rendered inside the card body */
.cc-accept-support {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--cc-light-gray);
    text-align: center;
    font-size: 12px;
    color: var(--cc-medium-gray);
}
.cc-accept-support a {
    color: var(--cc-red);
    text-decoration: none;
    font-weight: 600;
}
.cc-accept-support a:hover { text-decoration: underline; }

/* Brand CTA — used on accept-invite and any future high-emphasis form
   submission. Override MudButton's defaults via the Class= prop. */
.cc-cta-button.mud-button-filled {
    background: var(--cc-red) !important;
    color: var(--cc-white) !important;
    height: 50px !important;
    border-radius: 10px !important;
    font-family: "DinotBold", "Klavika", sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: none !important;
    padding: 0 24px !important;
    box-shadow:
        0 4px 14px rgba(243, 0, 43, 0.28),
        0 1px 3px rgba(243, 0, 43, 0.18) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease !important;
    border: none !important;
}
.cc-cta-button.mud-button-filled:hover {
    background: var(--cc-red-hover) !important;
    transform: translateY(-1px);
    box-shadow:
        0 8px 24px rgba(243, 0, 43, 0.36),
        0 2px 6px rgba(243, 0, 43, 0.22) !important;
}
.cc-cta-button.mud-button-filled:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(243, 0, 43, 0.30) !important;
}
.cc-cta-button.mud-button-filled:disabled {
    background: var(--cc-medium-gray) !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: not-allowed;
}
.cc-cta-button .mud-button-icon-start { margin-right: 10px; }
.cc-cta-button .mud-icon-root { font-size: 20px !important; }

/* ---------------- KPI TILE (admin dashboard hero cards) ----------------
   White card · 2px black border · red value · subtle red top-edge accent on hover.
   Whole tile is a clickable surface that navigates into the section.
*/
.cc-kpi-tile {
    background: var(--cc-white);
    border: 2px solid var(--cc-black);
    border-radius: 12px;
    padding: 22px 24px;
    height: 100%;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--cc-black);
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.cc-kpi-tile.linkable { cursor: pointer; }
.cc-kpi-tile.linkable:hover {
    border-color: var(--cc-red);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
    text-decoration: none;
}
.cc-kpi-tile-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cc-dark-gray);
    font-family: "DinotBold", "DinotMedium", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.cc-kpi-tile-label .mud-icon-root {
    color: var(--cc-dark-gray) !important;
    font-size: 18px !important;
}
.cc-kpi-tile.linkable:hover .cc-kpi-tile-label,
.cc-kpi-tile.linkable:hover .cc-kpi-tile-label .mud-icon-root {
    color: var(--cc-black) !important;
}
.cc-kpi-tile-value {
    font-family: "DinotBold", "Klavika", system-ui, sans-serif;
    font-size: 44px;
    font-weight: 800;
    color: var(--cc-red);
    line-height: 1;
    font-feature-settings: 'tnum';
    letter-spacing: -0.025em;
    margin-top: 14px;
}
.cc-kpi-tile-arrow {
    position: absolute;
    top: 20px; right: 20px;
    color: var(--cc-medium-gray);
    transition: color 0.2s, transform 0.2s;
    font-size: 18px !important;
}
.cc-kpi-tile.linkable:hover .cc-kpi-tile-arrow {
    color: var(--cc-red);
    transform: translateX(2px);
}

/* Compact variant — used on secondary admin pages (Users, etc) where the
   tiles are reference data, not the page's primary CTA. Tighter padding,
   shorter card, smaller value, smaller corner arrow. */
.cc-kpi-tile.compact {
    padding: 14px 16px;
    min-height: 84px;
    border-radius: 10px;
    border-width: 1px;
}
.cc-kpi-tile.compact .cc-kpi-tile-label {
    font-size: 11px;
    letter-spacing: 0.06em;
}
.cc-kpi-tile.compact .cc-kpi-tile-label .mud-icon-root {
    font-size: 16px !important;
}
.cc-kpi-tile.compact .cc-kpi-tile-value {
    font-size: 28px;
    margin-top: 6px;
}
.cc-kpi-tile.compact .cc-kpi-tile-arrow {
    top: 12px; right: 12px;
    font-size: 14px !important;
}

/* Skeleton placeholder while a KPI count is loading. Sits in the same slot
   as cc-kpi-tile-value so the tile height doesn't jump when data lands. */
.cc-kpi-tile-skeleton {
    margin-top: 14px;
    border-radius: 4px;
}
.cc-kpi-tile.compact .cc-kpi-tile-skeleton {
    margin-top: 6px;
    height: 22px !important;
    width: 48px !important;
}

/* Sticky table header — used on long lists. The MudTable adds its own
   header background on FixedHeader, but the inner data-card border-radius
   masks it. Force the header to sit above and inherit the card surface. */
.cc-data-card .mud-table-container .mud-table-head {
    background: var(--cc-white);
}

/* ---------------- EMPTY STATE ---------------- */
.cc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 36px 24px;
    color: var(--cc-medium-gray);
}
.cc-empty-state-icon {
    font-size: 44px !important;
    color: var(--cc-light-gray);
    margin-bottom: 8px;
}
.cc-empty-state-title {
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--cc-black);
    letter-spacing: 0.01em;
}
.cc-empty-state-description {
    margin-top: 4px;
    font-size: 13px;
    max-width: 380px;
    line-height: 1.5;
    color: var(--cc-medium-gray);
}

/* ---------------- WIZARD STEPS (InviteUserForm) ---------------- */
.cc-wizard-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px 0 12px;
    border-bottom: 1px solid var(--cc-light-gray);
}
.cc-wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cc-medium-gray);
    font-family: "DinotMedium", sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.cc-wizard-step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cc-gray-200);
    color: var(--cc-medium-gray);
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 22px;
}
.cc-wizard-step.active .cc-wizard-step-dot {
    background: var(--cc-red);
    color: #fff;
}
.cc-wizard-step.done .cc-wizard-step-dot {
    background: var(--cc-success-solid);
    color: #fff;
}
.cc-wizard-step.active,
.cc-wizard-step.done {
    color: var(--cc-black);
}
.cc-wizard-step-rail {
    flex: 1;
    height: 2px;
    background: var(--cc-gray-200);
    border-radius: 2px;
}
.cc-wizard-step-rail.done {
    background: var(--cc-success-solid);
}

/* Review card on Step 2 — read-only summary of what's about to be sent. */
.cc-review-card {
    border: 1px solid var(--cc-light-gray);
    border-radius: 8px;
    padding: 12px 16px;
    background: var(--cc-bg);
}
.cc-review-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 13px;
}
.cc-review-row:last-child { border-bottom: none; }
.cc-review-label {
    color: var(--cc-medium-gray);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
}
.cc-review-value {
    color: var(--cc-black);
    font-weight: 600;
    text-align: right;
}

/* ---------------- PERMISSION CHECKBOX GROUPS (Roles form) ---------------- */
.cc-perm-group {
    border: 1px solid var(--cc-light-gray);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    background: var(--cc-white);
}
.cc-perm-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--cc-bg);
    border-bottom: 1px solid var(--cc-light-gray);
}
.cc-perm-group-title {
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cc-dark-gray);
    flex: 1;
}
.cc-perm-group-count {
    font-family: monospace;
    font-size: 11px;
    color: var(--cc-medium-gray);
    font-weight: 600;
}
.cc-perm-group-items { padding: 4px 0; }
.cc-perm-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 12px;
    cursor: pointer;
    transition: background 0.1s;
    border-radius: 4px;
    margin: 1px 6px;
}
.cc-perm-row:hover { background: var(--cc-bg); }
.cc-perm-row.granted { background: rgba(243, 0, 43, 0.03); }
.cc-perm-row-text { flex: 1; min-width: 0; }
.cc-perm-code {
    font-family: monospace;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cc-black);
    line-height: 1.3;
}
.cc-perm-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cc-black);
    line-height: 1.3;
}
.cc-perm-desc {
    font-size: 11.5px;
    color: var(--cc-medium-gray);
    margin-top: 2px;
    line-height: 1.4;
}

/* ---------------- SECRET FIELD (inline reveal + copy) ---------------- */
.cc-secret-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cc-secret-field-value {
    color: var(--cc-black);
    user-select: all;
    min-width: 80px;
    display: inline-block;
}

/* ---------------- STAT CARDS (page hero metrics) ---------------- */
.cc-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.cc-stat-card {
    background: var(--cc-white);
    border: 1px solid var(--cc-light-gray);
    border-left: 4px solid var(--cc-medium-gray);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow 0.15s, transform 0.15s;
}
.cc-stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); transform: translateY(-1px); }
.cc-stat-card.tone-success { border-left-color: var(--cc-success-solid); }
.cc-stat-card.tone-warning { border-left-color: var(--cc-warning-solid); }
.cc-stat-card.tone-error   { border-left-color: var(--cc-medium-gray); }
.cc-stat-card.tone-info    { border-left-color: var(--cc-info-solid); }
.cc-stat-card.tone-neutral { border-left-color: var(--cc-dark-gray); }

.cc-stat-icon {
    width: 42px; height: 42px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--cc-white);
}
.cc-stat-icon.tone-success { background: var(--cc-success-solid); }
.cc-stat-icon.tone-warning { background: var(--cc-warning-solid); }
.cc-stat-icon.tone-error   { background: var(--cc-red); }
.cc-stat-icon.tone-info    { background: var(--cc-info-solid); }
.cc-stat-icon.tone-neutral { background: var(--cc-dark-gray); }
.cc-stat-icon .mud-icon-root { font-size: 22px !important; color: var(--cc-white) !important; }

.cc-stat-text { display: flex; flex-direction: column; min-width: 0; }
.cc-stat-value {
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    color: var(--cc-black);
    letter-spacing: -0.02em;
    font-feature-settings: 'tnum';
}
.cc-stat-label {
    font-family: "DinotBold", "DinotMedium", sans-serif;
    font-size: 11.5px;
    color: var(--cc-medium-gray);
    margin-top: 4px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------------- DATA TABLE CARD (titled card with restyled MudTable) ---------------- */
.cc-data-card {
    background: var(--cc-white);
    border: 1px solid var(--cc-light-gray);
    border-radius: 10px;
    overflow: hidden;
}
.cc-data-card-header {
    padding: 14px 20px;
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cc-black);
    border-bottom: 2px solid var(--cc-black);
    display: flex;
    align-items: center;
    gap: 12px;
}
.cc-data-card-header-spacer { flex: 1; }

/* MudTable restyle inside the card — small uppercase headers, more breathing room */
.cc-data-card .mud-table-container { background: var(--cc-white); }
.cc-data-card .mud-table-head th {
    font-family: "DinotBold", "Klavika", sans-serif !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cc-black) !important;
    background: var(--cc-white) !important;
    border-bottom: 2px solid var(--cc-light-gray) !important;
    padding: 14px 18px !important;
}
.cc-data-card .mud-table-row td {
    padding: 14px 18px !important;
    border-bottom: 1px solid var(--cc-light-gray);
    font-size: 13.5px;
    color: var(--cc-black);
}
.cc-data-card .mud-table-row:last-child td { border-bottom: none; }
.cc-data-card .mud-table-cell-mono { font-family: monospace; font-size: 13px; }

/* ---------------- STATUS / TYPE PILLS ---------------- */
.cc-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.5;
    white-space: nowrap;
}
.cc-pill.tone-critical   { background: rgba(243, 0, 43, 0.10);  color: var(--cc-danger-text); }
.cc-pill.tone-stable     { background: rgba(59, 130, 246, 0.10); color: var(--cc-info-text); }
.cc-pill.tone-legacy     { background: var(--cc-light-gray);    color: var(--cc-dark-gray); }
.cc-pill.tone-pending    { background: rgba(245, 158, 11, 0.18); color: var(--cc-warning-text); }
.cc-pill.tone-current    { background: rgba(34, 197, 94, 0.16);  color: var(--cc-success-text); }
.cc-pill.tone-superseded { background: var(--cc-light-gray);    color: var(--cc-dark-gray); }
.cc-pill.tone-eol        { background: rgba(243, 0, 43, 0.10);  color: var(--cc-danger-text); }
.cc-pill.tone-success    { background: rgba(34, 197, 94, 0.16);  color: var(--cc-success-text); }
.cc-pill.tone-info       { background: rgba(59, 130, 246, 0.10); color: var(--cc-info-text); }
.cc-pill.tone-warning    { background: rgba(245, 158, 11, 0.18); color: var(--cc-warning-text); }
.cc-pill.tone-neutral    { background: var(--cc-light-gray);    color: var(--cc-dark-gray); }

/* ---------------- ADMIN PAGE TITLES & STRUCTURE ---------------- */
/* Mirrors the Data_Analytics typographic system: industrial-uppercase H1-H6
   with tracked letterforms. !important defeats the inline letter-spacing left
   over from the original mixed-case design without having to edit every page. */
.cc-admin-page-title {
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    font-family: "Klavika", "DinotBold", sans-serif !important;
}

/* Subtitle under the page title — unified treatment so every page reads with
   the same density and color, replacing scattered inline styles. */
.cc-admin-page-subtitle {
    color: var(--cc-dark-gray) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    margin-top: 2px !important;
}

/* Small uppercase eyebrow label — Data_Analytics's .pc-toolbar-label pattern.
   Used above content groups (KPI grid, etc.) to give the page report-like
   structure without taking real estate. */
.cc-admin-eyebrow {
    font-family: "DinotBold", sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--cc-medium-gray);
    margin-bottom: -4px;
}

/* Generic admin panel — same red-rail accent as KPI tiles so the dashboard
   activity feed / quick actions visually belong to the same family instead of
   being one-off rounded boxes. */
.cc-admin-panel {
    position: relative;
    background: var(--cc-white);
    border: 1px solid var(--cc-light-gray);
    border-radius: 12px;
    padding: 20px 24px;
    overflow: hidden;
}
.cc-admin-panel::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 4px;
    background: var(--cc-red);
}

/* Dashboard welcome strip — two-column layout. Identity on the left, a
   handful of live signals on the right. Red left rail keeps the same family
   as KPI tiles below; no gradient, no decorative pills. */
.cc-welcome-strip {
    position: relative;
    background: var(--cc-white);
    border: 1px solid var(--cc-light-gray);
    border-radius: 12px;
    padding: 20px 24px 20px 28px;
    display: flex;
    align-items: stretch;
    gap: 32px;
    overflow: hidden;
}
.cc-welcome-strip::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 4px;
    background: var(--cc-red);
}
.cc-welcome-strip-main { flex: 1; min-width: 0; }
.cc-welcome-eyebrow {
    font-family: "DinotBold", sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--cc-medium-gray);
}
.cc-welcome-strip-title {
    font-family: "Klavika", "DinotBold", sans-serif;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cc-black);
    line-height: 1.15;
    margin-top: 4px;
}
.cc-welcome-identity {
    margin-top: 6px;
    font-family: "DinotMedium", sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-dark-gray);
    letter-spacing: 0.02em;
}

/* Right-side stat column — three discreet items, vertically centered, with
   a thin separator from the identity column. */
.cc-welcome-stats {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    border-left: 1px solid var(--cc-light-gray);
    padding-left: 24px;
    min-width: 200px;
}
.cc-welcome-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-decoration: none;
    color: var(--cc-black);
    transition: color 0.15s;
}
a.cc-welcome-stat:hover { color: var(--cc-red); }
.cc-welcome-stat.muted { color: var(--cc-medium-gray); }
.cc-welcome-stat-value {
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: inherit;
    font-feature-settings: 'tnum';
    letter-spacing: -0.01em;
}
.cc-welcome-stat-value-sm {
    font-family: "DinotMedium", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: inherit;
}
.cc-welcome-stat-label {
    font-family: "DinotMedium", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--cc-medium-gray);
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .cc-welcome-strip { flex-direction: column; gap: 16px; }
    .cc-welcome-stats {
        border-left: none;
        border-top: 1px solid var(--cc-light-gray);
        padding-left: 0;
        padding-top: 14px;
        align-items: flex-start;
        width: 100%;
    }
}

/* Drawer / side-form title block — standardized across BranchForm, CompanyForm,
   InviteUserForm, MachineTransferForm, RoleForm so every drawer opens with the
   same uppercase-tracked heading and muted subtitle. */
.cc-drawer-title {
    font-family: "Klavika", "DinotBold", sans-serif !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--cc-black) !important;
    line-height: 1.2 !important;
}

/* ---------------- ADMIN PAGE SHELL TWEAKS (Stripe-inspired) ---------------- */
.cc-admin-shell { padding: 4px; }
.cc-admin-card  {
    background: var(--cc-white);
    border: 1px solid var(--cc-light-gray);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(10,18,36,0.05);
}

/* ---------------- COMPACT ROLE PILLS (Invite dialog) ---------------- */
.cc-role-pill-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cc-role-pill {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--cc-light-gray);
    background: var(--cc-white);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    font-family: "DinotMedium", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--cc-dark-gray);
    line-height: 1.2;
    white-space: nowrap;
    width: 100%;
    text-align: left;
}
/* Role-name span grows; pushes any trailing badge to the right edge. */
.cc-role-pill > span:not(.cc-role-pill-radio):not(.cc-role-pill-badge) {
    flex: 1;
    text-align: left;
}
.cc-role-pill:hover {
    border-color: var(--cc-medium-gray);
    background: var(--cc-bg);
}
.cc-role-pill.selected {
    border-color: var(--cc-red);
    background: rgba(243, 0, 43, 0.06);
    color: var(--cc-red);
}
.cc-role-pill-radio {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--cc-medium-gray);
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    background: var(--cc-white);
}
.cc-role-pill.selected .cc-role-pill-radio {
    border-color: var(--cc-red);
    border-width: 2px;
}
.cc-role-pill.selected .cc-role-pill-radio::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--cc-red);
}
.cc-role-pill-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--cc-light-gray);
    color: var(--cc-dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cc-role-pill.selected .cc-role-pill-badge {
    background: rgba(243, 0, 43, 0.12);
    color: var(--cc-red);
}
.cc-role-description {
    font-size: 12.5px;
    color: var(--cc-medium-gray);
    margin-top: 8px;
    line-height: 1.4;
    min-height: 18px; /* prevents layout jump as text changes */
}

/* ---------------- ROLE CARDS (legacy, kept for any other uses) ---------------- */
.cc-role-card {
    border: 1px solid var(--cc-light-gray);
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--cc-white);
}
.cc-role-card + .cc-role-card { margin-top: 8px; }
.cc-role-card:hover {
    border-color: var(--cc-medium-gray);
    background: var(--cc-bg);
}
.cc-role-card.selected {
    border-color: var(--cc-red);
    border-width: 2px;
    padding: 13px 15px;
    background: rgba(243, 0, 43, 0.04);
}
.cc-role-card-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.cc-role-card-radio {
    width: 18px; height: 18px; border-radius: 50%;
    border: 1.5px solid var(--cc-medium-gray);
    flex-shrink: 0; margin-top: 2px;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.15s;
    background: var(--cc-white);
}
.cc-role-card.selected .cc-role-card-radio { border-color: var(--cc-red); border-width: 2px; }
.cc-role-card.selected .cc-role-card-radio::after {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
    background: var(--cc-red);
}
.cc-role-card-body { flex: 1; min-width: 0; }
.cc-role-card-chips {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-bottom: 6px;
}
.cc-role-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 4px;
    font-family: "DinotMedium", "Klavika", sans-serif;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.5;
}
.cc-role-chip.role-superadmin { background: rgba(243, 0, 43, 0.10); color: var(--cc-danger-text); }
.cc-role-chip.role-admin      { background: rgba(243, 0, 43, 0.08); color: var(--cc-danger-text); }
.cc-role-chip.role-operator   { background: rgba(59, 130, 246, 0.10); color: var(--cc-info-text); }
.cc-role-chip.role-dealer     { background: rgba(245, 158, 11, 0.12); color: var(--cc-warning-text); }
.cc-role-chip.role-cs         { background: rgba(59, 130, 246, 0.10); color: var(--cc-info-text); }
.cc-role-chip.role-sales      { background: rgba(34, 197, 94, 0.12); color: var(--cc-success-text); }
.cc-role-chip-secondary {
    background: var(--cc-light-gray);
    color: var(--cc-dark-gray);
}
.cc-role-chip-mini {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600; color: var(--cc-medium-gray);
}
.cc-role-card-description {
    font-size: 13px; color: var(--cc-dark-gray);
    line-height: 1.5;
}

/* Banners inside dialogs (info / warning / success) */
.cc-banner {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 13px; line-height: 1.5;
}
.cc-banner .mud-icon-root { font-size: 18px !important; flex-shrink: 0; margin-top: 1px; }
.cc-banner.warn { background: #fff7e6; color: var(--cc-warning-text); }
.cc-banner.warn .mud-icon-root { color: #b45309; }
.cc-banner.info { background: #eff6ff; color: #1e40af; }
.cc-banner.info .mud-icon-root { color: var(--cc-info-solid); }
.cc-banner.muted { background: var(--cc-bg); color: var(--cc-dark-gray); border: 1px solid var(--cc-light-gray); }
.cc-banner.success { background: #e8f8ee; color: var(--cc-success-text); }
.cc-banner.success .mud-icon-root { color: var(--cc-success); }
.cc-banner.brand { background: #fff1f3; color: #92002b; border-left: 3px solid var(--cc-red); }
.cc-banner.brand .mud-icon-root { color: var(--cc-red); }

/* Branded "action needed" notification. Applied to a single snackbar via
   SnackbarOptions.SnackbarTypeClass so app-wide toasts are unaffected: a white card
   with a Command Center red accent stripe, dark icon/text, and a charcoal action. */
.mud-snackbar.cc-snackbar-notice {
    background: var(--cc-white) !important;
    color: var(--cc-black) !important;
    border-left: 3px solid var(--cc-red);
    border-radius: 0;                 /* docked flush to the window corner */
    margin: 0 !important;
    animation: cc-snackbar-slide-in-right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dock this notice flush to the top-right window corner (no gap) and slide it in from
   the right. :has scopes the container move to when the notice is present, so every
   other toast keeps its configured position. */
#mud-snackbar-container:has(.cc-snackbar-notice) {
    top: calc(var(--cc-header-h) + var(--cc-tab-bar-h)) !important;  /* flush under the top chrome */
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    padding: 0 !important;
}
@keyframes cc-snackbar-slide-in-right {
    from { transform: translateX(110%); }
    to   { transform: translateX(0); }
}
/* Leading clipboard icon + message: dark on the white surface. */
.cc-snackbar-notice .mud-snackbar-icon,
.cc-snackbar-notice .mud-snackbar-icon .mud-icon-root { color: var(--cc-black); opacity: 1; }
.cc-snackbar-notice .mud-snackbar-content-message { color: var(--cc-black); }
/* ASSIGN action — filled charcoal with white label. */
.cc-snackbar-notice .mud-snackbar-content-action .mud-button-filled {
    background-color: var(--cc-dark-gray) !important;
    color: var(--cc-white) !important;
    font-weight: 700;
    border-radius: var(--cc-radius-sm);
}
/* Close (X) — dark on the white surface. */
.cc-snackbar-notice .mud-snackbar-content-action .mud-icon-button,
.cc-snackbar-notice .mud-snackbar-content-action .mud-icon-button .mud-icon-root {
    color: var(--cc-black) !important;
}

/* ---------------- ADMIN DASHBOARD (activity feed + quick actions) ---------------- */
.cc-activity-bucket-header {
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cc-medium-gray);
    padding: 16px 4px 8px;
    margin-top: 4px;
}
.cc-activity-bucket-header:first-of-type { padding-top: 6px; }
.cc-activity-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 8px;
    border-bottom: 1px solid var(--cc-light-gray);
    color: inherit;
    text-decoration: none;
    transition: background 0.12s;
    position: relative;
    border-radius: 6px;
}
.cc-activity-row:last-child { border-bottom: none; }
.cc-activity-row:hover {
    background: var(--cc-bg);
    text-decoration: none;
}
.cc-activity-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "DinotBold", sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: var(--cc-white);
    margin-top: 1px;
    user-select: none;
}
.cc-activity-avatar.color-0 { background: #475569; } /* slate */
.cc-activity-avatar.color-1 { background: var(--cc-info-solid); } /* blue */
.cc-activity-avatar.color-2 { background: var(--cc-success-solid); } /* green */
.cc-activity-avatar.color-3 { background: var(--cc-warning-solid); } /* orange */
.cc-activity-avatar.color-4 { background: #9333ea; } /* purple */
.cc-activity-avatar.color-5 { background: #dc2626; } /* red */

.cc-activity-content {
    flex: 1;
    min-width: 0;
}
.cc-activity-text {
    font-size: 14px;
    color: var(--cc-black);
    line-height: 1.45;
}
.cc-activity-text strong { font-weight: 700; }
.cc-activity-text .cc-activity-kind-icon {
    color: var(--cc-medium-gray);
    font-size: 14px !important;
    vertical-align: middle;
    margin: 0 4px;
}
.cc-activity-meta {
    margin-top: 3px;
    font-size: 12px;
    color: var(--cc-medium-gray);
}
.cc-activity-action {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: "DinotMedium", sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--cc-medium-gray);
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0 4px;
}
.cc-activity-action .mud-icon-root { font-size: 14px !important; }
.cc-activity-row:hover .cc-activity-action {
    opacity: 1;
    color: var(--cc-red);
}
@media (max-width: 599px) {
    .cc-activity-action { display: none; }
}

.cc-quick-actions { display: flex; flex-direction: column; gap: 10px; }
.cc-quick-action {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--cc-light-gray);
    border-radius: 8px;
    text-decoration: none;
    color: var(--cc-black);
    transition: border-color 0.15s, background 0.15s;
    background: var(--cc-white);
    text-align: left;
    width: 100%;
    font: inherit;
    cursor: pointer;
}
.cc-quick-action:hover {
    border-color: var(--cc-medium-gray);
    background: var(--cc-bg);
    text-decoration: none;
}
.cc-quick-action-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--cc-black);
    border: 1px solid var(--cc-black);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
/* Force the MudIcon glyph inside to render white — pages render the icons
   with Color=Primary (brand red) which would otherwise clash with the black
   tile. */
.cc-quick-action-icon .mud-icon-root {
    color: var(--cc-white) !important;
}
.cc-quick-action:hover .cc-quick-action-icon {
    background: var(--cc-red);
    border-color: var(--cc-red);
    transform: scale(1.04);
}
.cc-quick-action-text  { flex: 1; min-width: 0; text-align: left; }
.cc-quick-action-title {
    flex: 1; min-width: 0;
    font-weight: 700; font-size: 12.5px;
    line-height: 1.3;
    color: var(--cc-black);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Subtle inline kind tag used inside MudSelect dropdown rows so a Dealer-Kind
   Company is distinguishable from a Customer at a glance. Customer rows show
   no tag (it's the default); only Dealer rows are marked. */
.cc-kind-tag {
    font-family: "Klavika", "DinotBold", sans-serif;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    border-radius: 4px;
    line-height: 1.4;
}

.cc-kind-tag.dealer {
    color: var(--cc-white);
    background: var(--cc-black);
}
.cc-quick-action-desc  { font-size: 12px; color: var(--cc-medium-gray); margin-top: 2px; text-align: left; }
.cc-quick-action-arrow { color: var(--cc-medium-gray); }
.cc-quick-action:hover .cc-quick-action-arrow { color: var(--cc-red); }

/* Link-style quick action — tile navigates to a full page rather than opening
   a drawer. The OpenInNew glyph on the right hints at that, and the slightly
   smaller size keeps it visually distinct from the drawer-action arrow. */
.cc-quick-action-link .cc-quick-action-arrow .mud-icon-root,
.cc-quick-action-link .cc-quick-action-arrow.mud-icon-root {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.cc-section-eyebrow {
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--cc-medium-gray);
}

/* ---------------- SIDE-DRAWER FORM SHELL ---------------- */
/* Used inside <MudDrawer Anchor="Anchor.Right" Variant="DrawerVariant.Temporary">
   to host a multi-section form with a fixed header + scrollable body + fixed footer. */
.cc-side-drawer .mud-drawer-content {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.cc-side-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}
.cc-side-form-header {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 20px 24px 16px;
    border-top: 3px solid var(--cc-red);
    border-bottom: 1px solid var(--cc-light-gray);
    flex-shrink: 0;
}
/* Side-drawer titles render in caps + brand display font for a stronger
   visual anchor at the top of the form. Applies to every cc-side-form drawer
   (Invite User, Add Customer/Dealer, Add Branch, Transfer AMR, Create Role). */
.cc-side-form-header .mud-typography-h6 {
    font-family: "DinotBold", "Klavika", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 800;
}
.cc-side-form-body {
    padding: 18px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}
.cc-side-form-footer {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--cc-light-gray);
    background: var(--cc-white);
    flex-shrink: 0;
}

/* ---------------- BRANDED DIALOG ---------------- */
/* Applied to <MudDialog Class="cc-dialog"> to match the side-drawer chrome:
   3px red top accent, DinotBold uppercase title. Sized to feel substantial
   on desktop without going so wide that simple confirmations look bloated. */
.cc-dialog {
    border-top: 3px solid var(--cc-red);
    border-radius: 8px;
    overflow: hidden;
}
.cc-dialog .mud-dialog-title {
    padding: 24px 32px 12px;
}
.cc-dialog .mud-dialog-title,
.cc-dialog .mud-dialog-title .mud-typography-h6 {
    font-family: "DinotBold", "Klavika", sans-serif !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 20px;
}
.cc-dialog .mud-dialog-content {
    padding: 4px 32px 16px;
}
.cc-dialog .mud-dialog-actions {
    padding: 24px 48px 32px;
    gap: 16px;
}

/* Mobile: tighter padding so the dialog doesn't push content past the fold. */
@media (max-width: 599.98px) {
    .cc-dialog .mud-dialog-title   { padding: 16px 20px 8px; }
    .cc-dialog .mud-dialog-content { padding: 4px 20px 12px; }
    .cc-dialog .mud-dialog-actions { padding: 10px 20px 14px; }
}

/* ---------------- IN-COLUMN FILTER TRIGGER ---------------- */
/* Used in MudTh inside MudTable header to act as both the column label and
   the filter activator. Sits unobtrusively next to the column title with a
   small filter glyph that lights up red when a filter is applied. */
.cc-col-filter-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent;
    border: none;
    padding: 4px 6px; margin: -4px -6px;
    border-radius: 6px;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}
.cc-col-filter-btn:hover {
    background: var(--cc-bg);
}
.cc-col-filter-btn .mud-icon-root {
    color: var(--cc-medium-gray);
    transition: color 0.15s;
}
.cc-col-filter-btn:hover .mud-icon-root {
    color: var(--cc-black);
}
.cc-col-filter-btn.active {
    color: var(--cc-red);
}
.cc-col-filter-btn.active .mud-icon-root {
    color: var(--cc-red);
}

/* ---------------- AVATAR STACK + POPOVER ----------------
   Used in the Dealers list "Customer Companies" cell. Shows up to 3 initials
   bubbles overlapping with a "+N" pill when there are more, and opens a
   MudMenu popover listing every assigned customer with a deep-link to the
   filtered Customers page. */
.cc-avatar-stack {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 2px 4px;
    margin: -2px -4px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.cc-avatar-stack:hover {
    background: var(--cc-bg);
}
.cc-avatar-stack-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--cc-white);
    margin-left: -8px;
    font-family: "DinotBold", sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: var(--cc-white);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.cc-avatar-stack-item:first-child { margin-left: 0; }
/* 6 deterministic shades — keyed by FNV-1a hash of the customer's name so the
   same customer is always the same color across the table and popover. */
.cc-avatar-stack-item.color-0 { background: #F3002B; }   /* brand red */
.cc-avatar-stack-item.color-1 { background: #1A1A1A; }   /* near black */
.cc-avatar-stack-item.color-2 { background: #4D4D4D; }   /* dark gray */
.cc-avatar-stack-item.color-3 { background: #1565C0; }   /* dealer-tag blue */
.cc-avatar-stack-item.color-4 { background: #22C55E; }   /* success green */
.cc-avatar-stack-item.color-5 { background: #F59E0B; }   /* warning amber */
.cc-avatar-stack-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px; height: 28px; padding: 0 6px;
    border-radius: 14px;
    border: 2px solid var(--cc-white);
    background: var(--cc-bg);
    color: var(--cc-black);
    margin-left: -8px;
    font-family: "DinotBold", sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 0 0 1px var(--cc-light-gray);
}

/* Popover that lists every customer assigned to a dealer. Headed with a small
   DinotBold count, each row showing the same colored initial bubble for
   continuity with the stack on the row itself. */
.cc-customer-popover {
    min-width: 280px;
    max-width: 380px;
    padding: 4px 0;
}
.cc-customer-popover-header {
    padding: 8px 16px 6px;
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cc-medium-gray);
}

/* ---------------- LAST MODIFIED CELL ---------------- */
/* Two-line audit cell: primary relative-time label on top, with the modifier's
   colored initial bubble + name as the secondary line. Full timestamp lives in
   a title-tooltip on the wrapping div for precision. */
.cc-modified-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.25;
}
.cc-modified-when {
    font-weight: 600;
    font-size: 13px;
    color: var(--cc-black);
}
.cc-modified-by {
    font-size: 12px;
    color: var(--cc-medium-gray);
}
.cc-modified-by-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* ---------------- ROW ACTIONS ---------------- */
/* Per-row action cluster used in MudTable. Groups icon buttons with explicit
   spacing and inserts a thin vertical rule before the destructive action so
   Delete reads as separate from Edit / Reset password. */
.cc-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* Minimal row-action icon button — neutral at rest, brand-red on hover. */
.cc-row-action-btn,
.cc-row-action-btn .mud-icon-root {
    color: var(--cc-dark-gray) !important;
}
.cc-row-action-btn:hover {
    background: rgba(243, 0, 43, 0.08) !important;
}
.cc-row-action-btn:hover,
.cc-row-action-btn:hover .mud-icon-root {
    color: var(--cc-red) !important;
}

/* Software column — single inline row: version · CHANNEL. No pill. */
.cc-software-cell {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}
.cc-software-version {
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 12.5px;
    color: var(--cc-black);
    font-weight: 600;
}
.cc-software-sep {
    color: var(--cc-medium-gray);
    font-weight: 600;
}
.cc-software-channel {
    font-family: "DinotBold", "Klavika", sans-serif;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--cc-medium-gray);
}
.cc-row-actions-divider {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: var(--cc-light-gray);
    margin: 0 6px;
}

/* Mobile: side drawer takes the full viewport, form padding is tighter,
   and any in-form MudStack Row wraps so two-column layouts (Country+Phone,
   City+State+ZIP, First+Last) stack vertically when there's no room. */
@media (max-width: 599.98px) {
    .cc-side-drawer .mud-drawer-fixed,
    .cc-side-drawer.mud-drawer-fixed {
        width: 100vw !important;
        max-width: 100vw !important;
    }
    .cc-side-form-header { padding: 14px 16px 12px; }
    .cc-side-form-body   { padding: 14px 16px; }
    .cc-side-form-footer { padding: 12px 16px; }

    .cc-side-form-body .mud-stack-row {
        flex-wrap: wrap;
    }
    /* Anything inside a wrapping form row should grow to the full line on mobile,
       except for inputs that explicitly opt out via the cc-keep-row class. */
    .cc-side-form-body .mud-stack-row > .mud-input-control,
    .cc-side-form-body .mud-stack-row > .mud-input-helper-text,
    .cc-side-form-body .mud-stack-row > .mud-input,
    .cc-side-form-body .mud-stack-row > .mud-form-control {
        min-width: 100%;
    }
}

/* ---------------- MY DEALER PAGE (map-led hero) ---------------- */
.cc-dealer-map {
    width: 100%;
    height: 320px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--cc-light-gray);
    background: var(--cc-bg);
}

.cc-dealer-hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cc-dealer-hero-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cc-dealer-hero-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cc-dealer-hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--cc-medium-gray);
    font-size: 13px;
}

.cc-dealer-hero-sep { color: var(--cc-light-gray); }

.cc-dealer-hero-address {
    color: var(--cc-dark-gray);
    font-weight: 500;
}

.cc-dealer-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.02em;
}
.cc-dealer-status.active   { color: var(--cc-success-text); }
.cc-dealer-status.inactive { color: var(--cc-medium-gray); }

.cc-dealer-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cc-medium-gray);
    display: inline-block;
}
.cc-dealer-status.active   .cc-dealer-status-dot { background: var(--cc-success); }
.cc-dealer-status.inactive .cc-dealer-status-dot { background: var(--cc-medium-gray); }

.cc-dealer-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--cc-light-gray);
}

.cc-dealer-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--cc-bg);
    border: 1px solid var(--cc-light-gray);
    color: var(--cc-black);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cc-dealer-action:hover {
    background: var(--cc-white);
    border-color: var(--cc-red);
    color: var(--cc-red);
    text-decoration: none;
}
.cc-dealer-action .mud-icon-root { font-size: 16px !important; }

.cc-dealer-branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.cc-dealer-branch-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--cc-light-gray);
    border-radius: 10px;
    background: var(--cc-white);
    transition: border-color 0.12s, box-shadow 0.12s;
}
.cc-dealer-branch-card:hover {
    border-color: var(--cc-red);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.cc-dealer-branch-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--cc-bg);
    color: var(--cc-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cc-dealer-branch-icon .mud-icon-root { color: var(--cc-red); }

.cc-dealer-branch-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cc-dealer-branch-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--cc-black);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .cc-dealer-map { height: 240px; }
    .cc-dealer-hero-actions { gap: 6px; }
    .cc-dealer-action {
        padding: 7px 12px;
        font-size: 12.5px;
    }
}

/* ============================================================================
   RC MOWERS DESIGN LANGUAGE — Admin surface only (scoped to .cc-admin-context)
   Ported from Data_Analytics so the Admin module shares the RC Mowers brand
   tokens, typography rhythm, and MudBlazor component overrides without
   disturbing the Support surface.
   ============================================================================ */

.cc-admin-context {
    --rcm-white:       var(--cc-white);
    --rcm-light-gray:  var(--cc-light-gray);
    --rcm-red:         var(--cc-red);
    --rcm-red-dark:    var(--cc-red-hover);
    --rcm-black:       var(--cc-black);
    --rcm-medium-gray: var(--cc-medium-gray);
    --rcm-dark-gray:   var(--cc-dark-gray);

    --rcm-font-header: "Klavika", "DinotBold", Arial, sans-serif;
    --rcm-font-body:   "Dinot", "DinotMedium", Arial, sans-serif;

    --rcm-shadow-soft: 0 2px 10px rgba(0,0,0,0.10);
    --rcm-shadow:      0 6px 20px rgba(0,0,0,0.12);
    --rcm-border:      rgba(0,0,0,0.08);
}

/* ---- Typography rhythm: uppercase headers with brand letter-spacing ---- */
.cc-admin-context h1,
.cc-admin-context h2,
.cc-admin-context h3,
.cc-admin-context h4,
.cc-admin-context h5,
.cc-admin-context h6,
.cc-admin-context .mud-typography-h1,
.cc-admin-context .mud-typography-h2,
.cc-admin-context .mud-typography-h3,
.cc-admin-context .mud-typography-h4,
.cc-admin-context .mud-typography-h5,
.cc-admin-context .mud-typography-h6 {
    font-family: var(--rcm-font-header);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rcm-black);
}

.cc-admin-context .mud-typography-subtitle1,
.cc-admin-context .mud-typography-subtitle2 {
    font-family: var(--rcm-font-body);
    letter-spacing: 0.01em;
}

.cc-admin-context .mud-typography-overline {
    font-family: var(--rcm-font-header);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cc-admin-context .mud-button,
.cc-admin-context .mud-button-root {
    font-family: var(--rcm-font-header);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

/* ---- MudBlazor component overrides (admin only) ---- */

/* Tables — uppercase tracked headers, brand hover */
.cc-admin-context .mud-table-head {
    background-color: var(--rcm-light-gray);
}
.cc-admin-context .mud-table-head th,
.cc-admin-context .mud-th {
    font-family: var(--rcm-font-header);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--rcm-black);
}
.cc-admin-context .mud-table-row:hover {
    background-color: var(--rcm-light-gray) !important;
}

/* Tabs — red active indicator + uppercase labels */
.cc-admin-context .mud-tabs-header {
    border-bottom: 2px solid var(--rcm-light-gray);
}
.cc-admin-context .mud-tab {
    font-family: var(--rcm-font-header);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rcm-black);
}
.cc-admin-context .mud-tab.mud-tab-active {
    color: var(--rcm-red) !important;
}
.cc-admin-context .mud-tab-slider {
    background-color: var(--rcm-red) !important;
}

/* Chips — uppercase, brand-color filled variants */
.cc-admin-context .mud-chip {
    font-family: var(--rcm-font-header);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cc-admin-context .mud-chip.mud-chip-filled.mud-chip-color-primary {
    background-color: var(--rcm-black) !important;
    color: var(--rcm-white) !important;
}
.cc-admin-context .mud-chip.mud-chip-filled.mud-chip-color-secondary {
    background-color: var(--rcm-red) !important;
    color: var(--rcm-white) !important;
}

/* Filled buttons — black primary / red secondary, white labels */
.cc-admin-context .mud-button-filled.mud-button-filled-primary {
    background-color: var(--rcm-black) !important;
    color: var(--rcm-white) !important;
}
.cc-admin-context .mud-button-filled.mud-button-filled-primary:hover {
    background-color: var(--rcm-dark-gray) !important;
}
.cc-admin-context .mud-button-filled.mud-button-filled-secondary {
    background-color: var(--rcm-red) !important;
    color: var(--rcm-white) !important;
}
.cc-admin-context .mud-button-filled.mud-button-filled-secondary:hover {
    background-color: var(--rcm-light-gray) !important;
    color: var(--rcm-black) !important;
    outline: 1px solid var(--rcm-black);
}
.cc-admin-context .mud-button-filled.mud-button-filled-secondary:hover .mud-button-label,
.cc-admin-context .mud-button-filled.mud-button-filled-secondary:hover span {
    color: var(--rcm-black) !important;
}

/* Inputs — red focus underline + outline matches brand */
.cc-admin-context .mud-input:focus-within {
    border-color: var(--rcm-red) !important;
}
.cc-admin-context .mud-input-underline:after {
    border-bottom-color: var(--rcm-red) !important;
}

/* Snackbar — red left rail, square corners */
.cc-admin-context ~ .mud-snackbar-provider .mud-snackbar,
.cc-admin-context .mud-snackbar {
    border-left: 4px solid var(--rcm-red) !important;
    background: var(--rcm-white) !important;
    color: var(--rcm-black) !important;
    max-width: 620px !important;
    min-height: 56px !important;
    padding: 14px 16px !important;
}

/* Date picker — red header toolbar */
.cc-admin-context .mud-picker-toolbar {
    background-color: var(--rcm-red) !important;
    color: var(--rcm-white) !important;
}
.cc-admin-context .mud-picker-toolbar *,
.cc-admin-context .mud-picker-toolbar .mud-typography,
.cc-admin-context .mud-picker-toolbar button {
    color: var(--rcm-white) !important;
}
.cc-admin-context .mud-picker-calendar-day.mud-selected,
.cc-admin-context .mud-picker-calendar-day.mud-range-start,
.cc-admin-context .mud-picker-calendar-day.mud-range-end {
    background-color: var(--rcm-red) !important;
    color: var(--rcm-white) !important;
}

/* Linear progress accent */
.cc-admin-context .mud-progress-linear-color-secondary .mud-progress-linear-bar {
    background-color: var(--rcm-red);
}

/* Divider tone */
.cc-admin-context .mud-divider {
    border-color: var(--rcm-light-gray) !important;
}

/* ---- Utility classes ported from Data_Analytics ---- */

.cc-admin-context .rcm-filter-toolbar {
    background: var(--rcm-white);
    border: 1px solid var(--rcm-border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.cc-admin-context .filter-toggle-group {
    border-radius: 8px !important;
}
.cc-admin-context .filter-toggle-group .mud-toggle-item {
    min-height: 40px !important;
    padding: 0 18px !important;
    font-size: 0.95rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.cc-admin-context .mud-toggle-item.mud-toggle-item-selected.mud-primary {
    background-color: var(--rcm-black) !important;
    color: var(--rcm-white) !important;
}
.cc-admin-context .mud-toggle-item.mud-toggle-item-selected.mud-primary * {
    color: var(--rcm-white) !important;
}
.cc-admin-context .mud-toggle-item.mud-toggle-item-selected.mud-secondary {
    background-color: var(--rcm-red) !important;
    color: var(--rcm-white) !important;
}
.cc-admin-context .mud-toggle-item.mud-toggle-item-selected.mud-secondary * {
    color: var(--rcm-white) !important;
}

.cc-admin-context .filter-select .mud-input-slot,
.cc-admin-context .filter-date-picker .mud-input-slot {
    min-height: 40px !important;
    font-size: 0.95rem !important;
}
.cc-admin-context .filter-select-fixed {
    min-width: 250px;
    max-width: 250px;
}

.cc-admin-context .rcm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 48px 32px;
    border: 1px dashed var(--rcm-medium-gray);
    border-radius: 8px;
    background: rgba(0,0,0,0.015);
}
.cc-admin-context .rcm-empty-state-icon {
    width: 56px;
    height: 56px;
    background: var(--rcm-black);
    color: var(--rcm-white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    border-radius: 8px;
}
.cc-admin-context .rcm-empty-state-title {
    font-family: var(--rcm-font-header);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rcm-black);
}
.cc-admin-context .rcm-empty-state-desc {
    font-size: 0.85rem;
    color: var(--rcm-dark-gray);
    max-width: 360px;
    line-height: 1.5;
}

/* Mini-KPI helper utilities (subtle, neutral-only by default — no red rails) */
.cc-admin-context .mini-kpi {
    border-radius: 8px;
    border: 1px solid var(--rcm-border);
    background: var(--rcm-white);
    box-shadow: var(--rcm-shadow-soft);
}
.cc-admin-context .mini-kpi-black    { border-left: 4px solid var(--rcm-black); }
.cc-admin-context .mini-kpi-darkgray { border-left: 4px solid var(--rcm-dark-gray); }
.cc-admin-context .mini-kpi-medgray  { border-left: 4px solid var(--rcm-medium-gray); }

