/* ═══════════════════════════════════════════════
   LicenseHub Admin — Shared Styles
   ═══════════════════════════════════════════════
   Sections:
     1. Base / Resets / Utilities
     2. Layout (grids, page headers, detail layouts)
     3. Components — Shared (badges, cards, dialogs)
     4. Components — Stats Cards
     5. Components — Tables & Cells
     6. Pages — Dashboard
     7. Pages — Licenses (list + dialogs)
     8. Pages — Invoices (list + details)
     9. Pages — Devices (list + details)
    10. Pages — Applications
    11. Pages — Pricing Tiers
    12. Pages — Users
    13. Pages — Access Logs
    14. Pages — Notifications
    15. Pages — Whitelist
    16. Pages — Email Outbox
    17. Pages — Portal (customer-facing)
    18. Pages — Auth (login, forgot/reset password)
    19. Pages — Profile
   ═══════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════
   1. Base / Resets / Utilities
   ═══════════════════════════════════════════════ */

/* Monospace font stack (reused across many components) */


/* ── Nav Brand & Section Labels ── */
.nav-brand {
    padding: 16px 20px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default, #E5E7EB);
    margin-bottom: 8px;
}
.nav-brand h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--mud-palette-primary, #1565C0);
    letter-spacing: -0.3px;
    margin: 0;
}
.nav-brand span {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary, #9CA3AF);
    font-weight: 500;
}
.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mud-palette-text-secondary, #9CA3AF);
    padding: 12px 24px 4px;
}

/* ═══════════════════════════════════════════════
   2. Layout
   ═══════════════════════════════════════════════ */

/* ── Page Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* ── Redesigned Page Header ── */
.page-header-redesign {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header-redesign h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
    line-height: 1.2;
    outline: none;
}
.page-header-redesign h1::selection {
    background: transparent;
}
.page-header-redesign p {
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stats-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ── Detail Page Layout: sidebar + main ── */
.detail-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 960px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

/* ── Filters Bar ── */
.filters-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; margin-bottom: 16px;
    background: #fff; border: 1px solid var(--mud-palette-lines-default); border-radius: 12px;
    flex-wrap: wrap;
}
.filters-bar .filter-count {
    margin-left: auto;
}
.filters-bar > * {
    flex-grow: 0;
    flex-shrink: 0;
}
.filter-divider {
    width: 1px; height: 24px;
    background: var(--mud-palette-lines-default); flex-shrink: 0;
    margin: 0 4px;
}

/* ── Fix date picker popover clipping ── */
.mud-popover-open:has(.mud-picker-inline-paper) {
    min-width: 320px !important;
    width: auto !important;
}

.mud-popover .mud-picker-inline-paper,
.mud-popover .mud-picker-inline-paper .mud-picker-paper {
    min-width: 320px !important;
    max-width: none !important;
}


/* ═══════════════════════════════════════════════
   3. Components — Shared (badges, cards, dialogs)
   ═══════════════════════════════════════════════ */

/* ── Status Badge (shared across all pages) ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 700;
}
.status-badge--active { background: #E8F5E9; color: #2E7D32; }
.status-badge--expired { background: #FFEBEE; color: #C62828; }
.status-badge--trial { background: #E1F5FE; color: #0288D1; }
.status-badge--revoked { background: #F5F5F5; color: #9E9E9E; }
.status-badge--pendingrenewal { background: #FFF3E0; color: #F57C00; }
.status-badge--suspended { background: #F5F5F5; color: #9E9E9E; }
.status-badge--graceperiod { background: #FFF3E0; color: #F57C00; }
.status-badge--inactive { background: #F5F5F5; color: #9E9E9E; }
.status-badge--locked { background: #FFEBEE; color: #C62828; }
.status-badge--draft { background: #F5F5F5; color: #616161; }
.status-badge--sent { background: #E3F2FD; color: #1565C0; }
.status-badge--paid { background: #E8F5E9; color: #2E7D32; }
.status-badge--overdue { background: #FFEBEE; color: #C62828; }
.status-badge--cancelled { background: #F5F5F5; color: #9E9E9E; }
.status-badge--failed { background: #FFEBEE; color: #C62828; }

.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ── Pill Badges (dashboard tables) ── */
.pill-error {
    display: inline-block;
    background: #FFEBEE;
    color: #C62828;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
}
.pill-warning {
    display: inline-block;
    background: #FFF3E0;
    color: #F57C00;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
}
.pill-success {
    display: inline-block;
    background: #E8F5E9;
    color: #2E7D32;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
}

/* ── License Key Display ── */
.license-key {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.85em;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: var(--mud-palette-background-grey);
}

/* ── License Key Mono (detail pages) ── */
.license-key-mono {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ── Cell with Icon (reusable) ── */
.cell-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cell-icon {
    width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 18px;
}
.cell-primary { font-weight: 600; font-size: 0.84rem; }

/* ── Feature Chip ── */
.feature-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 600;
    background: #F3E5F5; color: #7B1FA2; cursor: default;
}

