/* Global stylesheet — variables, layout, sidebar, cards, components, responsive */
/* ----- RESET & GLOBAL ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
}

:root {
    --near-black: #1D1D1F;
    --dark-gray: #3B3B3F;
    --mid-gray: #59595E;
    --light-gray: #CACACC;
    --off-white: #F3F3F5;
    --pure-white: #FFFFFF;
    --neon-cyan: #4DFBFF;
    --neon-green: #55FF4D;
    --bright-green: #59FF00;
    --pale-green: #BBFFB8;
    --neon-yellow: #FFFE00;
    --pale-yellow: #FFFFB8;
    --neon-red: #FF6B6B;
    --soft-blue: #6EC8E0;
    --soft-lavender: #C3B1E1;

    --sidebar-width: 280px;
    --sidebar-collapsed-width: 85px;
    --border-radius-card: 1.25rem;
    --transition-fast: 0.15s ease;
}

body {
    background-color: var(--off-white);
    color: var(--near-black);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

/* ----- DASHBOARD LAYOUT (flex) ----- */
.dashboard {
    display: flex;
    height: 100vh;
    width: 100%;
    position: relative;
}

/* ----- NAV CONTAINER WRAPPER ----- */
/* #nav-container is injected by components.js between .dashboard and .sidebar.
   display:contents makes the div invisible to the flex layout so .sidebar
   behaves exactly as if it were a direct child of .dashboard — full height,
   flex-shrink:0, background filling the entire viewport height.            */
#nav-container {
    display: contents;
}

/* ----- SIDEBAR (collapsible) ----- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--near-black);
    color: var(--light-gray);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--mid-gray) var(--near-black);
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--dark-gray);
    flex-shrink: 0;
    white-space: nowrap;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-track {
    background: var(--near-black);
}
.sidebar::-webkit-scrollbar-thumb {
    background: var(--mid-gray);
    border-radius: 20px;
}

.sidebar-header {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--dark-gray);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-header h2 {
    color: var(--pure-white);
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
}
.sidebar-header h2 i {
    color: var(--neon-cyan);
}
.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--light-gray);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.sidebar-toggle:hover {
    background-color: var(--dark-gray);
    color: var(--neon-cyan);
}
.sidebar.collapsed .sidebar-header h2 span,
.sidebar.collapsed .nav-item a span,
.sidebar.collapsed .section-header span span:not(.icon-holder),
.sidebar.collapsed .badge,
.sidebar.collapsed .sub-menu {
    display: none;
}
.sidebar.collapsed .nav-item a,
.sidebar.collapsed .section-header {
    justify-content: center;
    padding: 0.8rem 0;
    border-left: none;
}
.sidebar.collapsed .nav-item a i,
.sidebar.collapsed .section-header i:first-child {
    margin: 0;
    width: auto;
    font-size: 1.05rem;   /* ~30% smaller than the previous 1.5rem */
    color: var(--pure-white);
}
.sidebar.collapsed .nav-item.active > a i {
    color: var(--neon-cyan);
}
.sidebar.collapsed .section-header .fa-caret-right {
    display: none;
}

.nav-menu {
    list-style: none;
    padding: 0 0.5rem 2rem 0.5rem;
}
.nav-item, .nav-section {
    margin-bottom: 2px;
}
.nav-item a, .section-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    color: var(--light-gray);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 450;
    transition: background 0.1s, color 0.1s;
    cursor: pointer;
    border-left: 4px solid transparent;
}
.section-header {
    justify-content: space-between;
}
.section-header span {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.nav-item a i, .section-header i:first-child {
    width: 1.4rem;
    font-size: 1.1rem;
    color: var(--pure-white);
    transition: color 0.1s;
}
.nav-item.active > a {
    border-left-color: var(--neon-cyan);
    background-color: var(--dark-gray);
    color: var(--pure-white);
}
.nav-item.active > a i {
    color: var(--neon-cyan);
}

.nav-item a:hover, .section-header:hover {
    background-color: var(--dark-gray);
    color: var(--pure-white);
}

/* ----- SIDEBAR FOOTER: signed-in user / auth actions ----- */
.sidebar-footer {
    margin-top: auto;                       /* pin to the bottom of the flex column */
    padding: 0.6rem 0.5rem 1rem;
    border-top: 1px solid var(--dark-gray);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    overflow: hidden;
}
.user-avatar {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dark-gray);
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}
.user-meta { display: flex; flex-direction: column; overflow: hidden; }
.user-name {
    color: var(--pure-white);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-sub { color: var(--mid-gray); font-size: 0.7rem; }
/* Auth link styled exactly like a nav row (unified look) */
.nav-auth-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    color: var(--light-gray);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 450;
    transition: background 0.1s, color 0.1s;
    border-left: 4px solid transparent;
}
.nav-auth-link i { width: 1.4rem; font-size: 1.1rem; color: var(--mid-gray); transition: color 0.1s; }
.nav-auth-link:hover { background-color: var(--dark-gray); color: var(--pure-white); }
.nav-auth-link:hover i { color: var(--neon-cyan); }
.nav-auth-link.signin { color: var(--neon-cyan); }
.nav-auth-link.signin i { color: var(--neon-cyan); }
/* Collapsed rail: hide labels, centre the icons (matches nav-item behaviour) */
.sidebar.collapsed .sidebar-footer { padding: 0.6rem 0 1rem; }
.sidebar.collapsed .user-chip { justify-content: center; padding: 0.6rem 0; gap: 0; }
.sidebar.collapsed .user-meta,
.sidebar.collapsed .nav-auth-link span { display: none; }
.sidebar.collapsed .nav-auth-link { justify-content: center; padding: 0.7rem 0; }
.sidebar.collapsed .nav-auth-link i { margin: 0; }

