/* ═══════════════════════════════════════════════════════════════
   Add / Edit Partner dialog shared layout classes.
   These are global because the form content is passed as a
   RenderFragment (DialogContent) into MudDialog — Blazor CSS
   isolation does not stamp scope attributes onto elements inside
   ChildContent RenderFragments of child components.
   ═══════════════════════════════════════════════════════════════ */

/* Dialog body */
.ap-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 2px;
    max-height: 72vh;
    overflow-y: auto;
}

/* Section title */
.ap-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #374151;
    margin-top: 12px;
    margin-bottom: 2px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

/* Muted hint text next to a section title */
.ap-section-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
}

/* Document list ─────────────────────────────────── */
.ap-doc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ap-doc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    font-size: 0.85rem;
}

.ap-doc-item.ap-doc-pending {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.ap-doc-icon {
    color: #6b7280;
    flex-shrink: 0;
}

.ap-doc-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.ap-doc-size {
    color: #9ca3af;
    font-size: 0.78rem;
    white-space: nowrap;
}

.ap-doc-date {
    color: #9ca3af;
    font-size: 0.78rem;
    white-space: nowrap;
}

/* Row layout — 2-column flex */
.ap-row {
    display: flex;
    gap: 12px;
}

.ap-field {
    flex: 1;
    min-width: 0;
}

.ap-row .mud-select {
    display: flex;
    flex: 1;
    position: relative;
}

.ap-field-full {
    width: 100%;
}

/* Region panel */
.ap-region-panel {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px 10px;
    margin-bottom: 6px;
    background: #f9fafb;
}

.ap-region-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #374151;
    margin-bottom: 10px;
}

.ap-region-row {
    display: flex;
    gap: 12px;
    margin-bottom: 1em;
}

    .ap-region-row .mud-select {
        display: flex;
        flex: 1;
        position: relative;
    }

/* Flag images */
.ap-flag {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 2px;
}

/* Partner config flags checkboxes label */
.ap-flags-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2em;
    margin-bottom: 4px;
}

.ap-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

/* ─── Coming soon placeholder pages ────────────────────────── */
.coming-soon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
    gap: 14px;
}

.coming-soon-icon {
    font-size: 4rem !important;
    width: 64px !important;
    height: 64px !important;
    color: #1976d2 !important;
    opacity: 0.4;
}

.coming-soon-title {
    color: #1a2035;
    font-weight: 600 !important;
}

.coming-soon-body {
    color: #6b7280;
    max-width: 380px;
}

/* ─── 404 / Error pages (NotFoundView + ErrorView) ─────────── */
.error-page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
    gap: 16px;
}

.error-page-code {
    font-size: 7rem;
    font-weight: 800;
    line-height: 1;
    color: #1976d2;
    opacity: 0.18;
    letter-spacing: -4px;
}

.error-page-icon {
    font-size: 5rem !important;
    width: 80px !important;
    height: 80px !important;
    color: #f59e0b !important;
}

.error-page-title {
    color: #1a2035;
    font-weight: 600 !important;
    margin-top: 8px !important;
}

.error-page-body {
    color: #6b7280;
    max-width: 420px;
}

.error-page-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ─── Status Badges ─────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.6;
    white-space: nowrap;
}

.status-cold {
    background-color: #e3f2fd;
    color: #1565c0;
}

.status-at-risk {
    background-color: #fff3e0;
    color: #e65100;
}

/* ─── Bundle region tag (shown in dropdown when no region filter active) */
.bundle-region-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
    letter-spacing: 0.03em;
}

.bundle-region-ca {
    background: #e8f4fd;
    color: #1565c0;
}

.bundle-region-us {
    background: #fdecea;
    color: #b71c1c;
}

/* ─── AppBar elevation fix ──────────────────────────────────── */
.mud-appbar {
    z-index: 1300;
}

/* ═══════════════════════════════════════════════════════════════
   Main Layout — top-level MudBlazor component overrides.
   These cannot use scoped CSS (no HTML ancestor with scope attr),
   so they live here as global classes.
   ═══════════════════════════════════════════════════════════════ */

.layout-appbar {
    background-color: #ffffff !important;
    color: #1a2035 !important;
}

/* MudIconButton for the hamburger menu */
.layout-menu-btn {
    color: #1a2035 !important;
}

/* MudDrawer */
.layout-drawer {
    background-color: #1a1a2e !important;
    border-right: none !important;
}

/* MudMainContent */
.layout-main {
    background-color: #f8f9fa !important;
    min-height: 100vh;
}