/* ── Filter Chips ── */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--mud-palette-lines-default);
    background: white;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.filter-chip:hover {
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary);
}
.filter-chip--active {
    background: var(--mud-palette-primary);
    border-color: var(--mud-palette-primary);
    color: white;
}
.filter-chip--active:hover {
    color: white;
}
.filter-chip > span[style*="border-radius: 50%"] {
    flex-shrink: 0;
}
.filter-count {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
.filter-clear {
    font-size: 0.78rem;
    color: var(--mud-palette-primary, #1565C0);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    background: none;
    border: none;
    font-family: inherit;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.filter-clear:hover {
    background: var(--mud-palette-primary-lighten, #E3F2FD);
}

/* ── Dialog Gradient Headers (shared across CRUD dialogs) ── */
.dialog-header-gradient {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -24px -24px 0;
    padding: 24px 32px;
}
.dialog-header-gradient--blue {
    background: linear-gradient(135deg, #1565C0 0%, #1976D2 50%, #00897B 100%);
}
.dialog-header-gradient--teal {
    background: linear-gradient(135deg, #00897B 0%, #00ACC1 100%);
}
.dialog-header-gradient--purple {
    background: linear-gradient(135deg, #7B1FA2 0%, #9C27B0 100%);
}
.dialog-header-gradient--orange {
    background: linear-gradient(135deg, #F57C00 0%, #FF9800 100%);
}
.dialog-header-gradient--danger {
    background: linear-gradient(135deg, #C62828 0%, #E53935 100%);
}
.dialog-header-gradient--success {
    background: linear-gradient(135deg, #2E7D32 0%, #43A047 100%);
}
.dialog-header-gradient--info {
    background: linear-gradient(135deg, #1565C0 0%, #039BE5 100%);
}
.dialog-header-gradient--warning {
    background: linear-gradient(135deg, #E65100 0%, #F57C00 100%);
}

.dialog-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.dialog-header-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}
.dialog-header-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}
.dialog-header-subtitle {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
}

/* ── CRUD Dialog Section Headers (numbered) ── */
.crud-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    margin-top: 20px;
}
.crud-section-header:first-child { margin-top: 0; }

.crud-section-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}
.crud-section-number--1 { background: #1565C0; }
.crud-section-number--2 { background: #00897B; }
.crud-section-number--3 { background: #7B1FA2; }

.crud-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--mud-palette-text-secondary);
}

.crud-section-divider {
    flex: 1;
    height: 1px;
    background: var(--mud-palette-lines-default);
}

/* ── Action Dialog Styles ── */
.action-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.action-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.action-detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mud-palette-text-secondary);
}
.action-detail-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.action-info-card {
    background: #F8FAFC;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 16px;
}


/* ═══════════════════════════════════════════════
   4. Components — Stats Cards
   ═══════════════════════════════════════════════ */

/* ── Original Stat Card (StatCard.razor component) ── */
.stat-card {
    transition: box-shadow 0.2s ease-in-out;
}
.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

/* ── Stat Card V2 (redesigned pages) ── */
.stat-card-v2 {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--mud-palette-lines-default);
    transition: all 0.2s;
    cursor: default;
    position: relative;
    overflow: hidden;
}
.stat-card-v2::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-card-v2--blue::before { background: var(--mud-palette-primary); }
.stat-card-v2--green::before { background: var(--mud-palette-success); }
.stat-card-v2--orange::before { background: var(--mud-palette-warning); }
.stat-card-v2--purple::before { background: #7B1FA2; }
.stat-card-v2--red::before { background: #C62828; }
.stat-card-v2--teal::before { background: #00897B; }
.stat-card-v2:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.stat-card-v2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.stat-card-v2-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-card-v2-icon--blue { background: #E3F2FD; color: var(--mud-palette-primary); }
.stat-card-v2-icon--green { background: #E8F5E9; color: var(--mud-palette-success); }
.stat-card-v2-icon--orange { background: #FFF3E0; color: var(--mud-palette-warning); }
.stat-card-v2-icon--purple { background: #F3E5F5; color: #7B1FA2; }
.stat-card-v2-icon--red { background: #FFEBEE; color: #C62828; }
.stat-card-v2-icon--teal { background: #E0F2F1; color: #00897B; }
.stat-card-v2-trend {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}
.stat-card-v2-trend--up { background: #E8F5E9; color: var(--mud-palette-success); }
.stat-card-v2-trend--down { background: #FFEBEE; color: var(--mud-palette-error); }
.stat-card-v2-trend--neutral { background: #F3F4F6; color: var(--mud-palette-text-secondary); }
.stat-card-v2-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1;
}
.stat-card-v2-label {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 4px;
    font-weight: 500;
}
.stat-card-v2-warning-sub {
    font-size: 0.68rem;
    color: #F57C00;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.stat-currency { font-size: 1.4rem; }

/* ── Quick Stats Mini Cards (detail pages) ── */
.quick-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stat-mini {
    background: #F8FAFC;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}
.stat-mini-value {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.stat-mini-value--sm {
    font-size: 1.4rem;
}
.stat-mini-label {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
    margin-top: 3px;
}


/* ═══════════════════════════════════════════════
   5. Components — Tables & Cells
   ═══════════════════════════════════════════════ */

/* ── Table Action Link ── */
.table-action-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1565C0;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}
.table-action-link:hover { background: #E3F2FD; }

/* ── License Key Cell ── */
.license-key-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.license-key-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.license-key-icon--active { background: #E8F5E9; color: #2E7D32; }
.license-key-icon--expired { background: #FFEBEE; color: #C62828; }
.license-key-icon--trial { background: #E1F5FE; color: #0288D1; }
.license-key-icon--revoked { background: #F5F5F5; color: #9E9E9E; }
.license-key-icon--warning { background: #FFF3E0; color: #F57C00; }
.license-key-icon--suspended { background: #F5F5F5; color: #9E9E9E; }
.license-key-icon--grace { background: #FFF3E0; color: #F57C00; }
.license-key-text {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.license-key-sub {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 400;
    margin-top: 1px;
}

/* ── Customer Cell ── */
.customer-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.customer-avatar {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    color: white;
}
.customer-name { font-weight: 600; font-size: 0.84rem; }
.customer-code { font-size: 0.7rem; color: var(--mud-palette-text-secondary); }

/* ── Tier Badge V2 ── */
.tier-badge-v2 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}
.tier-badge-v2--lite { background: #F5F5F5; color: #616161; }
.tier-badge-v2--standard { background: #E8F5E9; color: #2E7D32; }
.tier-badge-v2--pro { background: #FFF3E0; color: #E65100; }
.tier-badge-v2--enterprise { background: #F3E5F5; color: #7B1FA2; }
.tier-badge-v2--trial { background: #E1F5FE; color: #0288D1; }

/* ── Seats Cell ── */
.seats-cell-v2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Expiry Cell ── */
.expiry-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}
.expiry-date {
    font-size: 0.82rem;
    font-weight: 500;
}
.expiry-days {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}
.expiry-days--soon { color: #F57C00; font-weight: 600; }
.expiry-days--expired { color: #C62828; font-weight: 600; }


/* ═══════════════════════════════════════════════
   6. Pages — Dashboard
   ═══════════════════════════════════════════════ */

.stats-section { margin-bottom: 24px; }

/* ── Chart Cards ── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.chart-card {
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    overflow: hidden;
}
.chart-card-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chart-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}
.chart-card-subtitle {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 1px;
}
.chart-card-body {
    padding: 20px;
}

/* ── Dashboard Section Headings ── */
.dash-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    margin-top: 4px;
}
.dash-section-heading-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dash-section-heading h2 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin: 0;
}
.dash-section-heading-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
}

/* ── Dashboard Table Card ── */
.dash-table-card {
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}
.dash-table-card table {
    width: 100%;
    border-collapse: collapse;
}
.dash-table-card thead {
    background: #F8FAFC;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.dash-table-card th {
    padding: 12px 16px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--mud-palette-text-secondary);
    text-align: left;
}
.dash-table-card td {
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--mud-palette-text-primary);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    vertical-align: middle;
}
.dash-table-card tr:last-child td { border-bottom: none; }
.dash-table-card tr:hover td { background: #FAFBFD; }
.dash-table-card tr { transition: background 0.1s; }

/* ── Dashboard Cell Helpers ── */
.dash-cell-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dash-avatar {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    color: white;
}
.dash-cell-primary { font-weight: 600; font-size: 0.84rem; }
.dash-cell-secondary { font-size: 0.7rem; color: var(--mud-palette-text-secondary); margin-top: 1px; }
.dash-cell-mono {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ── Seats Usage Bar (dashboard) ── */
.dash-seats-usage {
    margin-top: 8px;
}
.dash-seats-usage-bar {
    height: 5px;
    background: #F3F4F6;
    border-radius: 3px;
    overflow: hidden;
}
.dash-seats-usage-fill {
    height: 100%;
    border-radius: 3px;
}


/* ═══════════════════════════════════════════════
   7. Pages — Licenses (list + dialogs)
   ═══════════════════════════════════════════════ */

/* ── Issue License Dialog ── */
.ld-dialog .mud-dialog {
    max-width: 920px;
}
.ld-dialog .mud-dialog-content {
    padding: 0 !important;
    overflow: visible;
}
.ld-dialog .mud-dialog-title {
    background: linear-gradient(135deg, #1565C0 0%, #1976D2 50%, #00897B 100%);
    padding: 20px 28px !important;
}
.ld-dialog .mud-dialog-actions {
    display: none !important;
}

.ld-two-col {
    display: grid;
    grid-template-columns: 1fr 320px;
    min-height: 520px;
}

.ld-config-panel {
    padding: 28px 32px;
    overflow-y: auto;
    max-height: 70vh;
}

.ld-section-v2 {
    margin-bottom: 24px;
}
.ld-section-v2:last-child { margin-bottom: 0; }

.ld-section-header-v2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.ld-section-number {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}
.ld-section-number--1 { background: #1565C0; }
.ld-section-number--2 { background: #00897B; }
.ld-section-number--3 { background: #7B1FA2; }
.ld-section-title-v2 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--mud-palette-text-secondary);
}
.ld-section-divider {
    flex: 1;
    height: 1px;
    background: var(--mud-palette-lines-default);
}

/* ── Tier Selection Cards ── */
.ld-tier-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.ld-tier-card {
    border: 2px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--mud-palette-surface);
    position: relative;
}
.ld-tier-card:hover {
    border-color: var(--mud-palette-primary);
    transform: translateY(-1px);
}
.ld-tier-card--selected {
    border-color: var(--mud-palette-primary);
    background: #E3F2FD;
    box-shadow: 0 0 0 1px var(--mud-palette-primary);
}
.ld-tier-card--selected .ld-tier-name { color: var(--mud-palette-primary); }
.ld-tier-card-popular {
    position: absolute;
    top: -8px; right: -6px;
    background: #F57C00;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ld-tier-icon { font-size: 22px; margin-bottom: 4px; }
.ld-tier-icon--lite { color: #9E9E9E; }
.ld-tier-icon--standard { color: #43A047; }
.ld-tier-icon--pro { color: #F57C00; }
.ld-tier-icon--enterprise { color: #7B1FA2; }
.ld-tier-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}
.ld-tier-price {
    font-size: 0.68rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

/* ── Features Tags ── */
.ld-features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.ld-feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 14px;
    background: #E8F5E9;
    color: #2E7D32;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ── Duration Presets ── */
.ld-duration-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.ld-duration-pill {
    padding: 8px 18px;
    border-radius: 24px;
    border: 1.5px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--mud-palette-text-primary);
}
.ld-duration-pill:hover { border-color: #00897B; color: #00897B; }
.ld-duration-pill--selected {
    background: #00897B;
    color: white;
    border-color: #00897B;
}

/* ── Toggle Rows ── */
.ld-toggle-row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 0;
}

/* ── Summary Panel ── */
.ld-summary-panel {
    background: #F8FAFC;
    border-left: 1px solid var(--mud-palette-lines-default);
    display: flex;
    flex-direction: column;
}
.ld-summary-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.ld-summary-header h3 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--mud-palette-text-secondary);
    margin: 0;
}
.ld-summary-body {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ld-summary-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.ld-summary-item-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ld-summary-item-icon--customer { background: #E3F2FD; color: #1565C0; }
.ld-summary-item-icon--app { background: #E0F2F1; color: #00897B; }
.ld-summary-item-icon--tier { background: #F3E5F5; color: #7B1FA2; }
.ld-summary-item-icon--duration { background: #FFF3E0; color: #F57C00; }
.ld-summary-item-icon--seats { background: #E8EAF6; color: #3949AB; }
.ld-summary-item-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ld-summary-item-value {
    font-size: 0.88rem;
    font-weight: 600;
    margin-top: 1px;
}
.ld-summary-item-sub {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
}
.ld-summary-total {
    margin-top: auto;
    border-top: 1px solid var(--mud-palette-lines-default);
    padding: 20px 24px;
    background: white;
}
.ld-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}
.ld-total-line-label {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
}
.ld-total-line-value {
    font-size: 0.82rem;
    font-weight: 600;
}
.ld-total-divider {
    height: 1px;
    background: var(--mud-palette-lines-default);
    margin: 8px 0;
}
.ld-total-grand {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0 16px;
}
.ld-total-grand-label {
    font-size: 0.85rem;
    font-weight: 700;
}
.ld-total-grand-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--mud-palette-primary);
    letter-spacing: -0.5px;
}
.ld-total-invoice-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #E3F2FD;
    border-radius: 6px;
    margin-bottom: 16px;
}
.ld-total-invoice-note span {
    font-size: 0.72rem;
    color: #0D47A1;
    font-weight: 500;
}
.ld-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ld-btn-issue {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1565C0 0%, #1976D2 100%);
    color: white;
    border: none;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
}
.ld-btn-issue:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(21, 101, 192, 0.4);
}
.ld-btn-issue:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.ld-btn-cancel {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}
.ld-btn-cancel:hover { color: var(--mud-palette-text-primary); }

/* ── License Details Dialog ── */
.license-details-dialog .mud-dialog-content {
    padding: 0 !important;
    margin-top: 0 !important;
    overflow: hidden;
}

.license-detail-hero {
    position: relative;
    background: linear-gradient(135deg, #1565C0 0%, #1976D2 50%, #00897B 100%);
    padding: 24px 24px 20px;
}
.license-detail-hero .detail-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.license-detail-hero .detail-close-btn:hover {
    background: rgba(255,255,255,0.3);
}

.license-detail-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.license-key-display {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
}

.license-detail-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
}

@media (max-width: 800px) {
    .license-detail-body {
        grid-template-columns: 1fr;
    }
}

.license-detail-sidebar {
    padding: 20px;
    border-right: 1px solid var(--mud-palette-lines-default);
    background: #FAFBFD;
}

.license-detail-main {
    padding: 20px;
    overflow-y: auto;
    max-height: 65vh;
}

/* Info section card within the overview */
.ld-info-section {
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.ld-info-section-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FAFBFD;
}

.ld-info-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--mud-palette-text-secondary);
}

.ld-info-section-body {
    padding: 20px;
}

.ld-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.ld-info-grid-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ld-info-grid-value {
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Timeline visual */
.ld-timeline-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--mud-palette-lines-default);
    position: relative;
}

.ld-timeline-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #2E7D32 0%, #1565C0 100%);
}

.ld-timeline-marker {
    position: absolute;
    top: -4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1565C0;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.ld-timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}

/* Pricing rows */
.ld-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.ld-pricing-row:last-child { border-bottom: none; }
.ld-pricing-label { font-size: 0.8rem; color: var(--mud-palette-text-secondary); font-weight: 500; }
.ld-pricing-value { font-size: 0.88rem; font-weight: 700; }

/* Progress bar for seats */
.ld-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #F3F4F6;
    overflow: hidden;
}
.ld-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

/* ── License Details Tabs ── */
.ld-tabs-bar {
    display: flex;
    gap: 0;
    background: #FAFBFD;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    padding: 0 20px;
    margin: -20px -20px 20px;
}
.ld-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.ld-tab:hover {
    color: var(--mud-palette-text-primary);
    background: rgba(0,0,0,0.02);
}
.ld-tab--active {
    color: #1565C0;
    font-weight: 600;
    border-bottom-color: #1565C0;
}
.ld-tab-content {
    min-height: 300px;
}


/* ═══════════════════════════════════════════════
   8. Pages — Invoices (list + details)
   ═══════════════════════════════════════════════ */

/* ── Invoice Type Badges ── */
.invoice-type-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}
.invoice-type-badge--newlicense { background: #E3F2FD; color: #1565C0; }
.invoice-type-badge--renewal { background: #F3E5F5; color: #7B1FA2; }
.invoice-type-badge--upgrade { background: #F5F5F5; color: #616161; }
.invoice-type-badge--custom { background: #FFF3E0; color: #F57C00; }

/* ── Overdue Row Tint ── */
.overdue-row td { background: #FFF8F8 !important; }
.overdue-row:hover td { background: #FFF0F0 !important; }

/* ── Invoice Amount Cell ── */
.invoice-amount {
    text-align: right;
    font-weight: 700;
    font-size: 0.9rem;
}
.invoice-amount-currency {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
    margin-left: 2px;
}

/* ── Overdue Warning Icon ── */
.overdue-warning-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 4px;
}
.overdue-warning-icon .mud-icon-root { font-size: 15px; color: #C62828; }

/* ── Invoice Number (monospace, clickable) ── */
.invoice-number {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #1565C0;
    cursor: pointer;
}
.invoice-number:hover { text-decoration: underline; }

/* ── Invoice Totals Section (original) ── */
.invoice-totals {
    min-width: 280px;
}
.invoice-totals .total-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}
.invoice-totals .total-row.grand-total {
    font-weight: 700;
    font-size: 1.1em;
    border-top: 2px solid var(--mud-palette-lines-default);
    padding-top: 8px;
    margin-top: 4px;
}

/* ── Invoice Details Page ── */

/* Invoice stepper */
.invoice-stepper {
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    padding: 20px 32px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    min-width: 60px;
}
.step--done { color: #1565C0; font-weight: 600; }
.step--active { color: #1565C0; font-weight: 700; }

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--mud-palette-lines-default);
    color: var(--mud-palette-text-secondary);
}
.step--done .step-circle { background: #1565C0; color: white; }
.step--active .step-circle { background: #1565C0; color: white; box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.15); }
.step--error .step-circle { background: #C62828; color: white; }
.step--error { color: #C62828; font-weight: 600; }

.step-connector {
    width: 80px;
    height: 2px;
    background: var(--mud-palette-lines-default);
    margin: 0 8px;
    margin-bottom: 20px;
}
.step-connector--done { background: #1565C0; }

/* 3-column info cards */
.info-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 960px) {
    .info-cards-row { grid-template-columns: 1fr; }
}

.info-card {
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    overflow: hidden;
}
.info-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    font-size: 0.88rem;
    font-weight: 700;
}
.info-card-body { padding: 16px 20px; }

.info-block { margin-bottom: 12px; }
.info-block:last-child { margin-bottom: 0; }
.info-label {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.info-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

/* Totals card */
.invoice-totals-card {
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    overflow: hidden;
    margin-left: auto;
    width: 320px;
    margin-top: 16px;
}
.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    font-size: 0.85rem;
}
.totals-row:last-child { border-bottom: none; }
.totals-row-label { color: var(--mud-palette-text-secondary); font-weight: 500; }
.totals-row-value { font-weight: 600; }
.totals-row--total {
    background: #E3F2FD;
    border-bottom: none;
    padding: 14px 20px;
}
.totals-row--total .totals-row-label { font-weight: 700; color: #1565C0; font-size: 0.95rem; }
.totals-row--total .totals-row-value { font-weight: 800; color: #1565C0; font-size: 1.05rem; }
.totals-row--vat { background: #F8FAFC; }
.totals-row--vat .totals-row-label,
.totals-row--vat .totals-row-value { font-size: 0.78rem; color: var(--mud-palette-text-secondary); font-weight: 500; }

/* Customer link */
.customer-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: #1565C0;
    font-weight: 600;
    text-decoration: none;
    margin-top: 8px;
    cursor: pointer;
}
.customer-link:hover { text-decoration: underline; }

/* Customer avatar small (for info cards) */
.customer-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Line items table styling */
.line-items-table .mud-table-cell:nth-child(1) {
    width: 40px;
    color: var(--mud-palette-text-secondary);
}
.line-items-desc-main {
    font-weight: 600;
    font-size: 0.85rem;
}
.line-items-desc-sub {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

/* Payment awaiting block */
.payment-awaiting-block {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    background: #FFF8E1;
    border-radius: 8px;
}

/* Invoice summary (in dialogs) */
.invoice-summary-card {
    background: #F8FAFC;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.invoice-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
}
.invoice-summary-row--total {
    font-weight: 800;
    font-size: 1rem;
    border-top: 1px solid var(--mud-palette-lines-default);
    padding-top: 8px;
    margin-top: 4px;
}


/* ═══════════════════════════════════════════════
   9. Pages — Devices (list + details)
   ═══════════════════════════════════════════════ */

/* ── Device ID Cell (monospace, background highlight) ── */
.device-id-cell {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: #F8FAFC;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--mud-palette-lines-default);
    white-space: nowrap;
}

/* ── Device Type Badges ── */
.device-type-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}
.device-type-badge--server { background: #F3E5F5; color: #7B1FA2; }
.device-type-badge--desktop { background: #E0F2F1; color: #00897B; }
.device-type-badge--tablet { background: #E1F5FE; color: #0288D1; }
.device-type-badge--phone { background: #E1F5FE; color: #0288D1; }
.device-type-badge--selfservice { background: #FFF3E0; color: #F57C00; }
.device-type-badge--client { background: #EDE7F6; color: #5E35B1; }

/* ── Platform Cell ── */
.device-platform-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
}

/* ── Last Seen Colors ── */
.device-last-seen--recent { color: #2E7D32; font-weight: 600; }
.device-last-seen--moderate { color: var(--mud-palette-text-secondary); }
.device-last-seen--old { color: var(--mud-palette-text-secondary); }

/* ── Device Details Page ── */
.device-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: linear-gradient(160deg, #E3F2FD 0%, #F5F7FA 100%);
}

.device-hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1565C0 0%, #1976D2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(21, 101, 192, 0.35);
}

.device-hero-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    text-align: center;
}

.device-hero-customer {
    font-size: 0.82rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.device-id-block {
    background: #F8FAFC;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    word-break: break-all;
    line-height: 1.6;
    color: var(--mud-palette-text-primary);
}

.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.meta-row:last-child { border-bottom: none; }

.meta-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.76rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
}

.meta-value {
    font-size: 0.84rem;
    font-weight: 600;
    text-align: right;
}


/* ═══════════════════════════════════════════════
   10. Pages — Applications
   ═══════════════════════════════════════════════ */

.app-code-badge {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: #F8FAFC;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--mud-palette-lines-default);
}
.app-name-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.app-name-icon--active { background: #E3F2FD; color: #1565C0; }
.app-name-icon--inactive { background: #F5F5F5; color: #9E9E9E; }
.app-count-label {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.app-count-label--info { background: #E1F5FE; color: #0288D1; }
.app-count-label--primary { background: #E3F2FD; color: #1565C0; }


/* ═══════════════════════════════════════════════
   11. Pages — Pricing Tiers
   ═══════════════════════════════════════════════ */

/* (Uses shared .cell-with-icon, .cell-icon, .cell-primary, .feature-chip, .filters-bar) */


/* ═══════════════════════════════════════════════
   12. Pages — Users
   ═══════════════════════════════════════════════ */

/* ── Role Badges ── */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}
.role-badge--admin { background: #F3E5F5; color: #7B1FA2; }
.role-badge--operator { background: #E3F2FD; color: #1565C0; }
.role-badge--viewer { background: #E1F5FE; color: #0288D1; }
.role-badge--customer { background: #E8F5E9; color: #2E7D32; }

/* ── Role Filter Dots ── */
.role-filter-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
    position: relative;
    top: -1px;
    margin-right: 2px;
}
.role-filter-dot--admin { background: #7B1FA2; }
.role-filter-dot--operator { background: #1565C0; }
.role-filter-dot--viewer { background: #0288D1; }
.role-filter-dot--customer { background: #2E7D32; }

/* ── Password Strength Bar (dialogs) ── */
.password-strength-bar {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}
.password-strength-segment {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--mud-palette-lines-default);
}
.password-strength-segment--active { background: #4CAF50; }
.password-strength-segment--weak { background: #F44336; }
.password-strength-segment--medium { background: #FF9800; }

/* ── User Info Card (dialogs) ── */
.user-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-info-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0, #00897B);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════
   13. Pages — Access Logs
   ═══════════════════════════════════════════════ */

/* ── Access Log Action Badges ── */
.action-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.action-badge--validate { background: #E3F2FD; color: #1565C0; }
.action-badge--issue { background: #E8F5E9; color: #2E7D32; }
.action-badge--revoke { background: #FFEBEE; color: #C62828; }
.action-badge--extend { background: #FFF3E0; color: #F57C00; }
.action-badge--login { background: #EDE7F6; color: #5E35B1; }
.action-badge--logout { background: #F5F5F5; color: #757575; }

/* ── Access Log IP Cell ── */
.ip-cell {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

/* ── Access Log Device Cell ── */
.device-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    color: var(--mud-palette-text-secondary);
    display: block;
}


/* ═══════════════════════════════════════════════
   14. Pages — Notifications
   ═══════════════════════════════════════════════ */

.notification-list {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    transition: background 0.15s;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: #FAFBFD; }

.notification-item--unread {
    background: #F8FBFF;
}
.notification-item--unread:hover {
    background: #F0F6FF;
}

.notification-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mud-palette-primary);
    flex-shrink: 0;
    margin-top: 8px;
}

.notification-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
    margin-bottom: 2px;
}
.notification-title--read {
    color: var(--mud-palette-text-secondary);
}

.notification-message {
    font-size: 0.82rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.45;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.notification-load-more {
    display: flex;
    justify-content: center;
    padding: 16px;
    border-top: 1px solid var(--mud-palette-lines-default);
}


/* ═══════════════════════════════════════════════
   15. Pages — Whitelist
   ═══════════════════════════════════════════════ */

/* ── Expires Badges ── */
.expires-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.expires-badge--never { background: #E8F5E9; color: #2E7D32; }
.expires-badge--date { background: #F3F4F6; color: var(--mud-palette-text-secondary); }
.expires-badge--expired { background: #FFEBEE; color: #C62828; }


/* ═══════════════════════════════════════════════
   16. Pages — Email Outbox
   ═══════════════════════════════════════════════ */

/* ── Template Badges ── */
.template-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}
.template-badge--license-issued  { background: #E3F2FD; color: #1565C0; }
.template-badge--invoice-created { background: #E8F5E9; color: #2E7D32; }
.template-badge--password-reset  { background: #F3E5F5; color: #7B1FA2; }
.template-badge--license-expiring { background: #FFF3E0; color: #E65100; }
.template-badge--invoice-paid    { background: #E0F2F1; color: #00695C; }
.template-badge--default         { background: #F5F5F5; color: #616161; }

/* ── Error Tooltip Indicator ── */
.error-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #FFEBEE;
    cursor: pointer;
}

/* ── Footer Summary ── */
.table-footer-summary {
    font-size: 0.82rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
    padding: 8px 16px;
    white-space: nowrap;
}


/* ═══════════════════════════════════════════════
   Detail Pages — Shared Layout
   ═══════════════════════════════════════════════ */

/* Detail sidebar cards */
.detail-sidebar .mud-paper {
    border-radius: 16px;
    overflow: hidden;
}

/* Hero section in detail sidebar */
.detail-hero {
    padding: 24px 20px;
}

.detail-hero-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(21, 101, 192, 0.3);
}

.detail-hero-name {
    font-size: 1rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
}

.detail-hero-code {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.75);
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    margin-top: 2px;
}

.detail-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.detail-hero-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.detail-hero-since {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
}

/* Info rows */
.detail-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    font-size: 0.85rem;
}
.detail-info-row:last-child { border-bottom: none; }
.detail-info-row .mud-icon-root {
    font-size: 17px;
    color: var(--mud-palette-text-secondary);
    flex-shrink: 0;
    width: 20px;
}
.detail-info-row-label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    width: 72px;
    flex-shrink: 0;
}
.detail-info-row-value {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    flex: 1;
}

/* Notes block */
.detail-notes-block {
    background: #FFF8E1;
    border-left: 3px solid #FF8F00;
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #5D4037;
    line-height: 1.5;
}

/* Detail main area tabs styling */
.detail-tabs-header {
    padding: 0 20px;
    background: #FAFBFD;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* Breadcrumb styling */
.detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 20px;
}
.detail-breadcrumb a {
    color: #1565C0;
    text-decoration: none;
    font-weight: 600;
}
.detail-breadcrumb a:hover {
    text-decoration: underline;
}

/* ── Customer Timeline ── */
.tl-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #F3F4F6;
}
.tl-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid #E5E7EB;
    background: white;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s;
}
.tl-filter-chip:hover {
    border-color: #1565C0;
    color: #1565C0;
}
.tl-filter-chip--active {
    background: #1565C0;
    color: white;
    border-color: #1565C0;
}
.tl-filter-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: #9CA3AF;
    font-weight: 500;
}

.tl-day-group + .tl-day-group { margin-top: 28px; }
.tl-day-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9CA3AF;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tl-day-line {
    flex: 1;
    height: 1px;
    background: #F3F4F6;
}

.tl-track {
    position: relative;
    padding-left: 44px;
}
.tl-track::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #E5E7EB 0%, #F3F4F6 100%);
    border-radius: 1px;
}

.tl-event {
    position: relative;
    margin-bottom: 4px;
}
.tl-bullet {
    position: absolute;
    left: -44px;
    top: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 0 0 4px white, 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.15s;
}
.tl-bullet--license { background: linear-gradient(135deg, #7B1FA2, #9C27B0); }
.tl-bullet--invoice { background: linear-gradient(135deg, #2E7D32, #43A047); }
.tl-bullet--email   { background: linear-gradient(135deg, #1565C0, #1E88E5); }
.tl-bullet--device  { background: linear-gradient(135deg, #00897B, #26A69A); }
.tl-bullet--error   { background: linear-gradient(135deg, #C62828, #E53935); }
.tl-bullet--system  { background: linear-gradient(135deg, #546E7A, #78909C); }

.tl-card {
    background: white;
    border: 1px solid #F3F4F6;
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.2s;
}
.tl-card--clickable {
    cursor: pointer;
}
.tl-card--clickable:hover {
    border-color: #C5CAE9;
    background: #FAFBFF;
    box-shadow: 0 2px 12px rgba(21, 101, 192, 0.06);
    transform: translateX(2px);
}
.tl-card--clickable:hover .tl-title {
    color: #1565C0;
}
.tl-card--clickable:hover .tl-arrow {
    opacity: 1;
    transform: translateX(0);
}
.tl-card--clickable:hover ~ .tl-bullet,
.tl-event:hover .tl-bullet {
    transform: scale(1.1);
}

.tl-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.tl-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1A1A2E;
    transition: color 0.15s;
    line-height: 1.4;
}
.tl-desc {
    font-size: 0.8rem;
    color: #6B7280;
    margin-top: 3px;
    line-height: 1.45;
}
.tl-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.tl-time {
    font-size: 0.72rem;
    color: #9CA3AF;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tl-tag {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
}
.tl-tag--access_log    { background: #F3E5F5; color: #7B1FA2; }
.tl-tag--invoice       { background: #E8F5E9; color: #2E7D32; }
.tl-tag--email         { background: #E3F2FD; color: #1565C0; }
.tl-tag--seat          { background: #E0F2F1; color: #00897B; }
.tl-tag--notification  { background: #ECEFF1; color: #546E7A; }

.tl-arrow {
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s;
    color: #1565C0;
    flex-shrink: 0;
    margin-top: 2px;
}

.tl-load-more {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}
.tl-load-more button {
    padding: 8px 24px;
    border-radius: 20px;
    border: 1px solid #E5E7EB;
    background: white;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tl-load-more button:hover {
    border-color: #1565C0;
    color: #1565C0;
    background: #E3F2FD;
}
.tl-load-more button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ═══════════════════════════════════════════════
   17. Pages — Portal (customer-facing)
   ═══════════════════════════════════════════════ */

/* ── Portal Layout ── */
.portal-page-content {
    padding: 24px 32px;
    background: #f5f7fa;
    min-height: calc(100vh - 56px);
}

/* ── Portal Sidebar Nav ── */
.portal-nav-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 8px;
}
.portal-nav-brand-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
}
.portal-nav-brand-title .mud-icon-root { font-size: 20px; }
.portal-nav-brand-subtitle {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    margin-top: 2px;
    padding-left: 28px;
}

/* Dark sidebar nav link overrides */
.portal-nav-brand ~ .mud-navmenu .mud-nav-link {
    color: rgba(255,255,255,0.7) !important;
}
.portal-nav-brand ~ .mud-navmenu .mud-nav-link:hover {
    background: rgba(255,255,255,0.08) !important;
    color: white !important;
}
.portal-nav-brand ~ .mud-navmenu .mud-nav-link.active {
    background: rgba(21,101,192,0.3) !important;
    color: white !important;
}
.portal-nav-brand ~ .mud-navmenu .mud-nav-link .mud-icon-root {
    color: rgba(255,255,255,0.7);
}
.portal-nav-brand ~ .mud-navmenu .mud-nav-link.active .mud-icon-root {
    color: white;
}

/* Portal nav badges */
.portal-nav-badge {
    font-size: 0.65rem !important;
    height: 18px !important;
    min-width: 18px;
    padding: 0 5px !important;
    font-weight: 700;
    background: rgba(21,101,192,0.4) !important;
    color: white !important;
    margin-left: auto;
}
.portal-nav-badge--warning {
    background: rgba(245,124,0,0.6) !important;
}

/* Portal nav footer */
.portal-nav-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}
.portal-nav-footer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(21,101,192,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.portal-nav-footer-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: white;
}
.portal-nav-footer-role {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
}

/* ── Portal Page Header ── */
.portal-page-header {
    margin-bottom: 24px;
}
.portal-page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin: 0;
    color: var(--mud-palette-text-primary);
    outline: none;
}
.portal-page-header h1::selection {
    background: transparent;
}
.portal-page-header p {
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
    margin: 4px 0 0;
}

/* ── Portal Stat Cards v2 (with colored top border) ── */
.portal-stat-card-v2 {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--mud-palette-lines-default);
    border-top: 3px solid transparent;
    transition: box-shadow 0.15s;
}
.portal-stat-card-v2:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.portal-stat-card-v2--blue { border-top-color: #1565C0; }
.portal-stat-card-v2--green { border-top-color: #2E7D32; }
.portal-stat-card-v2--orange { border-top-color: #F57C00; }
.portal-stat-card-v2--teal { border-top-color: #00897B; }

.portal-stat-card-v2-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.portal-stat-card-v2--blue .portal-stat-card-v2-icon { background: rgba(21,101,192,0.1); color: #1565C0; }
.portal-stat-card-v2--green .portal-stat-card-v2-icon { background: rgba(46,125,50,0.1); color: #2E7D32; }
.portal-stat-card-v2--orange .portal-stat-card-v2-icon { background: rgba(245,124,0,0.1); color: #F57C00; }
.portal-stat-card-v2--teal .portal-stat-card-v2-icon { background: rgba(0,137,123,0.1); color: #00897B; }

.portal-stat-card-v2-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1;
    color: var(--mud-palette-text-primary);
}
.portal-stat-card-v2-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mud-palette-text-secondary);
    margin-top: 6px;
}

/* ── Portal Cards ── */
.portal-card {
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}
.portal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.portal-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}
.portal-card-title .mud-icon-root { font-size: 18px; color: var(--mud-palette-text-secondary); }
.portal-card-body { padding: 0; }

.portal-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    transition: background 0.1s;
}
.portal-card-row:hover { background: #FAFBFC; }
.portal-card-row:last-child { border-bottom: none; }

/* ── Portal Two-Column Layout ── */
.portal-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ── Portal Activity Items ── */
.portal-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.portal-activity-item:last-child { border-bottom: none; }
.portal-activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.portal-activity-icon .mud-icon-root { font-size: 16px; }
.portal-activity-icon--green { background: rgba(46,125,50,0.1); color: #2E7D32; }
.portal-activity-icon--blue { background: rgba(21,101,192,0.1); color: #1565C0; }
.portal-activity-icon--red { background: rgba(198,40,40,0.1); color: #C62828; }
.portal-activity-icon--teal { background: rgba(0,137,123,0.1); color: #00897B; }
.portal-activity-icon--gray { background: rgba(0,0,0,0.05); color: #757575; }

/* ── Portal Stat Card v2 Header ── */
.portal-stat-card-v2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* ── Portal Donut Chart (CSS-only) ── */
.portal-donut-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}
.portal-donut-chart::after {
    content: '';
    position: absolute;
    top: 30px; left: 30px; right: 30px; bottom: 30px;
    background: white;
    border-radius: 50%;
}
.portal-donut-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    text-align: center;
}
.portal-donut-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--mud-palette-text-primary);
    line-height: 1;
}
.portal-donut-label {
    font-size: 0.65rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

/* ── Portal Chart Legend ── */
.portal-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
    padding: 3px 0;
}
.portal-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ── Portal Progress Bar ── */
.portal-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: #E5E7EB;
    overflow: hidden;
    width: 180px;
}
.portal-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #1565C0, #42A5F5);
}

/* ── Portal Bar Chart ── */
.portal-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 120px;
}
.portal-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.portal-bar {
    width: 100%;
    max-width: 32px;
    border-radius: 3px 3px 0 0;
    transition: height 0.3s;
}
.portal-bar--primary { background: #1565C0; }
.portal-bar-day {
    font-size: 0.62rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

/* ── Portal Renewal Items ── */
.portal-renewal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}
.portal-renewal-item:last-child { border-bottom: none; }
.portal-renewal-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.portal-renewal-icon .mud-icon-root { font-size: 17px; }
.portal-renewal-icon--ok { background: rgba(21,101,192,0.1); color: #1565C0; }
.portal-renewal-icon--warning { background: rgba(245,124,0,0.1); color: #F57C00; }
.portal-renewal-icon--danger { background: rgba(198,40,40,0.1); color: #C62828; }
.portal-renewal-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    flex: 1;
}
.portal-renewal-date {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
}
.portal-renewal-days {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}
.portal-renewal-days--ok { background: rgba(46,125,50,0.1); color: #2E7D32; }
.portal-renewal-days--warning { background: rgba(245,124,0,0.1); color: #F57C00; }
.portal-renewal-days--danger { background: rgba(198,40,40,0.1); color: #C62828; }

/* ── Portal Timeline ── */
.portal-timeline { }
.portal-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.portal-timeline-item:last-child { border-bottom: none; }
.portal-timeline-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.portal-timeline-dot .mud-icon-root { font-size: 17px; }
.portal-timeline-dot--green { background: rgba(46,125,50,0.1); color: #2E7D32; }
.portal-timeline-dot--blue { background: rgba(21,101,192,0.1); color: #1565C0; }
.portal-timeline-dot--orange { background: rgba(245,124,0,0.1); color: #F57C00; }
.portal-timeline-dot--red { background: rgba(198,40,40,0.1); color: #C62828; }
.portal-timeline-dot--teal { background: rgba(0,137,123,0.1); color: #00897B; }
.portal-timeline-dot--gray { background: rgba(0,0,0,0.05); color: #757575; }
.portal-timeline-content { flex: 1; min-width: 0; }
.portal-timeline-title { font-size: 0.85rem; font-weight: 600; color: var(--mud-palette-text-primary); }
.portal-timeline-desc { font-size: 0.78rem; color: var(--mud-palette-text-secondary); margin-top: 1px; }
.portal-timeline-time { font-size: 0.72rem; color: var(--mud-palette-text-secondary); margin-top: 3px; }

/* Seats Progress Bar */
.seats-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.seats-progress {
    width: 60px;
    height: 6px;
    border-radius: 3px;
    background: #E8E8E8;
    overflow: hidden;
}
.seats-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.seats-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    white-space: nowrap;
}

/* Status dot */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
}
.status-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot--active::before { background: #2E7D32; }
.status-dot--expired::before { background: #C62828; }
.status-dot--revoked::before { background: #616161; }
.status-dot--trial::before { background: #0288D1; }
.status-dot--inactive::before { background: #9E9E9E; }
.status-dot--pendingrenewal::before { background: #F57C00; }
.status-dot--graceperiod::before { background: #F57C00; }
.status-dot--suspended::before { background: #616161; }

/* Portal License Detail Page */
.portal-license-detail { max-width: 960px; }

/* Title row: app icon + name + status */
.pld-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.pld-title-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pld-title h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.3px; margin: 0; }

/* Detail Tabs */
.pld-tabs {
    display: flex; gap: 0; background: white;
    border: 1px solid var(--mud-palette-lines-default);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}
.pld-tab {
    padding: 14px 20px; font-size: 0.85rem; font-weight: 500;
    color: var(--mud-palette-text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; gap: 6px;
    background: none; border-top: none; border-left: none; border-right: none;
    font-family: inherit;
}
.pld-tab:hover { color: var(--mud-palette-text-primary); background: rgba(0,0,0,0.02); }
.pld-tab--active { color: #1565C0; font-weight: 700; border-bottom-color: #1565C0; }
.pld-tab-badge {
    background: #E3F2FD; color: #1565C0;
    font-size: 0.7rem; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
}
.pld-tab-content {
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 24px;
}

/* Section headers inside tab content */
.pld-section {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.9rem; font-weight: 700;
    margin-bottom: 16px; margin-top: 4px;
}
.pld-section .mud-icon-root { font-size: 18px; color: var(--mud-palette-text-secondary); }

/* Info grid (3 columns) */
.pld-info-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 18px; margin-bottom: 24px;
}
.pld-info-field label {
    display: block; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--mud-palette-text-secondary); margin-bottom: 4px;
}
.pld-info-field span { font-size: 0.88rem; font-weight: 500; }
.pld-info-field code {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.8rem; background: #F8FAFC; padding: 3px 8px;
    border-radius: 4px; border: 1px solid var(--mud-palette-lines-default);
    font-weight: 600; letter-spacing: 0.3px;
}

/* Divider */
.pld-divider { border: none; border-top: 1px solid var(--mud-palette-lines-default); margin: 24px 0; }

/* Validity Period Bar */
.pld-validity {
    background: #F8FAFC; border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px; padding: 16px 20px; margin-bottom: 24px;
}
.pld-validity-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--mud-palette-text-secondary); font-weight: 500; margin-bottom: 8px; }
.pld-validity-bar { height: 8px; border-radius: 4px; background: #E5E7EB; overflow: hidden; position: relative; }
.pld-validity-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #1565C0, #42A5F5); position: relative; }
.pld-validity-marker { position: absolute; right: -1px; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: white; border: 3px solid #1565C0; }
.pld-validity-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.78rem; }
.pld-validity-meta span { color: var(--mud-palette-text-secondary); }

/* Notes box */
.pld-notes {
    background: #FFFBF0; border: 1px solid #F5DEB3;
    border-left: 3px solid #F57C00; border-radius: 6px;
    padding: 14px 16px; font-size: 0.85rem;
    color: var(--mud-palette-text-primary); line-height: 1.6;
}

/* Seat Summary Ring */
.pld-seat-summary {
    background: #F8FAFC; border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px; padding: 16px 20px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 16px;
}
.pld-seat-ring { width: 56px; height: 56px; position: relative; flex-shrink: 0; }
.pld-seat-ring svg { transform: rotate(-90deg); }
.pld-seat-ring .ring-bg { fill: none; stroke: #E5E7EB; stroke-width: 6; }
.pld-seat-ring .ring-fill { fill: none; stroke: #1565C0; stroke-width: 6; stroke-linecap: round; }
.pld-seat-ring-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 0.75rem; font-weight: 800; color: #1565C0;
}
.pld-seat-info h4 { font-size: 0.88rem; font-weight: 700; margin: 0; }
.pld-seat-info p { font-size: 0.78rem; color: var(--mud-palette-text-secondary); margin: 2px 0 0; }

/* Seat row — stale highlight */
.portal-seat-row--stale {
    background: #FFF8E1; border-radius: 8px;
    margin: 0 -8px; padding-left: 28px !important; padding-right: 28px !important;
}
.portal-seat-row--stale .portal-seat-sub { color: #F57C00; }

/* Seat row — released (ghost) */
.portal-seat-row--released { opacity: 0.45; }
.portal-seat-row--released .portal-seat-name { text-decoration: line-through; }

/* Released label */
.pld-released-label {
    font-size: 0.72rem; font-weight: 600;
    color: var(--mud-palette-text-secondary);
    background: #F3F4F6; padding: 2px 8px; border-radius: 4px;
}

/* Info tip box */
.pld-info-tip {
    background: #E1F5FE; border: 1px solid #B3E5FC; border-radius: 8px;
    padding: 12px 16px; margin-top: 20px;
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 0.82rem; color: #01579B; line-height: 1.5;
}
.pld-info-tip .mud-icon-root { font-size: 18px; color: #0288D1; margin-top: 1px; flex-shrink: 0; }
.portal-seat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.portal-seat-row:last-child { border-bottom: none; }
.portal-seat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.portal-seat-info { flex: 1 1 0; min-width: 0; overflow: hidden; }
.portal-seat-name { font-weight: 600; font-size: 0.88rem; }
.portal-seat-sub { font-size: 0.78rem; color: var(--mud-palette-text-secondary); }
.portal-seat-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--mud-palette-text-secondary);
    flex-shrink: 0;
    min-width: 200px;
    white-space: nowrap;
}

/* Device icon colors by type */
.device-icon--desktop { background: rgba(33,150,243,0.1); color: #2196F3; }
.device-icon--server { background: rgba(156,39,176,0.1); color: #9C27B0; }
.device-icon--tablet { background: rgba(0,150,136,0.1); color: #009688; }
.device-icon--phone { background: rgba(76,175,80,0.1); color: #4CAF50; }
.device-icon--selfservice { background: rgba(255,152,0,0.1); color: #FF9800; }
.device-icon--client { background: rgba(121,85,72,0.1); color: #795548; }

/* App icon colors */
.app-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.7rem; font-weight: 700; color: white; }
.app-icon--blue { background: #1565C0; }
.app-icon--green { background: #2E7D32; }
.app-icon--orange { background: #E65100; }
.app-icon--purple { background: #7B1FA2; }
.app-icon--teal { background: #00695C; }


/* ═══════════════════════════════════════════════
   18. Pages — Auth (login, forgot/reset password)
   ═══════════════════════════════════════════════ */

.auth-bg {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 40%, #00897B 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.auth-card-header {
    padding: 36px 36px 24px;
    text-align: center;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1565C0, #00897B);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(21,101,192,0.35);
    color: white;
}

.auth-card-body {
    padding: 28px 36px 36px;
}

.auth-card-footer {
    padding: 14px 36px;
    border-top: 1px solid var(--mud-palette-lines-default);
    text-align: center;
    background: #F8FAFC;
}


/* ═══════════════════════════════════════════════
   19. Pages — Profile
   ═══════════════════════════════════════════════ */

.profile-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.profile-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1565C0, #00897B);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 6px 16px rgba(21,101,192,0.3);
    flex-shrink: 0;
}

.profile-card {
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    overflow: hidden;
}

.profile-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: #FAFBFD;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-card-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-card-body {
    padding: 24px;
}

.profile-info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.profile-info-row:last-child {
    border-bottom: none;
}
.profile-info-label {
    width: 130px;
    color: var(--mud-palette-text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.profile-info-value {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    font-size: 0.85rem;
}