.sub-menu {
    list-style: none;
    padding-left: 2.2rem;
    margin: 0.2rem 0 0.3rem 0;
    display: none;
}
.sub-menu.expanded {
    display: block;
}
.sub-menu .nav-item a {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

.badge {
    background-color: var(--neon-yellow);
    color: var(--near-black);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 30px;
    margin-left: auto;
    line-height: 1;
}

.section-header .fa-caret-right {
    transition: transform 0.2s;
}
.section-header.expanded .fa-caret-right {
    transform: rotate(90deg);
}

/* ----- MAIN PANEL ----- */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--off-white);
}

.top-bar {
    padding: 1rem 2rem;
    background-color: var(--pure-white);
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.top-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0;
}
.hamburger {
    display: none;
    font-size: 1.8rem;
    color: var(--near-black);
    cursor: pointer;
    background: none;
    border: none;
}
.page-title h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -1px;
}
.timestamp {
    color: var(--mid-gray);
    font-size: 0.85rem;
    background: var(--off-white);
    padding: 0.3rem 1rem;
    border-radius: 40px;
    border: 1px solid var(--light-gray);
}
.action-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}
.pill-btn {
    border: none;
    padding: 0.6rem 1.6rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: var(--pure-white);
    border: 2px solid var(--light-gray);
    color: var(--near-black);
    cursor: pointer;
    transition: all 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.pill-btn i { font-size: 1rem; }
.pill-btn.primary {
    background-color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    color: var(--near-black);
}
.pill-btn.primary:hover {
    background-color: transparent;
    border-color: var(--neon-cyan);
    color: var(--near-black);
}
.pill-btn.outline {
    background-color: transparent;
    border: 2px solid var(--mid-gray);
    color: var(--mid-gray);
}
.pill-btn.outline:hover {
    background-color: var(--mid-gray);
    color: var(--pure-white);
}
.pill-btn.alert {
    background-color: var(--neon-yellow);
    border-color: var(--neon-yellow);
    color: var(--near-black);
}
.pill-btn.alert:hover {
    background-color: var(--pale-yellow);
    border-color: var(--neon-yellow);
}
.badge-light {
    background-color: var(--near-black);
    color: var(--neon-yellow);
    border-radius: 30px;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    margin-left: 0.4rem;
}

/* ----- CARDS GRID ----- */
.cards-grid {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.8rem;
    align-items: stretch;
}
.card {
    background-color: var(--pure-white);
    border-radius: var(--border-radius-card);
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    box-shadow: 0 10px 20px -8px rgba(0,0,0,0.1);
    transition: transform 0.15s, box-shadow 0.2s;
    border: 1px solid var(--light-gray);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -10px rgba(0,0,0,0.15);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}
.card-header h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.card-header h3 i {
    color: var(--light-gray);
}
.status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 1rem;
    border-radius: 40px;
    font-weight: 600;
    background-color: var(--pale-green);
    color: var(--near-black);
    border: 1px solid var(--neon-green);
}
.status-badge.warning {
    background-color: var(--pale-yellow);
    border-color: var(--neon-yellow);
}
.status-badge.cyan {
    background-color: rgba(77, 251, 255, 0.25);
    border-color: var(--neon-cyan);
}
.status-badge.critical {
    background-color: rgba(255, 107, 107, 0.18);
    border-color: var(--neon-red);
}
.chart-container {
    width: 100%;
    max-width: 100%;
    height: 140px;
    margin: 0.2rem 0 0.5rem 0;
    position: relative;
    overflow: hidden;
}
.chart-container canvas,
.chart-canvas {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    box-sizing: border-box;
}
/* Round charts (pie/doughnut): keep the canvas square and centered so it never
   renders as an oval. Reusable across pages via `.chart-container.donut`. */
.chart-container.donut {
    display: flex;
    align-items: center;
    justify-content: center;
}
.chart-container.donut canvas {
    width: auto !important;
    max-width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}
/* Taller chart areas for feature/hero tiles */
.chart-container.lg { height: 240px; }
.chart-container.xl { height: 320px; }

/* ----- VARIED TILE SIZES (Grafana/Azure style, opt-in via .cards-grid.varied) -----
   Reusable size modifiers so any page can build a dynamic, mixed-size grid
   without touching the uniform default grid used elsewhere. Columns are inherited
   from .cards-grid (auto-fill) so the mobile 1-column reset keeps working. */
.cards-grid.varied {
    grid-auto-rows: minmax(400px, auto);
    grid-auto-flow: dense;
}
.cards-grid.varied .card.wide    { grid-column: span 2; }
.cards-grid.varied .card.tall    { grid-row: span 2; }
.cards-grid.varied .card.feature { grid-column: span 2; grid-row: span 2; }
.cards-grid.varied .card.full    { grid-column: 1 / -1; }   /* always full section width */

/* ----- CSS HEATMAP (no charting plugin needed) ----- */
.heatmap { display: flex; flex-direction: column; gap: 4px; margin-top: 0.5rem; }
.heatmap-row { display: flex; align-items: center; gap: 4px; }
.heatmap-row .hm-label { width: 64px; flex-shrink: 0; font-size: 0.7rem; color: var(--mid-gray); }
.heatmap-cell { flex: 1; height: 24px; border-radius: 4px; background: var(--off-white); transition: transform 0.1s; }
.heatmap-cell:hover { transform: scale(1.08); }
.heatmap-axis { display: flex; gap: 4px; margin: 0.3rem 0 0 68px; }
.heatmap-axis span { flex: 1; font-size: 0.6rem; color: var(--mid-gray); text-align: center; }