.mud-container {
    max-width:98% !important;
}
/* ─── MudSelect inside AppBar ───────────────────────────────── */
.mud-input-outlined .mud-input-outlined-border {
    border-color: #d0d0d0 !important;
}


/* ── Filter panel ────────────────────────────────────────────── */
.fp-panel {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}

.fp-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 18px 6px;
    min-width: 0;
}

.fp-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1px;
    line-height: 1;
}

.fp-vline {
    width: 1px;
    background-color: #e5e7eb;
    flex-shrink: 0;
    margin: 8px 0;
}

.filter-bar {
    padding: 0;
    margin-bottom: 12px;
    color: var(--mud-palette-text-primary);
    background-color: var(--mud-palette-surface);
    border-radius: var(--mud-default-borderradius);
    transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}

/* ─── Mudbutton inside Pager ───────────────────────────────── */
.mud-button-outlined {
    min-width: auto !important;
    padding: 3px 10px !important;
    border-radius: 6px !important;
    background-color: #ffffff;
}

.mud-button-filled {
    min-width: auto !important;
    padding: 3px 10px !important;
    border-radius: 6px !important;
}

/* ─── Table hover ────────────────────────────────────────────── */
.mud-table-row:hover td {
    background-color: #fafafa;
}

/* ─── Affiliate Links — data grid header ────────────────────── */
.table-card .mud-table-head th {
    background-color: #e6f2ff !important;
    color: #3399ff !important;
}

.flag-img {
    height: 20px;
    width: 20px;
}

.mud-list-item-icon {
    min-width: 36px !important;
}

.mud-popover.mud-popover-open {
    border-radius: 10px !important;
}
/* ═══════════════════════════════════════════════════════════════
   Nav menu — all MudBlazor-targeting styles live here in global
   CSS (scoped to .nav-container) because Blazor CSS isolation
   does not reliably stamp scope attributes onto elements passed
   as ChildContent into child components like MudNavMenu/MudTooltip.
   ═══════════════════════════════════════════════════════════════ */
/* MudNavMenu — centre its children instead of stretching them */
.nav-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.5em;
    margin-top: 1em;
}

    .nav-container .mud-navmenu {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 0 !important;
    }

    .nav-container .nav-item {
        width: 95% !important;
        display: flex;
        flex-direction: column;
        padding-bottom: 1px;
    }

    /* Tooltip wrapper — fill the centred .nav-item */
    .nav-container .mud-tooltip-root {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    /* Divider */
    .nav-container .nav-footer-divider {
        border-color: rgba(255, 255, 255, 0.10) !important;
        margin: 8px 0 4px !important;
    }

    /* Nav link base */
    .nav-container .mud-navmenu .mud-nav-link {
        color: rgba(255, 255, 255, 0.75) !important;
        font-size: 0.875rem !important;
        font-weight: 400 !important;
        padding: 10px 16px !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 8px !important;
        background-color: transparent !important;
        transition: background-color 0.18s ease, color 0.18s ease;
    }

        /* Hover — white card */
        .nav-container .mud-navmenu .mud-nav-link:hover {
            background-color: rgba(255, 255, 255, 0.92) !important;
            color: #1a2035 !important;
        }

            .nav-container .mud-navmenu .mud-nav-link:hover .mud-icon-root {
                color: #1a2035 !important;
            }

    /* Active — dark blue, left border
   nav-active is on .nav-item (our own div), not on mud-nav-link,
   so we target .mud-nav-link as a child of the active wrapper.     */
    .nav-container .nav-item.nav-active .mud-nav-link {
        background-color: #1e3a6e !important;
        color: #ffffff !important;
        font-weight: 600 !important;
        border-left: 3px solid #1976d2 !important;
        border-radius: 8px !important;
        padding-left: 13px !important;
    }

        .nav-container .nav-item.nav-active .mud-nav-link:hover {
            background-color: #1e3a6e !important;
            color: #ffffff !important;
        }

    /* Icons */
    .nav-container .mud-navmenu .mud-nav-link .mud-icon-root {
        color: rgba(255, 255, 255, 0.55) !important;
        font-size: 1.15rem !important;
    }

    .nav-container .nav-item.nav-active .mud-nav-link .mud-icon-root {
        color: #60a5fa !important;
    }

    /* Logout hover */
    .nav-container .mud-navmenu .nav-logout:hover {
        background-color: rgba(239, 68, 68, 0.15) !important;
        color: #ff6b6b !important;
    }

        .nav-container .mud-navmenu .nav-logout:hover .mud-icon-root {
            color: #ff6b6b !important;
        }

    /* ── Mini mode (icon-only) ───────────────────────────────────── */
    .nav-container.nav-mini .mud-navmenu .mud-nav-link {
        justify-content: center;
        padding: 10px 0 !important;
    }

    .nav-container.nav-mini .mud-nav-link-text {
        display: none;
    }

    .nav-container.nav-mini .nav-item.nav-active .mud-nav-link {
        padding-left: 0 !important;
        border-left: none !important;
    }


/* ── Manage Partner Access page ─────────────────────────────── */

/* Account type chip — compact */
.mpa-type-chip {
    font-size: 0.72rem !important;
    height: 22px !important;
}

/* Flag cluster for multi-country service-country cells */
.mpa-flags {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Avatar + name in the Name column */
.mpa-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mpa-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.65rem !important;
    background-color: #1976d2 !important;
    color: #fff !important;
    flex-shrink: 0;
}

/* Owner email displayed in a lighter colour */
.mpa-owner-email {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ═══════════════════════════════════════════════════════════════
   Change Marketer Dialog
   ═══════════════════════════════════════════════════════════════ */

/* Strip MudBlazor's default content padding — we manage it */
.cmd-content {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    max-height: calc(85vh - 120px);
}

/* Sticky filter bar header */
.cmd-sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffff;
    padding: 14px 20px 12px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* Progress bar flush to top of sticky header */
.cmd-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 !important;
}

/* Filter bar — reuses fp-panel style, override margin */
.cmd-filter-bar {
    margin-bottom: 0 !important;
}

/* Region section: fixed narrow width */
.cmd-region-section {
    min-width: 140px;
    max-width: 170px;
    flex-shrink: 0;
}

/* Marketer section: wider */
.cmd-marketer-section {
    min-width: 200px;
    flex: 1.2;
}

/* Scrollable body */
.cmd-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px 16px;
    min-height: 0;
}