/* ----- CSS TREEMAP (no charting plugin needed) ----- */
.treemap { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 0.5rem; align-content: flex-start; }
.treemap-tile {
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    color: var(--near-black);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    min-height: 46px;
}
.treemap-tile .tm-name { font-size: 0.72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.treemap-tile .tm-val { font-size: 0.65rem; opacity: 0.8; }

/* ----- GOVERNANCE POSTURE COMPOSITE (feature tile) ----- */
.posture-body { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 0.5rem; }
.posture-left { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; flex: 0 0 130px; }
.posture-kpis { display: flex; gap: 0.6rem; width: 100%; }
.posture-kpi { flex: 1; text-align: center; background: var(--off-white); border-radius: 8px; padding: 0.4rem 0.2rem; }
.posture-kpi-num { display: block; font-size: 1.15rem; font-weight: 700; color: var(--neon-cyan); }
.posture-kpi-lbl { display: block; font-size: 0.6rem; color: var(--mid-gray); }
.posture-center { flex: 1 1 220px; min-width: 200px; }
.posture-right { flex: 1 1 180px; min-width: 170px; }
.posture-pillar { margin-bottom: 0.65rem; }
.posture-pillar .pp-top { display: flex; justify-content: space-between; font-size: 0.75rem; margin-bottom: 0.2rem; }
.posture-help {
    display: flex; align-items: flex-start; gap: 0.5rem;
    margin-top: 0.8rem; padding: 0.6rem 0.75rem;
    background: var(--off-white); border-left: 3px solid var(--neon-cyan);
    border-radius: 6px; font-size: 0.72rem; color: var(--mid-gray); line-height: 1.4;
}
.posture-help .status-indicator { margin: 0 0.15rem 0 0.4rem; }

/* ----- SECTION BANDS (group related tiles) ----- */
.section-title {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0 2rem;              /* align left edge with the cards' 2rem grid padding */
    margin: 1.6rem 0 0;
}
.section-title:first-of-type { margin-top: 1.2rem; }
/* section title sits directly above its grid → trim the grid's top padding */
.section-title + .cards-grid.varied { padding-top: 0.6rem; }
.section-title i { color: var(--neon-cyan); font-size: 0.95rem; }
.section-title h2 {
    margin: 0; font-size: 0.82rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--near-black);
    white-space: nowrap;
}
.section-title .section-sub {
    font-size: 0.68rem; color: var(--mid-gray);
    background: var(--off-white); padding: 0.15rem 0.5rem; border-radius: 999px;
    white-space: nowrap;
}
.section-title .section-rule {
    flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--neon-cyan) 0%, rgba(77,251,255,0) 100%);
    opacity: 0.5;
}

/* ----- COMPREHENSIVE STORAGE CARD (full-width composite) ----- */
.storage-body { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 0.5rem; }
.storage-map  { flex: 1.4 1 320px; min-width: 280px; }
.storage-rank { flex: 1 1 260px; min-width: 240px; }
.storage-caption { font-size: 0.68rem; color: var(--mid-gray); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.storage-map .treemap { min-height: 210px; align-content: stretch; }
.storage-cat { margin-bottom: 0.65rem; }
.storage-cat .sc-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.78rem; margin-bottom: 0.2rem; gap: 0.5rem; }
.storage-cat .sc-name { display: flex; align-items: center; gap: 0.4rem; }
.storage-cat .sc-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; }
.storage-cat .sc-val { color: var(--mid-gray); font-size: 0.72rem; white-space: nowrap; }
.storage-cat .sc-val i { font-size: 0.62rem; margin-left: 0.15rem; }
.storage-summary { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--light-gray); }
.storage-summary .ss-item { flex: 1 1 110px; }
.storage-summary .ss-num { display: block; font-size: 1.1rem; font-weight: 700; color: var(--near-black); }
.storage-summary .ss-lbl { display: block; font-size: 0.64rem; color: var(--mid-gray); }
/* Mobile: stop the Storage composite content from forcing the card wider than
   the viewport (its columns carry min-widths that exceed a phone screen). */
@media (max-width: 768px) {
    /* Let the single grid track shrink to zero so oversized inner content
       (heatmap / treemap) can no longer blow the whole Storage section past
       the viewport edge. Scoped to this section only. */
    .cards-grid.storage-section { grid-template-columns: minmax(0, 1fr); }
    .cards-grid.storage-section .card,
    .storage-body, .storage-map, .storage-rank,
    .heatmap, .heatmap-row, .treemap, .storage-summary { min-width: 0; }
    .storage-body { flex-direction: column; gap: 1rem; }
    .storage-map, .storage-rank { flex-basis: auto; }
    .storage-summary .ss-item { flex-basis: 45%; }
    .heatmap-row .hm-label { width: 48px; font-size: 0.62rem; }
    .heatmap-axis { margin-left: 52px; }
    /* long descriptive stat pills must wrap on narrow screens */
    .cards-grid.storage-section .stat-item { white-space: normal; }
}
.card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    margin: 0.5rem 0 0.5rem;
    font-size: 0.85rem;
    color: var(--mid-gray);
    align-items: center;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--off-white);
    padding: 0.2rem 0.8rem;
    border-radius: 40px;
    white-space: nowrap;
}
.primary-metric {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -1px;
}
.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}
.card-footer a {
    text-decoration: none;
    color: var(--mid-gray);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    border-bottom: 2px solid transparent;
}
.card-footer a:hover {
    border-bottom-color: var(--neon-cyan);
}

/* ----- FOOTER ----- */
.dashboard-footer {
    background-color: var(--pure-white);
    border-top: 1px solid var(--light-gray);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--mid-gray);
    margin-top: auto;
}
.footer-links a {
    color: var(--mid-gray);
    text-decoration: none;
    margin-left: 1.5rem;
}
.footer-links a:hover { color: var(--neon-cyan); }