.cmd-body-confirm {
    padding-top: 18px;
}

/* Selection count hint */
.cmd-selection-hint {
    margin-bottom: 6px;
    text-align: right;
}

/* Table wrapper */
.cmd-grid-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Blue header matching partner list */
.cmd-grid .mud-table-head th {
    background-color: #e6f2ff !important;
    color: #1976d2 !important;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 16px !important;
    white-space: nowrap;
}

/* Row hover */
.cmd-grid .mud-table-row:hover td {
    background-color: #f0f6ff !important;
}

/* Compact pager inside dialog */
.cmd-grid .mud-table-pagination {
    border-top: 1px solid #e5e7eb;
    padding: 0 8px;
    min-height: 40px;
}

.cmd-grid .mud-table-pagination .mud-table-pagination-caption {
    font-size: 0.78rem;
}

/* Confirm step list */
.cmd-confirm-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.cmd-confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.cmd-confirm-row:last-child {
    border-bottom: none;
}

.cmd-confirm-row:hover {
    background: #f0f6ff;
}

.cmd-confirm-arrow {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Dialog actions — right-aligned with gap, separated from content */
.cmd-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
    padding: 16px;
}

.cmd-action-btn {
    min-width: 110px;
    border-radius: 8px !important;
}

/* Header layout — title on left, actions on right */
.pl-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3em;
    gap: 16px;
}

.pl-title {
    font-weight: 700 !important;
    color: #1a2035;
}

.pl-subtitle {
    color: #6b7280;
    margin-top: 2px !important;
}

/* Grid wrapper */
.pl-grid-wrap {
    flex: 1;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-bottom: 10px;
}

.pl-grid {
    max-height: calc(100vh - 370px);
}

/* Partner ID badge */
.pid-badge {
    display: inline-block;
    background: #e6f2ff;
    color: #1565c0;
    border-radius: 6px;
    padding: 1px 8px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* Flag image */
.region-flag-img {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
}

/* Activation chips */
.act-chip {
    font-size: 0.75rem !important;
    height: 20px !important;
}

.comm-chip {
    font-size: 0.72rem !important;
    height: 20px !important;
}

/* Empty / loading state */
.pl-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 48px 24px;
}

.pl-empty-icon {
    font-size: 3rem !important;
    color: #d1d5db !important;
}

/* Muted em dash */
.muted-dash {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* In-Transit row highlight */
.pl-grid tr.row-in-transit td {
    background-color: #fffbeb !important;
}

.pl-grid .mud-table-container {
    max-height: calc(100vh - 370px);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    overflow: auto;
    background: #ffffff;
    background-color: var(--mud-palette-surface);
    border-radius: var(--mud-default-borderradius) 4px;
    transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}

.rl-grid .mud-table-container {
    max-height: calc(85vh - 370px);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    overflow: auto;
    background: #ffffff;
    background-color: var(--mud-palette-surface);
    border-radius: var(--mud-default-borderradius) 4px;
    transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}

/* Grid header */
.pl-grid .mud-table-head th {
    background-color: #e6f2ff !important;
    color: #3399ff !important;
    text-wrap-mode: nowrap;
    padding: 1em !important;
}

.rl-grid .mud-table-head th {
    background-color: #e6f2ff !important;
    color: #3399ff !important;
    text-wrap-mode: nowrap;
    padding: 1em !important;
}

/* Actions column */
.pl-actions-th,
.pl-actions-td {
    width: 56px;
    min-width: 56px;
    padding-left: 8px !important;
    padding-right: 4px !important;
}

/* Remove MudBlazor Text-variant underline inside the panel */
.fp-field .mud-input-underline::before,
.fp-field .mud-input-underline::after {
    display: none !important;
}

/* Tighten up internal spacing */
.fp-field .mud-input-control {
    margin-bottom: 0 !important;
}

.fp-field .mud-input-root {
    padding-bottom: 2px;
}

.fp-field .mud-select-input {
    padding-bottom: 2px;
}

/* Placeholder color */
.fp-field input::placeholder {
    color: #9ca3af;
    font-size: 0.875rem;
}

.fp-field .mud-select-input.mud-input-root-text {
    color: #374151;
    font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════════
   Dashboard
   ═══════════════════════════════════════════════════════════════ */

.db-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.db-title {
    font-weight: 600;
}

.db-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.db-region-toggle {
    flex-shrink: 0;
}

.db-view-as-select {
    width: 220px;
}

/* Two-column grid: left ~60%, right ~40% */
.db-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    align-items: stretch;
}

.db-cold-scroll .mud-table-head th {
    text-wrap-mode: nowrap;
}

@media (max-width: 1100px) {
    .db-grid {
        grid-template-columns: 1fr;
    }
}

/* Card container */
.db-card {
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

/* Both grid cards are capped at 560 px and hide any hard overflow */
.db-grid .db-card {
    max-height: 480px;
    overflow: hidden;
}

/* Left panel: chart area scrolls if content somehow overflows */
.db-left-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Cold Partners scrollable table area */
.db-cold-scroll {
    flex: 1;
    min-height: 0;
}

/* Card title row */
.db-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.db-card-title-icon {
    color: var(--mud-palette-primary);
}

/* Stat cards row */
.db-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.db-stat-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.db-stat-label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.db-stat-value {
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1.2;
}

/* Delta (MoM / YoY) */
.db-stat-delta {
    display: flex;
    align-items: center;
    gap: 0;
    line-height: 1.2;
}

    .db-stat-delta .mud-typography-h4 {
        font-weight: 700;
        font-size: 1.9rem;
    }

.db-delta-up {
    color: #43a047;
}

.db-delta-down {
    color: #e53935;
}

/* Cold Partners table */
.db-cold-table {
    max-height: 350px;
    overflow: auto;
}

    .db-cold-table th {
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--mud-palette-text-secondary);
    }

.db-cold-pagination {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

/* Active Clients Distribution */
.db-clients-card {
    margin-top: 20px;
}

.db-donut-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 700px) {
    .db-donut-row {
        grid-template-columns: 1fr;
    }
}

.db-donut-card {
    border-radius: 6px;
    padding: 16px;
}

.db-donut-inner {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Donut legend */
.db-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.db-donut-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.db-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.db-legend-label {
    font-size: 0.85rem;
    min-width: 80px;
}

.db-legend-count {
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

.db-legend-pct {
    font-size: 0.8rem;
    min-width: 40px;
}

/* ═══════════════════════════════════════════════════════════════
   SIM Manager — Create / Edit dialog layout classes.
   Global because MudDialog ChildContent RenderFragments don't
   receive Blazor CSS isolation scope attributes.
   ═══════════════════════════════════════════════════════════════ */

.sim-dialog .mud-dialog-content {
    max-height: 72vh;
    overflow-y: auto;
    padding: 16px 24px;
}

.sim-dialog-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sim-section-title {
    font-weight: 600;
    color: #1a2035;
    margin-bottom: 4px;
}

/* Two-column row — splits evenly */
.sim-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

    /* Single-column full-width override */
    .sim-field-row.sim-field-full {
        grid-template-columns: 1fr;
    }

/* Mobile: stack to single column */
@media (max-width: 600px) {
    .sim-field-row {
        grid-template-columns: 1fr;
    }
}

/* Partner found / not-found info strips */
.sim-partner-found,
.sim-partner-notfound {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
}

.sim-partner-found {
    background: #e8f5e9;
    color: #2e7d32;
}

.sim-partner-found-icon {
    color: #2e7d32;
    font-size: 1.1rem;
}

.sim-partner-notfound {
    background: #fff3e0;
    color: #e65100;
}

.sim-partner-notfound-icon {
    color: #e65100;
    font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════
   Dashboard — New Activations panel
   ═══════════════════════════════════════════════════════════════ */

.db-activation-card {
    margin-top: 20px;
}

/* Top row: left = label + big number | right = period switcher */
.db-activation-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

/* "↗ Activation Trends" label */
.db-activation-trend-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

/* Big number + % badge */
.db-activation-total {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Coloured % change badge */
.db-activation-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.db-activation-badge.positive {
    background: #e8f5e9;
    color: #2e7d32;
}

.db-activation-badge.negative {
    background: #ffebee;
    color: #c62828;
}

/* Period switcher aligned to the right */
.db-activation-period-switcher {
    flex-shrink: 0;
    align-self: center;
}

/* 2-column MoM / YoY stat cards */
.db-activation-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* 2-column chart area */
.db-activation-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Small upper-case label above each chart */
.db-activation-chart-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

@media (max-width: 900px) {
    .db-activation-stats,
    .db-activation-charts {
        grid-template-columns: 1fr;
    }
}

/* ── Top 5 Popular Plans ─────────────────────────────────────────────── */

/* Side-by-side prepaid / postpaid chart columns */
.db-plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 900px) {
    .db-plans-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Performance Metrics ──────────────────────────────────────────────── */

/* Side-by-side left/right panels */
.db-perf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Each panel (terminations / top partners) */
.db-perf-panel {
    padding: 20px;
    border-radius: 8px;
}

/* Two stat cards (Total Terminations + Rate) side by side */
.db-perf-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 4px;
}

/* Individual stat card inside the perf panel */
.db-perf-stat-card {
    padding: 14px 16px;
    border-radius: 6px;
}

/* Table inside the perf panel */
.db-perf-table {
    width: 100%;
}

.db-perf-table th,
.db-perf-table td {
    font-size: 0.82rem;
}

/* Placeholder for the "coming soon" right panel */
.db-perf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 260px;
    color: var(--mud-palette-text-secondary);
}

@media (max-width: 960px) {
    .db-perf-grid,
    .db-perf-stats-row {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Commission Manager page
   ═══════════════════════════════════════════════════════════════ */

/* Monetary amounts in grid cells */
.cm-amount {
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
}

.cm-positive {
    color: #2e7d32;
}

.cm-negative {
    color: #c62828;
}

/* ── Commission edit dialog ─────────────────────────────── */

/* Commission details card */
.cm-detail-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px 20px;
}

.cm-detail-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 14px;
}

.cm-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 32px;
}

.cm-detail-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cm-detail-label {
    font-size: 0.78rem;
    color: #6b7280;
}

.cm-detail-value {
    font-size: 0.95rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.cm-net {
    color: #1565c0;
    font-size: 1rem;
    font-weight: 700;
}

/* Adjustment amount row with +/- buttons */
.cm-adj-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.cm-adj-row {
    display: flex;
    align-items: stretch;
    border: 1px solid rgba(0,0,0,0.23);
    border-radius: 4px;
    overflow: hidden;
}

.cm-adj-btn {
    background: #f3f4f6;
    border: none;
    padding: 0 14px;
    font-size: 1.1rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}

.cm-adj-btn:hover {
    background: #e5e7eb;
}

.cm-adj-input {
    flex: 1;
    border-radius: 0 !important;
}

.cm-adj-input .mud-input-outlined-border {
    border: none !important;
}

.cm-adj-input .mud-input-root {
    border-radius: 0;
}

/* Helper text below fields */
.cm-helper-text {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 3px;
    padding-left: 2px;
}

/* Character counter below textarea */
.cm-char-count {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 3px;
    padding-left: 2px;
}

/* ── Reports page ─────────────────────────────────────────────────── */
.rp-tabs {
    margin-bottom: 0;
}

.rp-summary-chips {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.rp-no-child-rows tr:has(> td[colspan="1000"]) {
    display: none !important;
}

.rp-usage-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
}

.rp-usage-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.rp-usage-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1976d2;
}

/* ═══════════════════════════════════════════════════════════════
   Announcement dialog — target-mode toggle buttons.
   Global because the markup lives inside MudDialog DialogContent.
   ═══════════════════════════════════════════════════════════════ */

.an-mode-row {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
}

.an-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    background: #fff;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
}

.an-mode-btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

/* Active = solid filled blue — unmistakably selected */
.an-mode-btn.active {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
}