/* ----- RESPONSIVE ----- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .hamburger {
        display: block;
    }
    .main {
        width: 100%;
    }
    .top-bar {
        padding: 1rem;
        flex-wrap: nowrap;
        align-items: center;
    }
    .top-left {
        gap: 0.8rem;
        min-width: 0;
        flex: 1;
    }
    .page-title h1 {
        font-size: 1.3rem;
    }
    .action-buttons {
        flex-wrap: nowrap;
        gap: 0.5rem;
        flex-shrink: 0;
    }
    /* Mobile: show icon-only pills so they never overlap the header */
    .action-buttons .pill-btn span:not(.badge-light) {
        display: none;
    }
    .action-buttons .pill-btn i {
        margin: 0;
    }
    .action-buttons .pill-btn {
        padding: 0.55rem 0.85rem;
        gap: 0.3rem;
    }
    /* Timestamp hidden on mobile only */
    .timestamp {
        display: none;
    }
    .cards-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 1.5rem;
    }
    .section-title { padding: 0 1.5rem; }
    /* Any card that spans multiple columns/rows on desktop collapses to one on mobile */
    .cards-grid,
    .cards-grid.varied {
        grid-template-columns: minmax(0, 1fr);   /* never let inner content force width */
        grid-auto-rows: auto;
    }
    .cards-grid .card {
        grid-column: auto !important;
        grid-row: auto !important;
        min-width: 0;
    }
    /* inner content must be allowed to shrink so cards stay inside the screen */
    .cards-grid .card .card-stats,
    .cards-grid .card .chart-container,
    .cards-grid .card table { min-width: 0; max-width: 100%; }
    .cards-grid .card table { display: block; overflow-x: auto; }
    .card {
        min-height: 0;
    }
}
/* ----- ENTRA ID CSS ----- */
       /* Radial meter styles */
        .meter {
            width: 120px;
            height: 120px;
            margin: 0 auto 1rem;
            border-radius: 50%;
            background: conic-gradient(var(--neon-cyan) 0deg, var(--light-gray) 0deg);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .meter-inner {
            width: 90px;
            height: 90px;
            background: var(--pure-white);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .meter-value {
            font-size: 1.8rem;
            font-weight: 700;
            line-height: 1.2;
            color: var(--near-black);
        }
        .meter-label {
            font-size: 0.7rem;
            color: var(--mid-gray);
            text-transform: uppercase;
        }
        /* Dropdown styling */
        .card-header select {
            background: var(--off-white);
            border: 1px solid var(--light-gray);
            border-radius: 40px;
            padding: 0.2rem 0.8rem;
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--near-black);
            cursor: pointer;
            outline: none;
        }
        .card-header select:hover {
            border-color: var(--neon-cyan);
        }
        /* Small tables inside cards */
        .mini-table {
            width: 100%;
            font-size: 0.85rem;
            border-collapse: collapse;
            margin-top: 0.5rem;
        }
        .mini-table th {
            text-align: left;
            font-weight: 600;
            color: var(--mid-gray);
            padding-bottom: 0.3rem;
            border-bottom: 1px solid var(--light-gray);
        }
        .mini-table td {
            padding: 0.3rem 0;
            border-bottom: 1px dashed var(--light-gray);
        }
        .mini-table td:last-child {
            text-align: right;
            font-weight: 600;
        }
        .status-indicator {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-right: 0.4rem;
        }
        .status-enabled { background-color: var(--neon-green); }
        .status-disabled { background-color: var(--light-gray); }
        .status-report { background-color: var(--neon-yellow); }
        .status-warning { background-color: var(--neon-yellow); }
        .status-critical { background-color: var(--neon-red); }
        .status-muted { background-color: var(--light-gray); }

/* ===== Power Platform specific styles (only extras) ===== */
        .filter-strip {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            background: var(--pure-white);
            border-radius: 60px;
            padding: 0.5rem 1.5rem;
            margin-bottom: 1.8rem;
            border: 1px solid var(--light-gray);
        }
        .filter-group {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .filter-group label {
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--mid-gray);
        }
        .filter-group select {
            background: transparent;
            border: none;
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--near-black);
            cursor: pointer;
            outline: none;
        }
        .kpi-ribbon {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 2rem;
        }
        .kpi-tile {
            flex: 1;
            min-width: 110px;
            background: var(--off-white);
            border-radius: 1rem;
            padding: 0.8rem;
            text-align: center;
            border: 1px solid var(--light-gray);
            transition: all 0.1s ease;
        }
        .kpi-tile:hover {
            background: var(--pure-white);
            border-color: var(--neon-cyan);
        }
        .kpi-number {
            font-size: 1.9rem;
            font-weight: 800;
            line-height: 1.2;
            color: var(--near-black);
        }
        .kpi-label {
            font-size: 0.7rem;
            text-transform: uppercase;
            font-weight: 600;
            color: var(--mid-gray);
            margin-top: 0.25rem;
        }
        .sunburst-container {
            width: 100%;
            height: 200px;
            position: relative;
        }
        .bump-container {
            width: 100%;
            height: 180px;
            position: relative;
        }
        .radar-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            min-height: 220px;
            margin-top: 0.75rem;
            margin-bottom: 0.5rem;
        }
        .radar-wrapper canvas {
            max-width: 100%;
            height: auto;
            max-height: 200px;
        }
        .gauge-wrapper {
            display: flex;
            justify-content: center;
            margin: 0.5rem 0;
        }
        .agent-list {
            margin-top: 0.5rem;
        }
        .agent-item {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            margin-bottom: 0.8rem;
        }
        .agent-bar-bg {
            flex: 1;
            height: 24px;
            background: var(--off-white);
            border-radius: 20px;
            overflow: hidden;
        }
        .agent-bar-fill {
            height: 100%;
            background: var(--neon-cyan);
            width: 0%;
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding-right: 8px;
            color: var(--near-black);
            font-size: 0.7rem;
            font-weight: bold;
        }
        .orphan-list {
            list-style: none;
            margin: 0.5rem 0;
            padding: 0;
        }
        .orphan-list li {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            margin-bottom: 0.6rem;
            font-size: 0.8rem;
        }
        .orphan-bar-bg {
            flex: 1;
            height: 8px;
            background: var(--light-gray);
            border-radius: 10px;
            overflow: hidden;
        }
        .orphan-bar-fill {
            height: 100%;
            background: var(--neon-red);
            width: 0%;
            border-radius: 10px;
        }
        .action-list {
            list-style: none;
            padding: 0;
        }
        .action-list li {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.5rem 0;
            border-bottom: 1px dashed var(--light-gray);
            font-size: 0.85rem;
        }
        .horizon-strip {
            height: 40px;
            background: linear-gradient(90deg, #55FF4D 0%, #55FF4D 35%, #FF6B6B 35%, #FF6B6B 65%, #FFFE00 65%);
            border-radius: 12px;
            margin: 0.5rem 0;
        }
        .inline-stats {
            display: flex;
            justify-content: space-between;
            margin-top: 0.5rem;
            font-size: 0.75rem;
            color: var(--mid-gray);
        }
        /* Unified tooltip for D3 and Chart.js (same style) */
        .d3-tooltip {
            position: absolute;
            background: var(--near-black);
            color: var(--neon-cyan);
            padding: 0.3rem 0.8rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-family: 'JetBrains Mono', monospace;
            pointer-events: none;
            z-index: 1000;
            border: 1px solid var(--neon-cyan);
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            white-space: nowrap;
            transition: opacity 0.1s ease;
        }
        /* Collapsed-sidebar hover label: same look as .d3-tooltip, fixed to the
           viewport and vertically centred on the hovered row (set via JS). */
        .nav-rail-tooltip {
            position: fixed;
            transform: translateY(-50%);
            opacity: 0;
        }
        /* ----- LOGIN (standalone pre-auth page) — reuses .card + .pill-btn ----- */
        .login-body {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--near-black);
            padding: 1.5rem;
        }
        .login-wrap { width: 100%; max-width: 420px; }
        .login-card { min-height: 0; text-align: center; align-items: center; gap: 0.4rem; }
        .login-logo {
            width: 56px; height: 56px; border-radius: 50%;
            background: var(--near-black); color: var(--neon-cyan);
            display: flex; align-items: center; justify-content: center;
            font-size: 1.5rem; margin: 0.5rem auto 0.8rem;
        }
        .login-brand { font-weight: 700; letter-spacing: -0.5px; color: var(--near-black); }
        .login-brand .dot { color: var(--neon-cyan); }
        .login-title { font-size: 1.35rem; margin: 0.6rem 0 0.2rem; color: var(--near-black); }
        .login-sub { color: var(--mid-gray); font-size: 0.9rem; margin-bottom: 1.2rem; }
        .login-btn { width: 100%; justify-content: center; }
        .login-error {
            margin-top: 1rem; font-size: 0.8rem; color: var(--near-black);
            background: rgba(255,107,107,0.15); border: 1px solid var(--neon-red);
            border-radius: 10px; padding: 0.5rem 0.8rem;
        }
        .login-foot { margin-top: 1.2rem; font-size: 0.72rem; color: var(--mid-gray); }
        /* ----- UNDER DEVELOPMENT placeholder — reuses .card + .pill-btn ----- */
        .dev-hero { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 2rem; }
        .dev-card { max-width: 460px; min-height: 0; text-align: center; align-items: center; gap: 0.3rem; }
        .dev-icon {
            width: 72px; height: 72px; border-radius: 50%;
            background: var(--near-black); color: var(--neon-cyan);
            display: flex; align-items: center; justify-content: center;
            font-size: 1.8rem; margin: 0.5rem auto 1rem;
        }
        .dev-title { font-size: 1.3rem; color: var(--near-black); margin: 0.6rem 0 0.2rem; }
        .dev-sub { color: var(--mid-gray); font-size: 0.9rem; margin-bottom: 1.2rem; }
        /* Site Classification card: let long class names wrap instead of overflowing */
        #classificationList { display: flex; flex-direction: column; gap: 0.3rem; max-height: 160px; overflow-y: auto; overflow-x: hidden; }
        #classificationList .stat-item { display: flex; justify-content: space-between; width: 100%; white-space: normal; line-height: 1.2; font-size: 0.7rem; align-items: flex-start; gap: 0.35rem; padding: 0.3rem 0.6rem; }
        #classificationList .stat-item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
        #classificationList .status-indicator { flex: 0 0 auto; margin-top: 0.25rem; }
        #classificationList .stat-item strong { white-space: nowrap; flex: 0 0 auto; }
        .chart-container.donut { max-height: 140px; }
        /* "No live data yet" banner (production, empty tables) */
        .data-banner {
            margin: 1.2rem 2rem 0; padding: 0.8rem 1rem; border-radius: 10px;
            background: rgba(255,254,0,0.12); border: 1px solid var(--neon-yellow);
            color: var(--near-black); font-size: 0.85rem;
            display: flex; align-items: center; gap: 0.5rem;
        }
        .data-banner i { color: var(--near-black); }
        /* Governance posture → top gaps list */
        .posture-gaps { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.6rem 0; }
        .gap-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; padding: 0.5rem 0.8rem; background: var(--off-white); border-radius: 8px; }
        .gap-label { display: flex; align-items: center; gap: 0.5rem; }
        .gap-value { font-weight: 700; color: var(--near-black); }
        /* compact key/value rows (breakdowns, top lists) */
        .mini-row { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.76rem; color: var(--mid-gray); padding: 0.18rem 0; border-bottom: 1px solid var(--off-white); }
        .mini-row:last-child { border-bottom: none; }
        .mini-row strong { color: var(--near-black); white-space: nowrap; }
        .table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
        .table-scroll .mini-table { min-width: 420px; }
        /* keep long values (CA policy names, roles, permissions) on a single line —
           the row never wraps; the table scrolls horizontally instead (desktop + mobile) */
        .table-scroll .mini-table th,
        .table-scroll .mini-table td { white-space: nowrap; }
        .table-scroll .perm-cell { flex-wrap: nowrap; }
        .table-pager { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-top: 0.8rem; font-size: 0.78rem; color: var(--mid-gray); }
        .pager-btn { height: 22px; min-width: 30px; padding: 0 0.6rem; border: 1px solid var(--mid-gray); background: transparent; color: var(--mid-gray); border-radius: 20px; cursor: pointer; font-size: 0.7rem; display: inline-flex; align-items: center; justify-content: center; }
        .pager-btn:hover:not(:disabled) { background: var(--mid-gray); color: var(--pure-white); }
        .pager-btn:disabled { opacity: 0.35; cursor: not-allowed; }
        /* treemap tile text must not clip on the right */
        .treemap-tile { overflow: hidden; }
        .treemap-tile .tm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Exchange-specific extra styles (minimal, only for custom meter sizing) */
        .meter {
            width: 120px;
            height: 120px;
            margin: 0 auto 1rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .meter-inner {
            width: 90px;
            height: 90px;
            background: var(--pure-white);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .meter-value {
            font-size: 1.8rem;
            font-weight: 700;
            line-height: 1.2;
            color: var(--near-black);
        }
        .meter-label {
            font-size: 0.7rem;
            color: var(--mid-gray);
            text-transform: uppercase;
        }
        .quota-bar-bg {
            background: var(--light-gray);
            border-radius: 10px;
            height: 8px;
            overflow: hidden;
            margin: 0.5rem 0;
        }
        .quota-bar-fill {
            background: var(--neon-cyan);
            height: 100%;
            width: 0%;
            border-radius: 10px;
        }
/* Additional generic styles for custom components used in Exchange Onlien dashboard */
        .mini-table { width: 100%; font-size: 0.85rem; border-collapse: collapse; margin-top: 0.5rem; }
        .mini-table th { text-align: left; font-weight: 600; color: var(--mid-gray); padding-bottom: 0.3rem; border-bottom: 1px solid var(--light-gray); }
        .mini-table td { padding: 0.3rem 0; border-bottom: 1px dashed var(--light-gray); }
        .geo-legend { display: flex; gap: 0.8rem; justify-content: center; margin-top: 0.5rem; font-size: 0.7rem; }
        .bubble-legend { font-size: 0.7rem; text-align: center; margin-top: 0.3rem; }
        .log-stream { background: var(--near-black); color: var(--neon-cyan); padding: 0.5rem; border-radius: 12px; font-size: 0.7rem; font-family: monospace; height: 160px; overflow-y: auto; }
        .log-stream div { border-bottom: 1px solid #333; padding: 4px; }

/* SharePoint-specific meter style (same as Entra ID) */
        .meter {
            width: 120px;
            height: 120px;
            margin: 0 auto 1rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .meter.lg { width: 168px; height: 168px; }
        .meter.lg .meter-inner { width: 128px; height: 128px; }
        .meter.lg .meter-value { font-size: 2rem; }
        .meter-inner {
            width: 90px;
            height: 90px;
            background: var(--pure-white);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .meter-value {
            font-size: 1.8rem;
            font-weight: 700;
            line-height: 1.2;
            color: var(--near-black);
        }
        .meter-label {
            font-size: 0.7rem;
            color: var(--mid-gray);
            text-transform: uppercase;
        }
        .external-badge {
            display: inline-block;
            background: var(--neon-yellow);
            color: var(--near-black);
            border-radius: 20px;
            padding: 0.2rem 0.6rem;
            font-size: 0.7rem;
            font-weight: bold;
        }

        /* Teams-specific custom meter (progress ring style) */
        .progress-ring {
            width: 120px;
            height: 120px;
            margin: 0 auto 1rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .progress-ring-inner {
            width: 90px;
            height: 90px;
            background: var(--pure-white);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .progress-value {
            font-size: 1.8rem;
            font-weight: 700;
            line-height: 1.2;
            color: var(--near-black);
        }
        .progress-label {
            font-size: 0.7rem;
            color: var(--mid-gray);
            text-transform: uppercase;
        }
        .policy-badge {
            background: var(--neon-cyan);
            color: var(--near-black);
            border-radius: 20px;
            padding: 0.2rem 0.6rem;
            font-size: 0.7rem;
            font-weight: bold;
        }

/* Additional styles for inventory cards */
        .inventory-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.8rem;
            margin: 0.5rem 0;
        }
        .inventory-item {
            background: var(--off-white);
            border-radius: 12px;
            padding: 0.5rem;
            text-align: center;
        }
        .inventory-number {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--near-black);
        }
        .inventory-label {
            font-size: 0.7rem;
            color: var(--mid-gray);
        }
        .meter {
            width: 120px;
            height: 120px;
            margin: 0 auto 1rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .meter-inner {
            width: 90px;
            height: 90px;
            background: var(--pure-white);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .quota-bar-bg {
            background: var(--light-gray);
            border-radius: 10px;
            height: 8px;
            overflow: hidden;
        }
        .quota-bar-fill {
            background: var(--neon-cyan);
            height: 100%;
            border-radius: 10px;
        }
/* ===== Generic reusable classes for metrics: used in copilot studio page ===== */
        .metric-ring {
            width: 100px;
            height: 100px;
            margin: 0 auto;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .metric-ring-inner {
            width: 75px;
            height: 75px;
            background: var(--pure-white);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        }
        .metric-ring-value {
            font-size: 1.4rem;
            font-weight: 700;
            line-height: 1.2;
            color: var(--near-black);
        }
        .metric-ring-label {
            font-size: 0.65rem;
            color: var(--mid-gray);
            text-transform: uppercase;
        }
        .usage-list {
            list-style: none;
            padding: 0;
            margin: 0.5rem 0;
        }
        .usage-list li {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            margin-bottom: 0.6rem;
            font-size: 0.8rem;
        }
        .stat-bar-bg {
            flex: 1;
            height: 8px;
            background: var(--light-gray);
            border-radius: 10px;
            overflow: hidden;
        }
        .stat-bar-fill {
            height: 100%;
            border-radius: 10px;
            width: 0%;
        }
        .status-ring-group {
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap;
            gap: 1rem;
            margin: 0.5rem 0;
        }
        .mini-badge {
            background: var(--off-white);
            padding: 0.2rem 0.6rem;
            border-radius: 20px;
            font-size: 0.7rem;
        }

/* Custom styles for Defender-specific meters, progress rings, etc. */
        .threat-gauge {
            width: 100px;
            height: 100px;
            margin: 0 auto 0.5rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .threat-gauge-inner {
            width: 75px;
            height: 75px;
            background: var(--pure-white);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .stat-badge {
            background: var(--off-white);
            border-radius: 20px;
            padding: 0.2rem 0.6rem;
            font-size: 0.7rem;
        }
        .severity-critical { background: var(--neon-red); color: #fff; }
        .severity-high { background: #ff8c00; color: #fff; }
        .severity-medium { background: var(--neon-yellow); color: var(--near-black); }
        .severity-low { background: var(--neon-green); }
        .incident-row { display: flex; justify-content: space-between; margin-bottom: 0.6rem; }

/* Custom styles for Purview – all classes are generic and can be moved to app.css */
        .gauge-wrapper {
            display: flex;
            justify-content: center;
            margin: 0.5rem 0;
        }
        .stat-badge {
            background: var(--off-white);
            border-radius: 20px;
            padding: 0.2rem 0.8rem;
            font-size: 0.75rem;
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
        }
        .health-ring {
            width: 90px;
            height: 90px;
            margin: 0 auto;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .health-ring-inner {
            width: 70px;
            height: 70px;
            background: var(--pure-white);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .trend-up { color: var(--neon-green); }
        .trend-down { color: var(--neon-red); }
        .info-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.8rem;
            margin: 0.5rem 0;
        }
        .info-item {
            background: var(--off-white);
            border-radius: 12px;
            padding: 0.5rem;
            text-align: center;
        }
        .info-label {
            font-size: 0.7rem;
            color: var(--mid-gray);
            text-transform: uppercase;
        }
        .info-value {
            font-size: 1.2rem;
            font-weight: 700;
        }

/* ===== SharePoint page compaction: combined cards, gauge, OneDrive split ===== */
/* reduce desktop card heights (mobile keeps its own auto heights) */
.cards-grid.varied { grid-auto-rows: minmax(190px, auto); }
.cards-grid.varied .card { min-height: 0; }

/* inventory+activity sub-heading */
.card-subhead { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mid-gray); font-weight: 700; margin: .8rem 0 .45rem; border-top: 1px solid var(--off-white); padding-top: .5rem; }
.card-stats-divided { border-top: 1px solid var(--light-gray); margin-top: .55rem; padding-top: .55rem; }

/* radial gauge (Tenant Storage) */
.gauge-wrap { position: relative; display: flex; align-items: center; justify-content: center; margin: .4rem 0 .7rem; }
.gauge-chart { position: relative; width: 190px; height: 100px; }
.gauge-chart canvas { position: absolute; inset: 0; }
.gauge-center { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; }
.gauge-num { font-size: 2rem; font-weight: 800; letter-spacing: -1px; color: var(--near-black); display: block; line-height: 1; }
.gauge-lbl { font-size: .62rem; color: var(--mid-gray); }

/* combined "combo" cards (Ownership, Structure) */
.combo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 12px; margin-top: .4rem; }
.combo-panel { background: var(--off-white); border: 1px solid var(--light-gray); border-radius: 11px; padding: .75rem .85rem; display: flex; flex-direction: column; min-width: 0; }
.combo-panel .card-stats { margin-top: auto; }
.combo-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mid-gray); font-weight: 700; display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.combo-title i { color: var(--neon-cyan); }
.combo-title .status-badge { margin-left: auto; font-size: .58rem; padding: .1rem .5rem; }
.combo-note { font-size: .64rem; color: var(--mid-gray); margin-top: .5rem; line-height: 1.35; }
.combo-span2 { grid-column: span 2; }
.combo-panel .chart-container.donut { max-height: 128px; }
.combo-panel .meter { width: 94px; height: 94px; margin: .2rem auto .5rem; }
.combo-panel .meter-inner { width: 70px; height: 70px; }
.combo-panel .meter-value { font-size: 1.2rem; }
.combo-panel #criticalList { font-size: .82rem; }

/* OneDrive: inventory left, table right */
.od-body { display: grid; grid-template-columns: 220px 1fr; gap: 1.4rem; align-items: start; margin-top: .5rem; }
.od-inv { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.od-right { min-width: 0; }
@media (max-width: 768px) {
    .combo-span2 { grid-column: auto; }
    .od-body { grid-template-columns: 1fr; }
}

/* ===== in-card mini-dashboards (Ownership, Structure) ===== */
.mini-dash { display: grid; gap: 0; margin-top: .5rem; }
.mini-dash.md-3 { grid-template-columns: 1.25fr 1fr 1fr; }
.struct-dash { grid-template-columns: repeat(3, 1fr); }
.md-col { padding: 0 1.3rem; border-left: 1px solid var(--light-gray); display: flex; flex-direction: column; min-width: 0; }
.md-col:first-child { padding-left: 0; border-left: none; }
.md-cap { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mid-gray); font-weight: 700; display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; }
.md-cap i { color: var(--neon-cyan); }
.md-cap .status-badge { margin-left: auto; font-size: .56rem; padding: .1rem .5rem; }
.md-cap.sm { font-size: .65rem; margin-bottom: .4rem; }
.md-sub { margin-top: .9rem; padding-top: .7rem; border-top: 1px solid var(--off-white); }
.md-hero-row { display: flex; gap: 1rem; align-items: center; }
.md-donut { flex: 0 0 150px; height: 150px; }
.md-donut-sm { flex: 0 0 92px; height: 92px; margin: 0; }
.md-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.md-legend .stat-item { white-space: normal; font-size: .72rem; }
.md-hero-row #classificationList { max-height: none; overflow: visible; }
.md-row-inline { display: flex; gap: .8rem; align-items: center; }
.meter.sm { width: 78px; height: 78px; margin: .2rem 0; flex: 0 0 78px; }
.meter.sm .meter-inner { width: 56px; height: 56px; }
.meter.sm .meter-value { font-size: 1rem; }
.md-dist { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--light-gray); }
.card-oneliner { font-size: .66rem; color: var(--mid-gray); margin-top: .5rem; display: flex; align-items: center; gap: .4rem; }
.card-oneliner i { color: var(--neon-cyan); }
@media (max-width: 768px) {
    .mini-dash.md-3, .struct-dash { grid-template-columns: 1fr; }
    .md-col { padding: 0; border-left: none; border-top: 1px solid var(--light-gray); padding-top: 1rem; margin-top: 1rem; }
    .md-col:first-child { border-top: none; margin-top: 0; padding-top: 0; }
}

/* ===================================================================
   ENTRA ID — split tables, permission tags, cross-tenant settings
   =================================================================== */
.split-tables { display: flex; flex-wrap: wrap; gap: 0; }
.split-col { flex: 1 1 340px; min-width: 0; padding: 0 1.4rem; }
.split-col:first-child { padding-left: 0; }
.split-col:last-child { padding-right: 0; }
.split-col + .split-col { border-left: 1px solid var(--light-gray); }
.split-cap { display: flex; justify-content: space-between; align-items: center; gap: .6rem; font-weight: 600; font-size: .9rem; margin: 0 0 .7rem; color: var(--near-black); }
.split-cap > span:first-child i { color: var(--mid-gray); margin-right: .4rem; }
.split-kpis { font-size: .7rem; color: var(--mid-gray); font-weight: 500; text-align: right; }
.table-scroll.tall { max-height: 340px; overflow-y: auto; }

/* permission tags */
.perm-cell { display: flex; flex-wrap: wrap; gap: .25rem; }
.perm-tag { display: inline-block; font-size: .66rem; padding: .12rem .4rem; border-radius: 4px; background: var(--off-white); color: var(--mid-gray); white-space: nowrap; }
.perm-tag.high { background: var(--neon-red); color: #1a1f2b; font-weight: 600; }
.perm-legend { font-size: .68rem; color: var(--mid-gray); font-weight: 400; margin-left: .5rem; }

/* dashboard: "no live data yet" placeholder note on sample cards */
.sample-note { display: flex; align-items: center; gap: .4rem; font-size: .68rem; color: var(--mid-gray); background: var(--off-white); border: 1px dashed var(--light-gray); border-radius: 6px; padding: .35rem .55rem; margin: .5rem 0 0; }
.sample-note i { color: var(--soft-lavender); }

/* ranked SKU list — scroll when there are many SKUs */
.rank-scroll { max-height: 280px; overflow-y: auto; padding-right: .3rem; }

/* Applications: inventory (half width) + meta column */
.app-top { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: .3rem; }
.app-top .app-inv { flex: 0 0 46%; display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin: 0; }
.app-meta { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: .5rem; }
.app-meta .stat-item { white-space: normal; }
@media (max-width: 760px) {
    .app-top .app-inv { flex-basis: 100%; }
    .app-meta { min-width: 0; }
}

/* cross-tenant access & sync */
.xts-health { margin-bottom: 1rem; }
.xts-defaults { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.1rem; }
.xts-default-card, .xts-card { border: 1px solid var(--light-gray); border-radius: 10px; padding: .85rem 1rem; }
.xts-cap { font-weight: 600; font-size: .82rem; margin-bottom: .55rem; color: var(--near-black); }
.xts-cap i { color: var(--mid-gray); margin-right: .4rem; }
.xts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.xts-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .55rem; padding-bottom: .45rem; border-bottom: 1px solid var(--off-white); }
.xts-org { font-weight: 600; font-size: .85rem; color: var(--near-black); word-break: break-word; }
.xts-users { font-size: .7rem; color: var(--mid-gray); white-space: nowrap; }
.xts-setting { display: flex; justify-content: space-between; align-items: center; font-size: .76rem; margin: .28rem 0; color: var(--mid-gray); }
.xts-val { font-weight: 600; display: inline-flex; align-items: center; color: var(--near-black); }
@media (max-width: 760px) {
    .split-col { padding: 0; flex-basis: 100%; }
    .split-col + .split-col { border-left: none; border-top: 1px solid var(--light-gray); padding-top: 1rem; margin-top: 1rem; }
    .xts-defaults { grid-template-columns: 1fr; }
}
