/* 
 * VoiceVerSign - Maxton Admin Dashboard Theme 
 * Exact dark-theme replica of the provided dashboard reference.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --maxton-bg: var(--bg-primary, #f4f4f5);
    --maxton-card: var(--bg-elevated, #ffffff);
    --maxton-input: var(--bg-secondary, #eaeaf0);
    --maxton-text-main: var(--text-primary, #1d1d23);
    --maxton-text-muted: var(--text-secondary, #6b6b80);

    --maxton-cyan: #22c55e;
    --maxton-pink: #ec4899;
    --maxton-purple: #8b5cf6;
    --maxton-green: #22c55e;
    --maxton-yellow: #f59e0b;
    --maxton-red: #ef4444;
    --maxton-blue: #16a34a;
    --maxton-gray: #64748b;

    --maxton-border: var(--border, #e5e5ea);
    --maxton-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
    --vvs-hearing: #3b82f6;
    --vvs-deaf: #8b5cf6;
    --vvs-admin: #22c55e;
    --vvs-ink: #15803d;
    --vvs-ready: #0891b2;
    --vvs-sign: #ea580c;
    --vvs-check: #f59e0b;
    --vvs-alert: #ef4444;
    --vvs-users: var(--vvs-ink);
    --vvs-chats: var(--vvs-ink);
    --vvs-messages: var(--vvs-ink);
    --vvs-feedback: var(--vvs-ink);
    font-family: var(--font, 'Inter', sans-serif);
}

[data-theme="dark"] {
    --maxton-bg: #14142f;
    --maxton-card: #1c1d42;
    --maxton-input: #151633;
    --maxton-text-main: #f8fafc;
    --maxton-text-muted: #94a3b8;
    --vvs-ink: #22c55e;
    --vvs-ready: #22d3ee;
    --vvs-sign: #fb923c;
    --maxton-border: rgba(255, 255, 255, 0.05);
    --maxton-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

html,
body.admin-page {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--maxton-bg);
    color: var(--maxton-text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

body.admin-page {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ── LAYOUT ── */
.maxton-sidebar {
    width: 260px;
    background-color: var(--maxton-bg);
    border-right: 1px solid var(--maxton-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    height: 100dvh;
    position: sticky;
    top: 0;
    margin-left: 0;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.maxton-sidebar.collapsed {
    margin-left: -260px;
    transform: none;
}

/* On smaller screens, the sidebar floats above content and is hidden by default. If it has .collapsed, we hide it.
Wait, if users open it, we should remove .collapsed. */

.maxton-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 0 16px 8px;
    overflow: hidden;
}

.admin-view {
    animation: adminFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top center;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

@keyframes adminFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.maxton-topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-shrink: 0;
}

/* ── SIDEBAR ── */
.maxton-brand {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 20px;
    font-weight: 700;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.maxton-brand-mark {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.4));
}

.maxton-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.maxton-brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--accent, var(--maxton-text-main));
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.maxton-brand-role {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--maxton-cyan);
}

.maxton-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--maxton-cyan), var(--maxton-purple));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maxton-menu {
    padding: 12px;
    overflow-y: auto;
    scrollbar-width: none;
}

.maxton-menu::-webkit-scrollbar {
    display: none;
}

.maxton-menu-group {
    margin-bottom: 24px;
}

.maxton-menu-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--maxton-text-muted);
    letter-spacing: 0.5px;
    margin: 0 12px 8px;
    font-weight: 600;
}

.maxton-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--maxton-text-muted);
    font-size: 14px;
    gap: 12px;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 4px;
}

.maxton-menu-count {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--maxton-red, #ef4444);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--maxton-sidebar-bg, #12122a), 0 0 10px rgba(239, 68, 68, 0.55);
    animation: maxton-count-pop 0.3s ease;
}

.maxton-menu-count[hidden] {
    display: none;
}

@keyframes maxton-count-pop {
    0% { transform: scale(0.6); }
    70% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.maxton-menu-item:hover,
.maxton-menu-item.active {
    background-color: var(--maxton-card);
    color: var(--maxton-text-main);
}

.maxton-menu-item.active {
    background-color: rgba(34, 197, 94, 0.12);
    color: var(--maxton-green);
}

.maxton-menu-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

/* ── TOPBAR ── */
.maxton-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.maxton-icon-btn {
    background: transparent;
    border: none;
    color: var(--maxton-text-muted);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
}

.maxton-icon-btn:hover {
    background-color: var(--maxton-card);
    color: var(--maxton-text-main);
}

.maxton-badge.is-off,
.maxton-badge[hidden] {
    display: none !important;
}

.maxton-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background-color: var(--maxton-red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--maxton-bg);
}

.maxton-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0b694;
    box-shadow: 0 0 0 2px rgba(224, 182, 148, 0.22);
}

/* ── GRID SYSTEM ── */
.maxton-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

#dashboardGrid {
    min-height: 0;
    flex: 1 1 auto;
    gap: 14px;
    grid-template-rows: none;
    grid-auto-rows: max-content;
    grid-auto-flow: dense;
    overflow: auto;
    align-content: start;
    align-items: stretch;
    padding-bottom: 16px;
}

#analyticsView {
    --vvs-sign-1: #fdba74;
    --vvs-sign-2: #fb923c;
    --vvs-sign-3: #f97316;
    --vvs-sign-4: #c2410c;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 12px;
}

.admin-usage__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.admin-usage__head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--maxton-text-main);
}

.admin-usage__head p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--maxton-text-muted);
}

#analyticsView .admin-usage__kpis {
    margin-top: 0;
    flex: none;
}

.overview-kpi__date {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--maxton-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-usage__range-note {
    flex: none;
    position: relative;
    z-index: 2;
    margin: 8px 0 0;
    padding-top: 2px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--maxton-text-muted);
    text-align: right;
    background: var(--maxton-card);
}

#analyticsView .overview-kpi:first-child strong {
    color: var(--vvs-sign-3);
}

.admin-usage__grid {
    display: grid;
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 0.9fr) minmax(0, 1.15fr);
    gap: 14px;
    overflow: hidden;
}

.admin-usage__grid .maxton-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.admin-usage__trend {
    overflow: hidden;
}

.admin-usage__trend .chart-container-md {
    position: relative;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
}

.admin-usage__trend .chart-container-md canvas {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.admin-usage__types .chart-pie-body,
.admin-usage__library .chart-pie-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
}

.admin-usage__types .chart-container-pie,
.admin-usage__library .chart-container-pie {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
}

.admin-usage__types .chart-pie-frame,
.admin-usage__library .chart-pie-frame {
    --pie-caption: 24px;
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.admin-usage__types .chart-pie-frame canvas,
.admin-usage__library .chart-pie-frame canvas {
    position: relative;
    top: auto;
    left: auto;
    width: auto !important;
    height: calc(100% - var(--pie-caption)) !important;
    max-height: calc(100% - var(--pie-caption));
    aspect-ratio: 1 / 1;
    max-width: 100%;
    flex: 0 1 auto;
}

.admin-usage__types .chart-pie-center,
.admin-usage__library .chart-pie-center,
.admin-usage__types .chart-pie-center.is-focus,
.admin-usage__library .chart-pie-center.is-focus {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
    width: 100%;
    height: var(--pie-caption);
    min-height: var(--pie-caption);
    max-height: var(--pie-caption);
    flex: none;
    flex-direction: row;
    align-items: baseline;
    overflow: hidden;
}

.admin-usage__types .overview-legend,
.admin-usage__library .overview-legend {
    flex: none;
}

.admin-usage__library .maxton-card-title,
.admin-usage__library .maxton-card-header .stat-desc {
    white-space: nowrap;
}

#usageRoleList {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 10px;
}

.admin-usage__library .overview-legend {
    grid-template-columns: 1fr;
}

.admin-usage__empty {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--maxton-text-muted);
    text-align: center;
}

.overview-legend__item.is-sign-1::before { background: var(--vvs-sign-1); }
.overview-legend__item.is-sign-2::before { background: var(--vvs-sign-2); }
.overview-legend__item.is-sign-3::before { background: var(--vvs-sign-3); }
.overview-legend__item.is-sign-4::before { background: var(--vvs-sign-4); }

.admin-usage__types .overview-legend {
    grid-template-columns: 1fr;
}

#usageRoleList li.admin-usage__role {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 40px;
    align-items: center;
    gap: 12px;
}

#usageRoleList .list-sub {
    margin-left: 0;
    font-size: 12px;
    color: var(--maxton-text-muted);
}

#usageRoleList .list-value {
    text-align: right;
}

.admin-usage__role .list-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.admin-usage__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
}

.admin-usage__bar {
    height: 6px;
    border-radius: 999px;
    background: var(--maxton-input);
    overflow: hidden;
}

.admin-usage__bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width .4s ease;
}

.admin-usage__role.is-hearing .admin-usage__dot,
.admin-usage__role.is-hearing .admin-usage__bar i { background: var(--vvs-hearing); }
.admin-usage__role.is-deaf .admin-usage__dot,
.admin-usage__role.is-deaf .admin-usage__bar i { background: var(--vvs-deaf); }
.admin-usage__role.is-admin .admin-usage__dot,
.admin-usage__role.is-admin .admin-usage__bar i { background: var(--vvs-admin); }

@media (max-width: 1000px) {
    .admin-usage__grid {
        flex: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: max-content;
        min-height: 0;
        gap: 12px;
    }

    .admin-usage__grid > .maxton-card {
        min-height: auto;
    }

    .admin-usage__trend,
    .admin-usage__roles {
        grid-column: 1 / -1;
    }

    .admin-usage__roles {
        order: 1;
    }

    .admin-usage__grid .maxton-card-header {
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    .admin-usage__trend .chart-container-md {
        height: 240px;
        min-height: 240px;
        flex: none;
    }

    .admin-usage__types .chart-container-pie,
    .admin-usage__library .chart-container-pie {
        height: 180px;
        min-height: 180px;
        flex: none;
    }

    .admin-usage__types .chart-pie-frame,
    .admin-usage__library .chart-pie-frame {
        height: auto;
        max-height: none;
        aspect-ratio: 1 / 1.16;
        width: min(100%, 168px);
        margin: 0 auto;
    }

    .admin-usage__types .overview-legend,
    .admin-usage__library .overview-legend {
        margin-top: 10px;
    }

    .admin-usage__library .maxton-card-title,
    .admin-usage__library .maxton-card-header .stat-desc {
        white-space: normal;
    }
}

@media (max-width: 640px) {
    #analyticsView {
        gap: 10px;
    }

    .admin-usage__head h2 {
        font-size: 18px;
    }

    #analyticsView .admin-usage__kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .admin-usage__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .admin-usage__grid > .maxton-card {
        padding: 14px;
    }

    .admin-usage__trend .chart-container-md {
        height: 210px;
        min-height: 210px;
    }

    #usageRoleList li.admin-usage__role {
        grid-template-columns: minmax(0, 1fr) minmax(60px, 0.8fr) 32px;
        gap: 8px;
    }
}

#dashboardGrid .maxton-card {
    min-height: 0;
    height: auto;
    overflow: hidden;
    padding: 16px 18px;
}

#dashboardGrid .card-welcome { min-height: 240px; }
#dashboardGrid .card-accounts-pie,
#dashboardGrid .card-workspace-bar,
#dashboardGrid .card-signs-bar,
#dashboardGrid .card-system-pie,
#dashboardGrid .card-overview-top { min-height: 280px; }
#dashboardGrid .card-overview-detail { min-height: 0; overflow: visible; }
#dashboardGrid .card-overview-roles,
#dashboardGrid .card-overview-recent,
#dashboardGrid .card-overview-pipeline { min-height: 220px; }

#dashboardGrid .maxton-card-header {
    margin-bottom: 6px;
    flex-shrink: 0;
}

#dashboardGrid .maxton-card-title {
    font-size: 15px;
}

#dashboardGrid .chart-container-md {
    flex: none;
    min-height: 200px;
    height: 220px;
    margin-top: 8px;
}

#dashboardGrid .chart-container-pie {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    position: relative;
    overflow: visible;
}

#dashboardGrid .chart-pie-frame {
    height: 190px;
    width: auto;
    aspect-ratio: 1 / 1.14;
    max-width: 100%;
    max-height: 210px;
}

#dashboardGrid .card-accounts-pie,
#dashboardGrid .card-system-pie {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 12px 16px;
    overflow: visible;
}

#dashboardGrid .chart-pie-body {
    flex: none;
    min-height: 190px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(118px, 0.9fr);
    gap: 12px 14px;
    align-items: center;
}

#dashboardGrid .card-accounts-pie .overview-legend,
#dashboardGrid .card-system-pie .overview-legend {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    margin: 0;
    width: 100%;
    min-width: 0;
}

#dashboardGrid .chart-pie-body .overview-legend__item {
    grid-template-columns: 8px minmax(0, 1fr);
    grid-template-rows: auto auto;
    row-gap: 4px;
    padding: 8px 10px;
}

#dashboardGrid .chart-pie-body .overview-legend__item::before {
    grid-row: 1 / span 2;
}

#dashboardGrid .chart-pie-body .overview-legend__name,
#dashboardGrid .chart-pie-body .overview-legend__nums {
    grid-column: 2;
}

#dashboardGrid .chart-pie-body .overview-legend__nums {
    justify-content: space-between;
}

#dashboardGrid .chart-pie-body .overview-legend__nums b:first-child {
    font-size: 16px;
}

#dashboardGrid .overview-kpis {
    margin-top: 12px;
    gap: 10px;
    flex: none;
    align-content: start;
}

#dashboardGrid .overview-kpi {
    padding: 14px 16px;
    justify-content: center;
    min-height: 72px;
}

#dashboardGrid .overview-kpi span {
    font-size: 12px;
}

#dashboardGrid .overview-kpi strong {
    font-size: 22px;
}

#dashboardGrid .maxton-list {
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 240px;
}

#dashboardGrid .maxton-list li {
    padding: 10px 0;
}

.maxton-card {
    background-color: var(--maxton-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--maxton-shadow);
    display: flex;
    flex-direction: column;
}

.maxton-breadcrumbs {
    font-size: 13px;
    color: var(--maxton-text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.maxton-breadcrumbs span {
    color: var(--maxton-text-main);
    font-weight: 500;
}

.maxton-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.maxton-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--maxton-text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.maxton-card-title svg,
.admin-title-ico {
    width: 18px;
    height: 18px;
    color: #22c55e;
    flex-shrink: 0;
}

.w-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--maxton-text-main);
}

.w-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--maxton-text-muted);
}

.w-stat-label svg,
.stat-desc svg.admin-title-ico {
    width: 14px;
    height: 14px;
    color: #22c55e;
}

.uiverse-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.admin-gesture-toolbar .uiverse-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Specific Card Placements in Bento Grid */
#dashboardGrid .card-welcome {
    grid-column: 1 / 9;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    min-height: 0;
    padding: 16px;
}

#dashboardGrid .card-accounts-pie {
    grid-column: 9 / 13;
    grid-row: 1;
}

#dashboardGrid .card-workspace-bar {
    grid-column: 1 / 5;
    grid-row: 2;
}

#dashboardGrid .card-signs-bar {
    grid-column: 5 / 9;
    grid-row: 2;
}

#dashboardGrid .card-system-pie {
    grid-column: 9 / 13;
    grid-row: 2;
}

#dashboardGrid .card-overview-detail {
    grid-column: 1 / 9;
    grid-row: 3;
}

#dashboardGrid .card-overview-top {
    grid-column: 9 / 13;
    grid-row: 3;
}

#dashboardGrid .card-overview-roles {
    grid-column: 1 / 5;
    grid-row: 4;
}

#dashboardGrid .card-overview-recent {
    grid-column: 5 / 9;
    grid-row: 4;
}

#dashboardGrid .card-overview-pipeline {
    grid-column: 9 / 13;
    grid-row: 4;
}

.card-welcome {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.card-overview-roles .maxton-list,
.card-overview-recent .maxton-list,
.card-overview-pipeline .maxton-list {
    margin-top: 4px;
    overflow: hidden;
}

.card-active-users {
    grid-column: span 4;
}

.card-total-users {
    grid-column: span 4;
}

.card-monthly-revenue {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
}

.card-device-type {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-clicks {
    grid-column: span 4;
}

.card-views {
    grid-column: span 4;
}

.card-accounts {
    grid-column: span 6;
}

.card-campaigns {
    grid-column: span 6;
}

.card-social {
    grid-column: span 4;
}

/* Push feedback to bottom right corner */
.card-feedbacks {
    grid-column: span 8;
}

/* ── WELCOME BANNER ── */
.welcome-info {
    z-index: 2;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    height: 100%;
    justify-content: space-between;
}

.welcome-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.welcome-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid var(--maxton-cyan);
}

.welcome-greeting h2 {
    margin: 0;
    font-size: clamp(26px, 2.8vw, 34px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.welcome-greeting p {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--vvs-admin);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.welcome-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}

.welcome-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--maxton-input);
    border: 1px solid var(--maxton-border);
}

.welcome-stat .w-stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
    font-variant-numeric: tabular-nums;
    color: var(--vvs-ink);
}

.welcome-stat .w-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: inherit;
}

.welcome-stat .w-stat-label svg,
.welcome-stat .admin-title-ico {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.welcome-stat .w-stat-bar {
    height: 4px;
    width: 100%;
    background: var(--maxton-card);
    border-radius: 999px;
    margin-top: auto;
    overflow: hidden;
}

.welcome-stat .w-stat-bar {
    display: flex;
    gap: 2px;
    height: 6px;
}

.welcome-stat .w-stat-bar div {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    transition: width 0.4s ease;
}

.welcome-stat .w-stat-bar.is-empty {
    background: color-mix(in srgb, var(--vvs-ink) 14%, transparent);
}

.welcome-stat.welcome-stat .w-stat-bar div.is-hearing { background: var(--vvs-hearing); }
.welcome-stat.welcome-stat .w-stat-bar div.is-deaf { background: var(--vvs-deaf); }
.welcome-stat.welcome-stat .w-stat-bar div.is-admin { background: var(--vvs-admin); }

.w-stat-legend,
.chart-key {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--maxton-text-muted);
    font-variant-numeric: tabular-nums;
}

.w-stat-legend span,
.chart-key span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.w-stat-legend i,
.chart-key i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.w-stat-legend .is-hearing i,
.chart-key .is-hearing i { background: var(--vvs-hearing); }
.w-stat-legend .is-deaf i,
.chart-key .is-deaf i { background: var(--vvs-deaf); }
.w-stat-legend .is-admin i,
.chart-key .is-admin i { background: var(--vvs-admin); }

.welcome-stat.is-users { color: var(--vvs-users); }
.welcome-stat.is-users .w-stat-bar div { background: var(--vvs-users); }
.welcome-stat.is-users .admin-title-ico,
.welcome-stat.is-users .w-stat-label svg { color: var(--vvs-users); }
.welcome-stat.is-chats { color: var(--vvs-chats); }
.welcome-stat.is-chats .w-stat-bar div { background: var(--vvs-chats); }
.welcome-stat.is-chats .admin-title-ico,
.welcome-stat.is-chats .w-stat-label svg { color: var(--vvs-chats); }
.welcome-stat.is-messages { color: var(--vvs-messages); }
.welcome-stat.is-messages .w-stat-bar div { background: var(--vvs-messages); }
.welcome-stat.is-messages .admin-title-ico,
.welcome-stat.is-messages .w-stat-label svg { color: var(--vvs-messages); }
.welcome-stat.is-feedback { color: var(--vvs-feedback); }
.welcome-stat.is-feedback .w-stat-bar div { background: var(--vvs-feedback); }
.welcome-stat.is-feedback .admin-title-ico,
.welcome-stat.is-feedback .w-stat-label svg { color: var(--vvs-feedback); }

.welcome-greeting p .admin-title-ico {
    color: var(--vvs-admin);
}

.welcome-illustration {
    position: absolute;
    right: 0;
    bottom: -10px;
    height: 120%;
    z-index: 1;
    opacity: 0.9;
    pointer-events: none;
}

/* ── WIDGET TYPOGRAPHY ── */
.stat-large {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 4px;
}

.stat-desc {
    font-size: 12px;
    color: var(--maxton-text-muted);
}

.stat-desc:has(> svg.admin-title-ico) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stat-desc span {
    color: var(--maxton-green);
    font-weight: 600;
}

.stat-desc span.down {
    color: var(--maxton-red);
}

.chart-container-sm,
.chart-container-md,
.chart-container-pie {
    width: 100%;
    max-width: 100%;
    position: relative;
}

.chart-container-sm {
    height: clamp(110px, 18vh, 160px);
    margin-top: auto;
}

.chart-container-md {
    height: clamp(160px, 26vh, 240px);
    margin-top: 12px;
    flex: 1 1 auto;
    min-height: 150px;
}

.chart-container-sm canvas,
.chart-container-md canvas {
    width: 100% !important;
    max-width: 100%;
    height: 100% !important;
    display: block;
}

.chart-container-pie {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ── Pie charts: square pie on top, total / hovered slice caption underneath ── */
.chart-pie-frame {
    --pie-caption: 28px;
    position: relative;
    width: min(100%, 200px);
    aspect-ratio: 1 / 1.14;
    flex: 0 0 auto;
    z-index: 0;
}

.chart-pie-frame canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: calc(100% - var(--pie-caption)) !important;
    max-width: 100%;
    max-height: calc(100% - var(--pie-caption));
    display: block;
    z-index: 1;
}

.chart-pie-center {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--pie-caption);
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    z-index: 2;
    text-align: center;
    padding: 0;
    min-width: 0;
}

.chart-pie-center strong {
    font-size: clamp(16px, 2.2vh, 22px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--maxton-text-main);
    font-variant-numeric: tabular-nums;
}

.chart-pie-center span {
    margin-top: 0;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--maxton-text-muted);
    font-variant-numeric: tabular-nums;
}

.device-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 14px;
    margin-top: 8px;
}

.overview-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.card-system-pie .overview-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.device-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--maxton-text-muted);
    width: auto;
    max-width: 100%;
    flex: 0 0 auto;
    white-space: nowrap;
}

.overview-legend__item {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    column-gap: 8px;
    row-gap: 0;
    align-items: center;
    min-width: 0;
    width: auto;
    padding: 6px 8px;
    border-radius: 10px;
    background: var(--maxton-input);
    border: 1px solid var(--maxton-border);
    font-size: 11px;
    font-weight: 600;
    color: var(--maxton-text-muted);
    cursor: default;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.overview-legend__item.is-hover {
    border-color: var(--slice, rgba(148, 163, 184, 0.65));
    background: color-mix(in srgb, var(--slice, #94a3b8) 12%, var(--maxton-input));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--slice, #94a3b8) 16%, transparent);
    transform: translateX(-2px);
}

.overview-legend__item.is-hover .overview-legend__name {
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
}

.chart-ring-body {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: center;
    gap: 8px;
    overflow: hidden;
    padding: 2px 0 0;
}

.chart-ring {
    position: relative;
    height: 100%;
    width: auto;
    max-width: min(100%, 200px);
    max-height: min(200px, 100%);
    aspect-ratio: 1;
    min-height: 0;
}

.chart-ring canvas {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
}

.chart-ring__center {
    position: absolute;
    inset: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    text-align: center;
    pointer-events: none;
}

.chart-ring__center strong {
    font-size: clamp(13px, 1.6vh, 16px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--maxton-text-main);
    transition: opacity 0.25s ease, transform 0.35s ease;
}

.chart-ring__center span {
    max-width: 100%;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--maxton-text-muted);
    white-space: nowrap;
}

.vvs-chart-tip {
    position: fixed;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: max-content;
    max-width: min(280px, calc(100vw - 16px));
    padding: 8px 10px;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.22s ease;
}

.vvs-chart-tip.is-on {
    opacity: 1;
    transform: none;
}

.vvs-chart-tip[hidden] {
    display: none;
}

.vvs-chart-tip__row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.vvs-chart-tip__swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex: none;
}

.vvs-chart-tip__name {
    min-width: 0;
    white-space: nowrap;
}

.vvs-chart-tip b {
    margin-left: auto;
    font-weight: 700;
    white-space: nowrap;
}

.chart-ring-body .overview-legend {
    width: 100%;
    grid-template-columns: 1fr;
    margin: 0;
    flex: none;
}

.chart-share {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.chart-share__total {
    margin: 0;
    text-align: center;
    color: var(--maxton-text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chart-share__total strong {
    display: inline-block;
    margin-right: 6px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--maxton-text-main);
    text-transform: none;
}

.chart-share .overview-legend {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
}

.chart-share .overview-legend__item {
    grid-template-columns: 8px minmax(0, 1fr) auto;
    grid-template-rows: auto 12px;
    row-gap: 8px;
    align-items: center;
}

.overview-legend__track {
    grid-column: 1 / -1;
    height: 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    overflow: hidden;
}

.overview-legend__track i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--vvs-sign-2);
}

.overview-legend__item.is-hearing .overview-legend__track i { background: var(--vvs-hearing); }
.overview-legend__item.is-deaf .overview-legend__track i { background: var(--vvs-deaf); }
.overview-legend__item.is-sign-1 .overview-legend__track i { background: var(--vvs-sign-1); }
.overview-legend__item.is-sign-3 .overview-legend__track i { background: var(--vvs-sign-3); }

.chart-pie-center strong,
.chart-pie-center span {
    transition: color 0.2s ease;
}

.chart-pie-center.is-focus {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    top: auto;
    bottom: 0;
    height: var(--pie-caption);
    min-height: var(--pie-caption);
    max-height: var(--pie-caption);
    gap: 1px;
    overflow: hidden;
    z-index: 4;
}

.chart-pie-center.is-focus strong {
    color: var(--slice, var(--maxton-text-main));
    font-size: 14px;
}

.chart-pie-center.is-focus span {
    color: var(--maxton-text-main);
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    letter-spacing: 0.02em;
    line-height: 1.15;
    font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
    .overview-legend__item { transition: none; }
    .overview-legend__item.is-hover { transform: none; }
}

.device-item::before,
.overview-legend__item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.overview-legend__item::before {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    margin: 0;
}

.overview-legend__name {
    grid-column: 2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--maxton-text-muted);
}

.overview-legend__nums {
    grid-column: 3;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    margin: 0;
    color: var(--maxton-text-main);
    font-variant-numeric: tabular-nums;
}

.overview-legend__nums b {
    font-weight: 800;
    line-height: 1;
}

.overview-legend__nums b:first-child {
    font-size: 13px;
    color: var(--maxton-text-main);
}

.overview-legend__nums b:last-child {
    font-size: 11px;
    font-weight: 700;
    color: var(--maxton-text-muted);
}

.overview-legend__item.is-hearing::before,
.overview-role-row.is-hearing .overview-role-dot { background: var(--vvs-hearing); }
.overview-legend__item.is-deaf::before,
.overview-role-row.is-deaf .overview-role-dot { background: var(--vvs-deaf); }
.overview-legend__item.is-admin::before,
.overview-role-row.is-admin .overview-role-dot { background: var(--vvs-admin); }
.overview-role-row.is-users .overview-role-dot { background: var(--vvs-users); }
.overview-legend__item.is-ready::before { background: var(--vvs-ready); }
.overview-legend__item.is-check::before { background: var(--vvs-check); }

.overview-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.overview-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--maxton-input);
    border: 1px solid var(--maxton-border);
}

.overview-kpi span {
    font-size: 11px;
    font-weight: 600;
    color: var(--maxton-text-muted);
}

.overview-kpi strong {
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--vvs-ink);
}

.overview-kpi.is-hearing strong { color: var(--vvs-hearing); }
.overview-kpi.is-deaf strong { color: var(--vvs-deaf); }
.overview-kpi.is-admin strong { color: var(--vvs-admin); }
.overview-kpi.is-users strong { color: var(--vvs-users); }
.overview-kpi.is-chats strong { color: var(--vvs-chats); }
.overview-kpi.is-messages strong { color: var(--vvs-messages); }
.overview-kpi.is-feedback strong { color: var(--vvs-feedback); }
.overview-kpi.is-ready strong { color: var(--vvs-ready); }
.overview-kpi.is-sign strong { color: var(--vvs-sign); }
#overviewPipeLetters,
#overviewPipeGestures { color: var(--vvs-sign); }
.chart-key.is-sign { color: var(--vvs-sign); font-weight: 700; }
.overview-kpi.is-check strong { color: var(--vvs-check); }

@media (max-width: 900px) {
    .overview-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.device-item span {
    margin-left: auto;
    color: var(--maxton-text-main);
    font-variant-numeric: tabular-nums;
}

.overview-role-row {
    gap: 10px;
}

.overview-role-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.overview-role-row.is-hearing .list-text,
.overview-role-row.is-hearing .list-value { color: var(--vvs-hearing); }
.overview-role-row.is-deaf .list-text,
.overview-role-row.is-deaf .list-value { color: var(--vvs-deaf); }
.overview-role-row.is-admin .list-text,
.overview-role-row.is-admin .list-value { color: var(--vvs-admin); }
.overview-role-row.is-users .list-text,
.overview-role-row.is-users .list-value { color: var(--vvs-users); }

.overview-role-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
}

.overview-role-chip.is-hearing {
    background: color-mix(in srgb, var(--vvs-hearing) 18%, transparent);
    color: var(--vvs-hearing);
}
.overview-role-chip.is-deaf {
    background: color-mix(in srgb, var(--vvs-deaf) 18%, transparent);
    color: var(--vvs-deaf);
}
.overview-role-chip.is-admin {
    background: color-mix(in srgb, var(--vvs-admin) 18%, transparent);
    color: var(--vvs-admin);
}
.overview-role-chip.is-users {
    background: color-mix(in srgb, var(--vvs-users) 18%, transparent);
    color: var(--vvs-users);
}

/* Lists */
.maxton-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.maxton-list li {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--maxton-border);
}

.maxton-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.list-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--maxton-input);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: var(--maxton-text-main);
}

.list-icon.bg-pink {
    background: var(--maxton-input);
    color: var(--maxton-text-main);
}

.list-icon.bg-blue {
    background: rgba(34, 197, 94, 0.2);
    color: var(--maxton-green);
}

.list-icon.bg-green {
    background: rgba(34, 197, 94, 0.2);
    color: var(--maxton-green);
}

.list-text {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 500;
}

.list-value {
    font-size: 14px;
    font-weight: 600;
}

.list-sub {
    color: var(--maxton-green);
    font-size: 13px;
    margin-left: 8px;
}

/* Center Doughnut Label */
.doughnut-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.doughnut-label h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.doughnut-label p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--maxton-text-muted);
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .card-welcome {
        grid-column: span 12;
    }

    .card-accounts-pie,
    .card-workspace-bar,
    .card-signs-bar,
    .card-system-pie,
    .card-overview-roles,
    .card-overview-recent,
    .card-overview-pipeline,
    .card-overview-top,
    .card-active-users,
    .card-total-users,
    .card-monthly-revenue,
    .card-device-type,
    .card-clicks,
    .card-views,
    .card-social {
        grid-column: span 6;
    }

    .card-overview-detail,
    .card-accounts {
        grid-column: span 12;
    }

    .card-campaigns {
        grid-column: span 12;
    }

    .card-feedbacks {
        grid-column: span 12;
    }
}

@media (max-width: 1024px) {
    body.admin-page .theme-dock {
        display: none;
    }

    .maxton-sidebar {
        position: fixed;
        z-index: 999;
        height: 100dvh;
        margin-left: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .maxton-sidebar.is-drawer-open {
        margin-left: 0;
        transform: translateX(0);
    }

    .maxton-sidebar.collapsed {
        margin-left: 0;
        transform: translateX(-100%);
    }

    .maxton-sidebar.is-drawer-open.collapsed {
        transform: translateX(0);
    }

    .card-welcome {
        grid-column: span 12;
    }

    .welcome-illustration {
        opacity: 0.1;
    }
}

@media (max-width: 980px) {
    #dashboardGrid {
        overflow: auto;
        height: auto;
        max-height: 100%;
        grid-template-rows: none;
        grid-auto-rows: minmax(180px, auto);
        align-content: start;
        padding-bottom: 8px;
    }

    #dashboardGrid .card-welcome,
    #dashboardGrid .card-overview-detail {
        grid-column: 1 / -1;
        grid-row: auto;
        min-height: 160px;
    }

    #dashboardGrid .card-accounts-pie,
    #dashboardGrid .card-workspace-bar,
    #dashboardGrid .card-signs-bar,
    #dashboardGrid .card-system-pie,
    #dashboardGrid .card-overview-top,
    #dashboardGrid .card-overview-roles,
    #dashboardGrid .card-overview-recent,
    #dashboardGrid .card-overview-pipeline {
        grid-column: span 6;
        grid-row: auto;
        min-height: 180px;
    }

    #dashboardGrid .chart-pie-body {
        grid-template-columns: minmax(0, 1fr) minmax(120px, 0.85fr);
    }
}

@media (max-width: 600px) {
    .maxton-grid:not(#dashboardGrid):not(.admin-bento) {
        display: flex;
        flex-direction: column;
    }

    .welcome-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #dashboardGrid .chart-pie-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(140px, 1fr) auto;
    }

    .maxton-main {
        padding: 0 10px 8px;
    }

    .overview-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .maxton-topbar {
        gap: 8px;
    }

    .maxton-top-actions {
        gap: 4px;
    }
}

/* Phones: the overview bento grid becomes one column of naturally sized cards. */
@media (max-width: 640px) {
    #dashboardGrid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-rows: max-content;
        grid-auto-flow: row;
        align-items: start;
        height: auto;
        max-height: none;
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        gap: 10px;
        padding-bottom: 24px;
    }

    #dashboardGrid > .maxton-card {
        grid-column: 1 / -1;
        grid-row: auto;
        flex: none;
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: hidden;
    }

    #dashboardGrid .card-welcome {
        padding: 14px;
        gap: 12px;
    }

    .welcome-greeting h2 {
        font-size: 22px;
    }

    #dashboardGrid .welcome-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    #dashboardGrid .welcome-stat {
        padding: 10px 12px;
    }

    .w-stat-value {
        font-size: 20px;
    }

    #dashboardGrid .chart-container-md {
        flex: none;
        height: 200px;
        min-height: 200px;
    }

    #dashboardGrid .chart-pie-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        justify-items: center;
        min-height: 0;
        gap: 10px;
    }

    #dashboardGrid .chart-pie-frame {
        height: 160px;
        max-height: 160px;
        margin: 0 auto;
    }

    #dashboardGrid .maxton-card-header {
        flex-wrap: wrap;
        gap: 6px;
    }

    #dashboardGrid .chart-key {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ── ISOLATED VIEWS EXPANSION ── */
.admin-view .maxton-card[style*="span 12"] {
    min-height: calc(100vh - 150px);
}

.admin-view .maxton-card[style*="span 12"] .chart-container-sm,
.admin-view .maxton-card[style*="span 12"] .chart-container-md {
    flex: 1;
    min-height: 200px;
    position: relative;
    height: auto !important;
}

.admin-view .maxton-card[style*="span 12"] canvas {
    height: 100% !important;
}

#langDropdown.show {
    display: flex !important;
}

.admin-bento {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto 1fr;
    gap: 16px;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.admin-bento .maxton-card {
    min-height: 0;
}

.admin-bento-name,
.admin-bento-result {
    grid-column: span 8;
}

.admin-bento-list {
    grid-column: span 4;
    grid-row: span 2;
}

.admin-bento-camera {
    grid-column: span 8;
    padding: 12px;
}

.admin-bento-stat {
    grid-column: span 4;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

.admin-bento-stat__icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: #22c55e;
}

.admin-bento-action {
    grid-column: span 4;
}

#trainView.admin-bento {
    grid-template-rows: auto 1fr;
}

#trainView .admin-bento-action {
    grid-column: span 8;
    min-width: 0;
    overflow-x: hidden;
}

#trainView .admin-bento-list {
    grid-column: span 4;
    grid-row: auto;
}

.admin-train-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-train-head .uiverse-btn {
    flex-shrink: 0;
    width: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-train-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.admin-train-steps li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.admin-train-steps li span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--maxton-input);
    font-size: 11px;
}

.admin-train-steps li.is-current {
    background: rgba(34, 197, 94, 0.16);
    color: var(--maxton-green);
}

.admin-train-total {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.admin-train-total strong {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.admin-train-total span {
    font-size: 12px;
    color: var(--text-secondary);
}

.admin-train-coverage {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 4px;
}

.admin-train-scale__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 11px;
    color: var(--text-secondary);
}

.admin-train-scale-row {
    min-width: 0;
    max-width: 100%;
    padding: 8px 0 10px;
    border-top: 1px solid var(--border);
}

.admin-train-scale-row__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.admin-train-scale-row__bar {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 14px;
    border-radius: 999px;
    background: var(--maxton-input);
    overflow: hidden;
}

.admin-train-scale-row__head strong {
    font-size: 13px;
}

.admin-train-chip {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.admin-train-chip.is-low {
    background: rgba(245, 158, 11, 0.16);
    color: #f59e0b;
}

.admin-train-chip.is-ready {
    background: rgba(34, 197, 94, 0.14);
    color: #22c55e;
}

.admin-train-chip.is-strong {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.admin-train-scale-row__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.admin-train-scale-row__bar {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 14px;
    border-radius: 999px;
    background: var(--maxton-input);
    overflow: hidden;
}

.admin-train-scale-row__fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14532d 0%, #22c55e 72%, #86efac 100%);
}

.admin-train-scale-row.is-low .admin-train-scale-row__fill {
    background: linear-gradient(90deg, #92400e, #f59e0b);
}

.admin-train-scale-row.is-strong .admin-train-scale-row__fill {
    background: linear-gradient(90deg, #065f46, #34d399);
}

.admin-train-scale-row__target {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #fbbf24;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.admin-gesture-search::placeholder,
.admin-search-field input::placeholder {
    color: var(--maxton-text-muted);
    opacity: 0.38;
}

.admin-gesture-panel {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.admin-gesture-studio {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 16px;
    margin-top: 8px;
    flex: 1;
    min-height: 0;
}

.admin-gesture-studio > div:first-child,
.admin-gesture-camera-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.admin-gesture-name-block {
    flex: 0 0 auto;
    margin-bottom: 10px;
}

.admin-gesture-name-block label,
.admin-gesture-search-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--maxton-text-main);
    margin-bottom: 4px;
}

.admin-gesture-name-block .stat-desc {
    margin: 0 0 8px;
}

.admin-gesture-name-input {
    width: 100%;
    max-width: 320px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin: 8px 0 12px;
}

#trainView .admin-gesture-panel {
    overflow: auto;
}

.admin-gesture-train-panel .admin-gesture-train__body {
    max-width: 360px;
    margin-top: 12px;
}

.admin-gesture-train-panel .admin-gesture-list {
    max-height: 42vh;
}

#usersView,
#feedbacksView,
#supportView,
#collectView,
#trainView,
#recognizeView,
#placeholderView {
    display: none;
    flex-direction: column;
}

.admin-profile-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 8, 18, 0.62);
    backdrop-filter: blur(8px);
}

.admin-profile-modal.is-open {
    display: flex;
}

.admin-profile-modal .admin-profile-form {
    width: min(920px, 100%);
    height: auto;
    max-height: min(88vh, 740px);
    flex: 0 1 auto;
    margin: 0;
}

.admin-profile-form__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 8px;
    padding: 0;
    border: 2.5px solid var(--uv-ink);
    background: var(--uv-bg);
    color: var(--uv-ink);
    box-shadow: 2px 2px 0 var(--uv-ink);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-profile-form__close:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--uv-ink);
}

.admin-profile-form__close:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--uv-ink);
}

.admin-profile-form__close svg {
    width: 14px;
    height: 14px;
}

.admin-sidebar-theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: var(--maxton-text-muted);
    font-size: 14px;
}

.theme-switch--sidebar {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
    z-index: 2;
    border-bottom: none;
    flex-shrink: 0;
}

.admin-topbar-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 220px;
    margin: 0;
    padding: 4px 10px 4px 4px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.admin-topbar-profile:hover,
.admin-topbar-profile:focus-visible,
.admin-topbar-profile[aria-expanded="true"] {
    background: var(--bg-hover, var(--maxton-card));
    border-color: var(--border, var(--maxton-border));
    outline: none;
}

.admin-topbar-avatar,
.admin-topbar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.admin-topbar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #14b8a6;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    border: none;
    box-shadow: none;
}

.admin-topbar-name {
    min-width: 0;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .admin-topbar-name {
        display: none;
    }

    .admin-topbar-profile {
        max-width: none;
        padding: 4px;
    }
}

#usersView .maxton-card,
#feedbacksView .maxton-card,
#supportView .maxton-card,
#systemView .maxton-card,
#profileView .maxton-card,
#placeholderView .maxton-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.admin-profile-form {
    --uv-primary: #22c55e;
    --uv-ink: #052e16;
    --uv-text: var(--text-primary);
    --uv-bg: var(--bg-elevated);
    --uv-panel: var(--bg-secondary);
    --uv-muted: var(--text-secondary);
    --uv-shadow: var(--uv-ink);
    --uv-grid: color-mix(in srgb, var(--text-primary) 8%, transparent);
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 920px;
    width: calc(100% - 4px);
    height: 100%;
    max-height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
    background: var(--uv-bg);
    color: var(--uv-text);
    border: 4px solid var(--uv-ink);
    border-radius: 10px;
    box-shadow: 8px 8px 0 var(--uv-shadow);
    font-family: Inter, system-ui, sans-serif;
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.admin-profile-form:hover {
    transform: translate(-3px, -3px);
    box-shadow: 12px 12px 0 var(--uv-shadow);
}

.admin-profile-form:active {
    transform: translate(1px, 1px);
    box-shadow: 6px 6px 0 var(--uv-shadow);
}

.admin-profile-form::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--uv-grid) 1px, transparent 1px),
        linear-gradient(to bottom, var(--uv-grid) 1px, transparent 1px);
    background-size: 8px 8px;
    z-index: 0;
}

.admin-profile-form__head,
.admin-profile-form__body {
    position: relative;
    z-index: 1;
}

.admin-profile-form__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--uv-primary);
    color: var(--uv-ink);
    border-bottom: 4px solid var(--uv-text);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.admin-profile-form__head svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.admin-profile-form__head .admin-profile-form__close svg {
    width: 14px;
    height: 14px;
}

.admin-profile-form__tag {
    margin-left: auto;
    padding: 4px 8px;
    background: var(--uv-bg);
    color: var(--uv-text);
    border: 2.5px solid var(--uv-text);
    box-shadow: 3px 3px 0 var(--uv-shadow);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    transform: rotate(-6deg);
}

.admin-profile-form__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 12px 14px 8px;
}

.admin-profile-form__col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
}

.admin-profile-form__foot {
    flex-shrink: 0;
    padding: 0 14px 12px;
}

.admin-profile-form__avatar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 2px dashed var(--uv-text);
}

.admin-profile-form__avatar img,
.admin-profile-form__avatar #adminAvatarInitialsMain {
    width: 52px;
    height: 52px;
    border: none;
    box-shadow: none;
    flex-shrink: 0;
    border-radius: 50%;
}

.admin-profile-form__avatar img {
    display: none;
    object-fit: cover;
    background: var(--uv-panel);
}

.admin-profile-form__avatar #adminAvatarInitialsMain {
    background: #14b8a6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}

.admin-profile-form__avatar-copy {
    min-width: 0;
}

.admin-profile-form__avatar-copy strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-profile-form__avatar-copy p {
    margin: 2px 0 6px;
    font-size: 11px;
    line-height: 1.3;
    color: var(--uv-muted);
}

.admin-profile-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.admin-profile-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-profile-form__field span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-profile-form__field input,
.admin-profile-form__field select {
    width: 100%;
    border: 2.5px solid var(--uv-text);
    border-radius: 6px;
    padding: 8px 10px;
    background: var(--uv-panel);
    color: var(--uv-text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 3px 3px 0 var(--uv-shadow);
    outline: none;
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.admin-profile-form__field input::placeholder {
    color: var(--uv-muted);
    font-weight: 500;
}

.admin-profile-form__field input:hover,
.admin-profile-form__field input:focus,
.admin-profile-form__field select:hover,
.admin-profile-form__field select:focus {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--uv-shadow);
}

.admin-profile-form__field input[readonly] {
    opacity: 0.72;
    cursor: default;
}

.admin-profile-form__security {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
    margin-top: auto;
    background: var(--uv-panel);
    border: 2.5px solid var(--uv-text);
    box-shadow: 3px 3px 0 var(--uv-shadow);
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.admin-profile-form__security:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--uv-shadow);
}

.admin-profile-form__switch {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}

.admin-profile-form__switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-profile-form__knob {
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    border: 2.5px solid var(--uv-text);
    background: var(--uv-bg);
    box-shadow: 2px 2px 0 var(--uv-shadow);
    position: relative;
}

.admin-profile-form__knob::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--uv-text);
    transition: transform 0.15s ease;
}

.admin-profile-form__switch.is-on .admin-profile-form__knob,
.admin-profile-form__switch:has(input:checked) .admin-profile-form__knob {
    background: var(--uv-primary);
}

.admin-profile-form__switch.is-on .admin-profile-form__knob::after,
.admin-profile-form__switch:has(input:checked) .admin-profile-form__knob::after {
    transform: translateX(20px);
}

.admin-profile-form__switch-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-profile-form__switch-copy strong {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.admin-profile-form__switch-copy em {
    font-style: normal;
    font-size: 12px;
    color: var(--uv-muted);
}

.admin-profile-form__ghost,
.admin-profile-form__save {
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--uv-text);
    background: var(--uv-panel);
    border: 2.5px solid var(--uv-text);
    border-radius: 5px;
    box-shadow: 3px 3px 0 var(--uv-shadow);
    padding: 8px 12px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.admin-profile-form__ghost:hover,
.admin-profile-form__save:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--uv-shadow);
}

.admin-profile-form__ghost:active,
.admin-profile-form__save:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 var(--uv-shadow);
}

.admin-profile-form__save {
    width: 100%;
    padding: 10px 16px;
    background: var(--uv-primary);
    color: var(--uv-ink);
    font-size: 13px;
    position: static;
}

.admin-profile-form__save:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.admin-profile-form__section-title {
    margin: 2px 0 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--uv-muted);
}

.admin-profile-form__hint {
    margin: -4px 0 0;
    font-size: 11px;
    color: var(--uv-muted);
}

.admin-profile-form__avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-profile-form__pass {
    position: relative;
}

.admin-profile-form__pass input {
    width: 100%;
    padding-right: 72px;
}

.admin-profile-form__pass-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--uv-muted);
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

@media (max-width: 860px) {
    .admin-profile-form__body {
        grid-template-columns: 1fr;
        overflow: hidden;
    }
}

@media (max-width: 640px) {
    .admin-profile-form__grid {
        grid-template-columns: 1fr;
    }

    .admin-profile-form__security {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-profile-form,
    .admin-profile-form:hover,
    .admin-profile-form:active,
    .admin-profile-form__field input,
    .admin-profile-form__field input:hover,
    .admin-profile-form__security,
    .admin-profile-form__ghost,
    .admin-profile-form__save,
    .admin-page .uiverse-card,
    .admin-page .uiverse-card:hover,
    .admin-page .uiverse-card:active {
        transition: none;
        transform: none;
    }
}

.admin-page .uiverse-card {
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.35s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.admin-page .uiverse-card:hover {
    transform: translate(-6px, -6px) scale(1.02);
    box-shadow: 16px 16px 0 var(--uv-shadow);
}

.admin-page .admin-feedback-grid .uiverse-card--note:hover,
.admin-page .admin-feedback-grid .uiverse-card--note:active {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 var(--uv-shadow);
}

@media (hover: none) {
    .admin-page .admin-feedback-grid .uiverse-card--note:hover,
    .admin-page .admin-feedback-grid .uiverse-card--note:active {
        transform: none;
        box-shadow: 6px 6px 0 var(--uv-shadow);
    }
}

.admin-gesture-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-gesture-toolbar input[type="text"] {
    width: 140px;
    max-width: 28vw;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
}

.admin-gesture-toolbar .uiverse-btn,
.admin-gesture-panel .maxton-card-header .uiverse-btn {
    padding: 8px 16px;
    min-width: 0;
}

.admin-profile-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.admin-apps-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    max-width: min(240px, calc(100vw - 24px));
    max-height: min(70vh, 480px);
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 120;
    flex-direction: column;
    gap: 4px;
}

.admin-apps-menu.show,
.admin-apps-menu.is-open {
    display: flex;
}

.admin-apps-menu button {
    background: transparent;
    border: none;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-apps-menu button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.admin-apps-menu button:hover {
    background: var(--bg-hover);
}

.admin-apps-menu__logout {
    color: var(--maxton-red) !important;
    margin-top: 4px;
    border-top: 1px solid var(--border) !important;
    border-radius: 0 0 6px 6px;
    padding-top: 10px !important;
}

.admin-apps-menu__logout:hover {
    background: color-mix(in srgb, var(--maxton-red) 12%, transparent);
}

.admin-apps-menu__theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.admin-apps-menu__theme .theme-switch {
    width: 52px;
    height: 28px;
    filter: none;
    flex-shrink: 0;
}

.admin-notify-wrap {
    position: relative;
    display: inline-block;
}

.admin-notify-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    width: 320px;
    max-width: 86vw;
    padding: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    z-index: 130;
    flex-direction: column;
    gap: 8px;
}

.admin-notify-menu.show {
    display: flex;
}

.admin-notify-menu.is-sheet {
    position: fixed;
    top: 68px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    max-height: min(70dvh, 420px);
    overflow: auto;
    z-index: 4000;
}

.admin-notify-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 4px 4px;
}

.admin-notify-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-notify-read {
    border: none;
    background: transparent;
    color: var(--accent, #d97706);
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    padding: 4px 0;
    white-space: nowrap;
}

.admin-notify-read:hover {
    text-decoration: underline;
}

.admin-notify-read:disabled {
    color: var(--text-tertiary, #8b8478);
    cursor: default;
    text-decoration: none;
}

.admin-notify-item.is-unread {
    border-color: #e11d48;
}

.admin-notify-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.admin-notify-item:hover {
    background: var(--bg-hover);
}

.admin-notify-item__top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.admin-notify-item__top span {
    color: var(--text-secondary);
}

.admin-notify-stars {
    display: flex;
    gap: 2px;
    color: var(--maxton-yellow);
}

.admin-notify-item__text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.admin-notify-menu:not(.is-sheet) {
    width: 360px;
}

.admin-notify-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.admin-notify-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 6px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.admin-notify-tab:hover {
    color: var(--text-primary);
}

.admin-notify-tab.is-on {
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}

.admin-notify-tab em,
.admin-notify-item__count {
    font-style: normal;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--maxton-red, #e11d48);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-notify-item__count {
    align-self: flex-start;
}

.admin-notify-item__top strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.admin-notify-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(56vh, 380px);
    overflow-y: auto;
    padding-right: 2px;
}

.admin-notify-menu.is-sheet .admin-notify-list {
    max-height: none;
}

.admin-notify-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 10px;
    color: var(--text-tertiary, #8b8478);
    text-align: center;
    font-size: 13px;
}

.admin-notify-empty svg {
    width: 28px;
    height: 28px;
}

.admin-notify-empty p {
    margin: 0;
}

@media (max-width: 380px) {
    .admin-notify-tab {
        font-size: 11px;
        gap: 4px;
    }
}

.vvs-bell {
    width: 36px;
    height: 36px;
}

.vvs-bell svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transform-origin: 50% 8%;
}

.vvs-bell__solid {
    display: none;
}

.vvs-bell:hover .vvs-bell__regular,
.vvs-bell.has-unread .vvs-bell__regular {
    display: none;
}

.vvs-bell:hover .vvs-bell__solid,
.vvs-bell.has-unread .vvs-bell__solid {
    display: block;
}

.vvs-bell.has-unread {
    color: var(--accent, #d97706);
}

.vvs-bell:hover .vvs-bell__solid,
.vvs-bell.is-ringing .vvs-bell__solid {
    animation: vvs-bell-ring 0.8s ease both;
}

@keyframes vvs-bell-ring {
    0% { transform: rotate(0deg); }
    20% { transform: rotate(18deg); }
    40% { transform: rotate(-14deg); }
    60% { transform: rotate(9deg); }
    80% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
    .vvs-bell svg {
        animation: none !important;
    }
}

.admin-search-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 220px;
    margin-bottom: 10px;
}

.admin-search-field svg {
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    margin-block: auto;
    width: 16px;
    height: 16px;
    color: var(--maxton-text-muted);
    pointer-events: none;
}

.admin-search-field .admin-gesture-search,
.admin-bento-list .admin-search-field .admin-gesture-search {
    width: 100%;
    max-width: none;
    height: 38px;
    margin-bottom: 0;
    padding: 0 12px 0 36px;
    line-height: 38px;
}

.admin-gesture-del {
    border: none;
    background: transparent;
    color: var(--maxton-red);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.admin-gesture-del svg {
    width: 14px;
    height: 14px;
}

.admin-gesture-train {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-gesture-train__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
}

.admin-gesture-result {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
    color: var(--maxton-green);
}

.admin-gesture-video-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    min-height: 0;
    flex: 1;
    height: 100%;
    border: 1px solid var(--maxton-border);
}

.admin-gesture-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
}

.admin-gesture-stage video,
.admin-gesture-stage canvas,
.admin-gesture-video-wrap > video,
.admin-gesture-video-wrap > canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-gesture-stage video,
.admin-gesture-video-wrap > video {
    transform: scaleX(-1);
}

.admin-gesture-stage canvas,
.admin-gesture-video-wrap > canvas {
    pointer-events: none;
}

.admin-gesture-overlay {
    position: absolute;
    left: 16px;
    top: 16px;
    min-width: 280px;
    max-width: min(420px, 46%);
    padding: 16px 18px;
    background: #000;
    color: #4ade80;
    font-family: Consolas, "Courier New", monospace;
    font-size: 16px;
    line-height: 1.35;
    letter-spacing: 0.02em;
    z-index: 2;
}

.admin-gesture-overlay span,
.admin-gesture-overlay strong {
    color: #4ade80;
}

.admin-gesture-hud-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 10px 16px;
    align-items: baseline;
    margin-bottom: 8px;
}

.admin-gesture-hud-row:last-child {
    margin-bottom: 0;
}

.admin-gesture-hud-label {
    color: #4ade80;
    font-size: 13px;
    font-weight: 500;
}

.admin-gesture-overlay strong {
    font-size: 18px;
    font-weight: 700;
}

.admin-gesture-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 8px;
}

.admin-bento-list .admin-gesture-search,
.admin-gesture-search {
    width: 100%;
    max-width: 220px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
    margin-bottom: 10px;
}

.admin-bento-list .admin-gesture-list {
    flex: 1;
}

.admin-bento-camera .admin-gesture-video-wrap {
    flex: 1;
    min-height: 0;
}

.admin-gesture-hud {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 13px;
    line-height: 1.45;
}

.admin-gesture-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.admin-gesture-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: auto;
}

.admin-gesture-studio .admin-gesture-list {
    height: 100%;
}

.admin-gesture-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--maxton-border);
    border-radius: 8px;
    background: var(--maxton-input);
}

.admin-gesture-row strong {
    color: var(--maxton-text-main);
}

.admin-gesture-row span {
    color: var(--maxton-text-muted);
    font-size: 13px;
}

@media (max-width: 1100px) {
    .admin-bento-name,
    .admin-bento-result,
    .admin-bento-camera,
    .admin-bento-list,
    .admin-bento-stat,
    .admin-bento-action,
    #trainView .admin-bento-action,
    #trainView .admin-bento-list {
        grid-column: span 12;
        grid-row: auto;
    }

    .admin-bento {
        height: auto;
        max-height: 100%;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: max-content;
        align-content: start;
        gap: 12px;
        overflow: auto;
        padding-bottom: 12px;
    }

    #trainView.admin-bento {
        grid-template-rows: none;
    }

    .admin-bento > .maxton-card {
        min-height: auto;
    }

    #trainView .admin-bento-stat {
        grid-column: span 4;
        min-width: 0;
        padding: 14px 16px;
        gap: 12px;
    }

    #collectView.admin-bento,
    #recognizeView.admin-bento {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: max-content;
        align-items: stretch;
        justify-items: stretch;
    }

    #collectView.admin-bento > .maxton-card,
    #recognizeView.admin-bento > .maxton-card {
        grid-column: 1 / -1;
        grid-row: auto;
        width: 100%;
        max-width: none;
        min-width: 0;
        align-self: stretch;
    }

    .admin-gesture-name-input,
    .admin-bento-list .admin-search-field,
    .admin-bento-list .admin-gesture-search,
    .admin-gesture-search {
        width: 100%;
        max-width: none;
    }

    .admin-bento-camera .admin-gesture-video-wrap {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 0;
        overflow: hidden;
    }

    .admin-bento-camera .admin-gesture-stage {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        min-height: 200px;
        max-height: min(50vh, 420px);
        overflow: hidden;
    }

    .admin-bento-camera .admin-gesture-overlay {
        position: relative;
        left: auto;
        top: auto;
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 22px;
        row-gap: 0;
        padding: 10px 14px 12px;
        border-top: 1px solid rgba(74, 222, 128, 0.28);
    }

    .admin-bento-camera .admin-gesture-hud-row {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        margin: 0;
        padding: 4px 0;
        min-width: 0;
    }

    .admin-bento-camera .admin-gesture-hud-label {
        min-width: 0;
    }

    .admin-bento-camera .admin-gesture-overlay strong,
    .admin-bento-camera .admin-gesture-hud-row > span:last-child {
        font-size: 15px;
        white-space: nowrap;
        text-align: right;
    }

    .admin-bento-list .admin-gesture-list {
        max-height: 360px;
        overflow-y: auto;
    }
}

@media (max-width: 600px) {
    #trainView .admin-bento-stat {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 12px;
    }

    #trainView .admin-bento-stat .w-stat-value {
        font-size: 22px;
        line-height: 1.1;
    }

    #trainView .admin-bento-stat .w-stat-label {
        font-size: 11px;
    }

    #trainView .admin-bento-stat__icon {
        width: 22px;
        height: 22px;
    }

    .admin-train-head {
        flex-wrap: wrap;
    }

    .admin-train-head > div {
        flex: 1 1 180px;
        min-width: 0;
    }

    .admin-train-head .uiverse-btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .admin-train-total strong {
        font-size: 24px;
    }

    .admin-bento-list .admin-search-field {
        width: 100%;
        max-width: none;
    }

    .admin-bento-camera .admin-gesture-stage {
        min-height: 180px;
        max-height: min(42vh, 280px);
    }

    .admin-bento-camera .admin-gesture-overlay {
        grid-template-columns: 1fr;
        padding: 8px 12px 10px;
    }
}

@media (max-width: 1100px) and (orientation: landscape) {
    .admin-bento-camera .admin-gesture-stage {
        aspect-ratio: 16 / 9;
        min-height: 140px;
        max-height: min(42vh, 240px);
    }

    .admin-bento-camera .admin-gesture-overlay {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .admin-gesture-studio {
        grid-template-columns: 1fr;
    }
}

.admin-accounts-card,
.card-feedbacks {
    position: relative;
}

.admin-accounts-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-accounts-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
}

.admin-accounts-search {
    position: relative;
    flex: 1 1 220px;
    max-width: 280px;
}

.admin-accounts-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.admin-accounts-search input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px 0 34px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
}

.admin-accounts-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-accounts-filters button {
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.admin-accounts-filters button.is-on {
    background: rgba(34, 197, 94, 0.16);
    border-color: #22c55e;
    color: #16a34a;
}

.admin-accounts-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.admin-accounts-table-wrap {
    overflow: auto;
    min-height: 0;
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-primary);
}

.admin-accounts-table {
    width: 100%;
    min-width: 700px;
    table-layout: fixed;
    border-collapse: collapse;
    text-align: left;
}

.admin-accounts-table th:nth-child(1),
.admin-accounts-table td:nth-child(1) {
    width: 28%;
}

.admin-accounts-table th:nth-child(2),
.admin-accounts-table td:nth-child(2) {
    width: 11%;
}

.admin-accounts-table th:nth-child(3),
.admin-accounts-table td:nth-child(3) {
    width: 14%;
}

.admin-accounts-table th:nth-child(4),
.admin-accounts-table td:nth-child(4) {
    width: 14%;
}

.admin-accounts-table th:nth-child(5),
.admin-accounts-table td:nth-child(5) {
    width: 15%;
}

.admin-accounts-table th:nth-child(6),
.admin-accounts-table td:nth-child(6) {
    width: 18%;
}

.admin-accounts-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--maxton-input);
    border-bottom: 1px solid var(--border);
}

.admin-accounts-table thead th.is-actions,
.admin-accounts-table td.is-actions {
    text-align: right;
    white-space: nowrap;
}

.admin-accounts-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.admin-accounts-table tbody tr:nth-child(even) {
    background: var(--bg-hover);
}

.admin-accounts-table tbody tr:hover {
    background: var(--bg-active);
}

.admin-accounts-table td {
    padding: 12px 14px;
    vertical-align: middle;
}

.admin-accounts-table td:nth-child(5) {
    white-space: nowrap;
}

.admin-account-person {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.admin-account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
    flex-shrink: 0;
}

.admin-account-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-account-email {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-role-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.admin-account-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.admin-account-state::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.admin-account-state.is-verified {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.admin-account-state.is-unverified {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
}

.admin-account-state.is-setup {
    border-color: rgba(168, 85, 247, 0.45);
    background: rgba(168, 85, 247, 0.14);
    color: #a855f7;
}

.admin-role-pill.is-admin {
    background: color-mix(in srgb, var(--vvs-admin) 18%, transparent);
    color: var(--vvs-admin);
}

.admin-role-pill.is-hearing {
    background: color-mix(in srgb, var(--vvs-hearing) 18%, transparent);
    color: var(--vvs-hearing);
}

.admin-role-pill.is-deaf {
    background: color-mix(in srgb, var(--vvs-deaf) 18%, transparent);
    color: var(--vvs-deaf);
}

.admin-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
}

.admin-status-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.admin-status-dot.is-pending {
    color: #d97706;
}

.admin-status-dot.is-pending::before {
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.16);
}

.admin-status-dot:not(.is-offline)::before {
    animation: vvsOnlinePulse 2s ease-in-out infinite;
}

.admin-status-dot.is-offline {
    color: var(--maxton-text-muted);
}

.admin-status-dot.is-offline::before {
    box-shadow: none;
    background: transparent;
    border: 2px solid currentColor;
    width: 6px;
    height: 6px;
}

.admin-status-seen {
    display: block;
    margin-top: 2px;
    padding-left: 16px;
    font-size: 11px;
    color: var(--maxton-text-muted);
    white-space: nowrap;
}

@keyframes vvsOnlinePulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.06); }
}

@media (prefers-reduced-motion: reduce) {
    .admin-status-dot:not(.is-offline)::before { animation: none; }
}

.admin-accounts-empty {
    padding: 36px 16px !important;
    text-align: center;
    color: var(--text-secondary);
}

.admin-system-card {
    overflow: auto;
}

.admin-system-groups {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: 0;
    overflow: auto;
    padding-bottom: 8px;
}

.admin-system-group h4 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-system-group h4 svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent, var(--maxton-cyan));
}

.admin-module-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.admin-module-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light, rgba(196, 149, 106, 0.16));
    color: var(--accent, var(--maxton-cyan));
    flex-shrink: 0;
}

.admin-module-card__icon svg {
    width: 18px;
    height: 18px;
}

.admin-module-card.is-ready .admin-module-card__icon {
    color: var(--vvs-ink);
    background: color-mix(in srgb, var(--vvs-ink) 14%, transparent);
}

.admin-module-card.is-partial .admin-module-card__icon {
    color: var(--vvs-check);
    background: color-mix(in srgb, var(--vvs-check) 14%, transparent);
}

.admin-module-card.is-partial .admin-module-card__flag {
    color: var(--vvs-check);
    border-color: currentColor;
}

.admin-module-card.is-optional .admin-module-card__icon {
    color: var(--text-secondary);
    background: var(--bg-secondary, var(--maxton-input));
}

.admin-module-card.is-down .admin-module-card__icon {
    color: #c45c5c;
    background: rgba(196, 92, 92, 0.14);
}

.admin-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.admin-module-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--maxton-input);
}

.admin-module-card strong {
    font-size: 14px;
    color: var(--text-primary);
}

.admin-module-card > span {
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-word;
}

.admin-module-card p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.admin-module-card__how {
    color: var(--text-primary);
}

.admin-module-card__flag {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.admin-module-card.is-ready .admin-module-card__flag {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.admin-module-card.is-optional .admin-module-card__flag {
    color: var(--text-secondary);
}

.admin-module-card.is-down .admin-module-card__flag {
    color: var(--maxton-red, #ef4444);
    border-color: currentColor;
}

.admin-account-actions {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

#feedbacksView .admin-feedback-grid {
    overflow: auto;
    min-height: 0;
    flex: 1;
    align-content: start;
    align-items: start;
    padding: 8px 10px 16px 4px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 18px;
}

#feedbacksView .uiverse-card--note {
    max-width: none;
}

.admin-page .uiverse-card--note .uiverse-card__actions {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-page .uiverse-card--note .uiverse-card__meta {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-page .uiverse-card--note .uiverse-card__action-btns {
    display: inline-flex !important;
    flex-flow: row nowrap !important;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto !important;
    width: max-content;
    min-width: 76px;
    margin-left: auto;
    position: static;
}

.admin-page .uiverse-card--note .uiverse-card__action-btns .uiverse-card__like {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 34px;
    height: 34px;
    min-width: 34px;
    max-width: 34px;
    padding: 0;
    flex: 0 0 34px;
    line-height: 0;
}

.uiverse-card__who .support-avatar.uiverse-card__pic {
    width: 38px;
    height: 38px;
    font-size: 12px;
    box-shadow: 0 0 0 2px var(--uv-ink, #111), 2px 2px 0 2px var(--uv-shadow, #000);
}

.uiverse-card__who .support-avatar__dot {
    border-color: var(--uv-bg, #fff);
}

.uiverse-card__who-copy {
    min-width: 0;
}

.uiverse-card__who-copy h3 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uiverse-card__who-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
    font-size: 11px;
}

.uiverse-card__who-meta .support-status {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
}

.uiverse-card__who-meta .support-role {
    background: #fff;
    border: 1.5px solid var(--uv-ink, #111);
    box-shadow: 1px 1px 0 var(--uv-ink, #111);
    text-shadow: none;
}

.uiverse-card__who-meta .support-role.is-deaf { color: #7c3aed; background: #fff; }
.uiverse-card__who-meta .support-role.is-hearing { color: #2563eb; background: #fff; }
.uiverse-card__who-meta .support-role.is-admin { color: #15803d; background: #fff; }

/* ── Overview: System health card ── */
.system-health {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.system-health__status {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--maxton-input);
    border: 1px solid var(--maxton-border);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.system-health__status:hover,
.system-health__status:focus-visible {
    border-color: var(--vvs-ink);
}

.system-health__chev {
    margin-left: auto;
    font-size: 22px;
    line-height: 1;
    color: var(--maxton-text-muted);
}

.system-health__icon {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    background: var(--maxton-text-muted) center / 18px no-repeat;
}

.system-health__status.is-ok .system-health__icon {
    background-color: var(--vvs-ink);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l3-8 4 16 3-8h4'/%3E%3C/svg%3E");
}

.system-health__status.is-warn .system-health__icon {
    background-color: var(--vvs-check, #f59e0b);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E");
}

.system-health__status.is-loading .system-health__icon {
    opacity: 0.4;
}

.system-health__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.system-health__copy strong {
    font-size: 17px;
    font-weight: 800;
    color: var(--maxton-text-main);
}

.system-health__status.is-ok .system-health__copy strong { color: var(--vvs-ink); }

.system-health__copy span {
    font-size: 12px;
    color: var(--maxton-text-muted);
}

.system-health__issues {
    list-style: none;
    margin: 0;
    padding: 2px 0 0;
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 10px;
}

.system-health__issues > * {
    flex: 1 1 100%;
    min-width: 0;
}

.system-health__issues > .system-health__ok {
    flex: 0 0 calc(50% - 3px);
}

.system-health__issues > [hidden] {
    display: none;
}

.system-health__copy span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.system-health__issue {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px 14px 18px;
    border-radius: 12px;
    border-left: 3px solid var(--vvs-check, #f59e0b);
    background: color-mix(in srgb, var(--vvs-check, #f59e0b) 8%, transparent);
}

.system-health__issue-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.system-health__issue-copy span {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--maxton-text-main);
}

.system-health__issue > b {
    flex: none;
    padding-top: 1px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--vvs-check, #f59e0b);
}

.system-health__issue > b.is-missing { color: #ef4444; }

.system-health__issue small {
    display: block;
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--maxton-text-muted);
}

.system-health__ok {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 24px;
    padding: 2px 8px;
    line-height: 1.3;
    border-radius: 8px;
    background: color-mix(in srgb, var(--vvs-ink) 9%, transparent);
}

.system-health__ok-icon {
    width: 18px;
    height: 18px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--vvs-ink);
}

.system-health__ok-icon svg {
    width: 16px;
    height: 16px;
}

.system-health__ok-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--maxton-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Accounts: real avatars + online dot */
.admin-account-person .support-avatar.admin-account-pic {
    width: 40px;
    height: 40px;
    font-size: 12px;
}

.admin-account-pic.is-hearing { box-shadow: 0 0 0 2px var(--maxton-card), 0 0 0 4px color-mix(in srgb, var(--vvs-hearing) 55%, transparent); }
.admin-account-pic.is-deaf { box-shadow: 0 0 0 2px var(--maxton-card), 0 0 0 4px color-mix(in srgb, var(--vvs-deaf) 55%, transparent); }

.admin-account-person .support-avatar__dot {
    border-color: var(--bg-primary, var(--maxton-card));
}

.admin-account-person > div {
    min-width: 0;
}

@media (max-width: 760px) {
    .admin-accounts-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .admin-accounts-search {
        flex: none;
        max-width: none;
        width: 100%;
    }

    .admin-accounts-table-wrap {
        overflow-x: hidden;
    }

    .admin-accounts-table-wrap .admin-accounts-table,
    .admin-accounts-table-wrap .admin-accounts-table tbody {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .admin-accounts-table thead {
        display: none;
    }

    .admin-accounts-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 8px;
        padding: 10px 12px;
    }

    .admin-accounts-table td {
        padding: 0;
        width: auto !important;
    }

    .admin-accounts-table td:nth-child(1) { order: 1; flex: 1 1 calc(100% - 130px); min-width: 0; }
    .admin-accounts-table td:nth-child(6) { order: 2; flex: 0 0 auto; margin-left: auto; }

    .admin-accounts-table .admin-account-actions {
        gap: 0;
    }

    .admin-accounts-table .admin-account-actions .maxton-icon-btn {
        width: 32px;
        min-width: 32px;
        height: 32px;
    }

    .admin-accounts-table td:nth-child(2),
    .admin-accounts-table td:nth-child(3),
    .admin-accounts-table td:nth-child(4),
    .admin-accounts-table td:nth-child(5) {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }

    .admin-accounts-table td:nth-child(2) {
        order: 3;
        padding-left: 0;
    }

    .admin-accounts-table td:nth-child(3) {
        order: 4;
    }

    .admin-accounts-table td:nth-child(4) {
        order: 5;
    }

    .admin-accounts-table td:nth-child(5) {
        order: 6;
        margin-left: auto;
        white-space: nowrap;
    }

    .admin-accounts-table .admin-role-pill,
    .admin-accounts-table .admin-account-state,
    .admin-accounts-table .admin-plan-tag {
        padding: 2px 7px;
        font-size: 11px;
    }

    .admin-accounts-table .admin-status-dot {
        font-size: 11px;
        gap: 6px;
        white-space: nowrap;
    }

    .admin-accounts-table .admin-status-seen {
        display: none;
    }
}

/* ── New account modal ── */
.admin-create-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 8, 18, 0.62);
    backdrop-filter: blur(8px);
}

.admin-create-modal.is-open {
    display: flex;
}

.admin-create-card {
    width: 100%;
    max-width: 440px;
    background: var(--maxton-card);
    border: 1px solid var(--maxton-border);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    animation: adminFadeIn 0.22s ease-out;
    overflow: hidden;
}

.admin-create-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 22px 22px 0;
}

.admin-create-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.12);
    color: var(--maxton-green);
    flex-shrink: 0;
}

.admin-create-icon svg {
    width: 20px;
    height: 20px;
}

.admin-create-copy {
    flex: 1;
    min-width: 0;
}

.admin-create-copy h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--maxton-text-main);
}

.admin-create-copy p {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--maxton-text-muted);
}

.admin-create-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--maxton-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-create-close:hover {
    background: var(--maxton-input);
    color: var(--maxton-text-main);
}

.admin-create-close svg {
    width: 16px;
    height: 16px;
}

.admin-create-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 22px 22px;
}

.admin-create-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--maxton-text-muted);
}

.admin-create-field input,
.admin-create-field select {
    width: 100%;
    border: 1px solid var(--maxton-border);
    border-radius: 10px;
    padding: 11px 12px;
    background: var(--maxton-input);
    color: var(--maxton-text-main);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-create-field input::placeholder {
    color: var(--maxton-text-muted);
    opacity: 0.7;
}

.admin-create-field input:focus,
.admin-create-field select:focus {
    border-color: var(--maxton-green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.admin-create-pass {
    position: relative;
}

.admin-create-pass input {
    padding-right: 42px;
}

.admin-create-pass-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--maxton-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-create-pass-toggle:hover {
    color: var(--maxton-text-main);
    background: rgba(255, 255, 255, 0.04);
}

.admin-create-pass-toggle svg {
    width: 16px;
    height: 16px;
}

.admin-create-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--maxton-text-muted);
}

.admin-create-roles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.admin-create-role {
    border: 1px solid var(--maxton-border);
    border-radius: 10px;
    background: var(--maxton-input);
    color: var(--maxton-text-muted);
    padding: 10px 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.admin-create-role svg {
    width: 16px;
    height: 16px;
}

.admin-create-role.is-on {
    border-color: var(--maxton-green);
    background: rgba(34, 197, 94, 0.12);
    color: var(--maxton-green);
}

.admin-plan-choice {
    border: 1px solid var(--maxton-border);
    border-radius: 10px;
    background: var(--maxton-input);
    color: var(--maxton-text-muted);
    padding: 10px 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.admin-plan-choice small {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.8;
}

.admin-plan-choice.is-on {
    border-color: var(--maxton-green);
    background: rgba(34, 197, 94, 0.12);
    color: var(--maxton-green);
}

.admin-plan-now {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--maxton-border);
    border-radius: 10px;
    font-size: 13px;
    color: var(--maxton-text-muted);
}

.admin-plan-expiry {
    margin-left: auto;
    font-size: 12px;
}

.admin-plan-tag {
    --plan-ink: #d4a373;
    display: inline-flex;
    align-items: center;
    margin-left: 0;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--plan-ink) 40%, transparent);
    background: color-mix(in srgb, var(--plan-ink) 15%, transparent);
    color: var(--plan-ink);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.admin-plan-now .admin-plan-tag {
    margin-left: 0;
}

/* 1 warm gold / nude color family in distinct shades */
.admin-plan-tag.is-free {
    --plan-ink: #cbb49d;
    background: rgba(203, 180, 157, 0.12);
    border-color: rgba(203, 180, 157, 0.32);
    color: var(--plan-ink);
}

.admin-plan-tag.is-pro {
    --plan-ink: #e5a95d;
    background: rgba(229, 169, 93, 0.20);
    border-color: rgba(229, 169, 93, 0.48);
    color: var(--plan-ink);
}

.admin-plan-tag.is-ultra {
    --plan-ink: #f09536;
    background: rgba(240, 149, 54, 0.26);
    border-color: rgba(240, 149, 54, 0.58);
    color: var(--plan-ink);
}

.admin-plan-tag.is-admin {
    --plan-ink: #f8dfa5;
    background: rgba(248, 223, 165, 0.22);
    border-color: rgba(248, 223, 165, 0.52);
    color: var(--plan-ink);
}

.admin-plan-tag.is-expired {
    --plan-ink: #9c8976;
    background: rgba(156, 137, 118, 0.10);
    border-color: rgba(156, 137, 118, 0.26);
    color: var(--plan-ink);
    opacity: 0.85;
}

.admin-create-error {
    display: none;
    margin: 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    font-size: 13px;
}

.admin-create-error.is-on {
    display: block;
}

.admin-create-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.admin-create-actions .uiverse-btn {
    flex: 1;
    padding: 10px 14px;
}

#supportView.admin-view,
#adminChatView.admin-view {
    flex-direction: column;
    width: 100%;
    align-self: stretch;
}

.admin-support-card {
    width: 100%;
    min-height: calc(100vh - 150px);
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.admin-support {
    display: grid;
    grid-template-columns: minmax(240px, 300px) 1fr;
    gap: 0;
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--maxton-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--maxton-card);
}

.admin-support__people {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--maxton-border);
    background: var(--maxton-card);
    padding: 12px;
    gap: 10px;
}

.admin-support__people .admin-accounts-search {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
}

.admin-support__list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-content: start;
}

.admin-support__person {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--maxton-text-main);
    text-align: left;
    cursor: pointer;
    font: inherit;
    position: relative;
}

.admin-support__person-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.admin-support__person-copy strong {
    font-size: 14px;
    line-height: 1.2;
}

.admin-support__preview {
    font-size: 12px;
    color: var(--maxton-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.admin-support__person .support-status {
    font-size: 11px;
    font-weight: 700;
}

.admin-support__person .support-avatar {
    flex-shrink: 0;
}

.admin-support__person em {
    position: absolute;
    top: 10px;
    right: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--vvs-alert);
    color: #fff;
    font-size: 11px;
    font-style: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-support__person:hover,
.admin-support__person.is-on {
    background: var(--maxton-input);
}

.admin-support__people .support-avatar__dot {
    border-color: var(--maxton-card);
}

/* Slicker people list */
.admin-support__list {
    gap: 4px;
    padding-right: 2px;
}

.admin-support__person {
    padding: 10px 12px 10px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.admin-support__person::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--vvs-admin);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.admin-support__person:hover {
    background: color-mix(in srgb, var(--maxton-input) 70%, transparent);
    transform: translateX(2px);
}

.admin-support__person.is-on {
    background: var(--maxton-input);
    border-color: color-mix(in srgb, var(--vvs-admin) 35%, var(--maxton-border));
}

.admin-support__person.is-on::before {
    opacity: 1;
}

.admin-support__person .support-avatar {
    width: 42px;
    height: 42px;
    box-shadow: 0 0 0 2px var(--maxton-card), 0 4px 10px rgba(0, 0, 0, 0.25);
}

.admin-support__person-top {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.admin-support__person-top strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.admin-support__preview.is-empty {
    font-style: italic;
    opacity: 0.75;
}

.admin-support__person .support-status {
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.support-role {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
    vertical-align: middle;
}

.support-role.is-hearing {
    color: var(--vvs-hearing);
    background: color-mix(in srgb, var(--vvs-hearing) 16%, transparent);
}

.support-role.is-deaf {
    color: var(--vvs-deaf);
    background: color-mix(in srgb, var(--vvs-deaf) 18%, transparent);
}

.support-role.is-admin {
    color: var(--vvs-admin);
    background: color-mix(in srgb, var(--vvs-admin) 18%, transparent);
}

.admin-support__head-copy strong .support-role {
    margin-left: 6px;
    position: relative;
    top: -1px;
}

.vvs-msg__avatar.has-img {
    padding: 0;
    overflow: hidden;
    background: transparent;
}

.vvs-msg__avatar.has-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-support__messages .vvs-msg__avatar {
    width: 32px;
    height: 32px;
    font-size: 10px;
}

.admin-support__person.is-on .support-avatar__dot,
.admin-support__person:hover .support-avatar__dot {
    border-color: var(--maxton-input);
}

.admin-support__thread {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    background: var(--maxton-input);
}

.admin-support__head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--maxton-border);
    background: var(--maxton-card);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-support__head-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-support__head-copy strong {
    display: block;
    font-size: 16px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-support__head-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
    margin-top: 3px;
    font-size: 12px;
    color: var(--maxton-text-muted);
}

.admin-support__head-mail {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-support__head-copy .support-role {
    display: inline-flex;
    width: auto;
    margin-left: 0;
}

.admin-support__head-line,
.admin-support__head-mail {
    font-size: 12px;
    color: var(--maxton-text-muted);
}

.admin-support__head-copy .support-status.is-online {
    color: #22c55e;
}

.admin-support__head-copy .support-status.is-offline {
    color: #94a3b8;
}

.admin-support__messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    --support-canvas: #efe8dc;
    background:
        radial-gradient(720px 220px at 50% -48px, rgba(196, 149, 106, 0.16), transparent 64%),
        linear-gradient(180deg, rgba(255, 250, 244, 0.35), transparent 140px),
        var(--support-canvas);
}

.admin-support__composer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--maxton-border);
    background: var(--maxton-card);
}

.admin-support__compose-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-support__composer input[type="text"]:not(.messageInput) {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--maxton-border);
    border-radius: 12px;
    padding: 10px 14px;
    background: var(--maxton-input);
    color: var(--maxton-text-main);
    font: inherit;
}

.admin-support__composer .uiverse-btn {
    flex-shrink: 0;
    width: auto;
}

.admin-support__back {
    display: none;
}

@keyframes adminSupportSlideIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
    #supportView {
        padding-bottom: 12px !important;
    }

    .admin-support-card {
        min-height: 0;
        height: calc(100dvh - 100px);
        padding: 12px;
    }

    .admin-support-card > .maxton-card-header {
        margin-bottom: 10px !important;
    }

    .admin-support {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        border-radius: 14px;
    }

    .admin-support__people,
    .admin-support__thread {
        grid-row: 1;
        grid-column: 1;
        min-width: 0;
    }

    .admin-support__people {
        border-right: none;
        padding: 10px;
    }

    .admin-support__thread {
        display: none;
    }

    .admin-support.is-thread-open .admin-support__people {
        display: none;
    }

    .admin-support.is-thread-open .admin-support__thread {
        display: flex;
        animation: adminSupportSlideIn 0.22s ease-out;
    }

    .admin-support__person {
        padding: 12px 10px;
        border-radius: 12px;
    }

    .admin-support__person.is-on {
        background: transparent;
        border-color: transparent;
    }

    .admin-support__person.is-on::before {
        opacity: 0;
    }

    .admin-support__person:hover,
    .admin-support__person:active {
        transform: translateX(2px);
    }

    .admin-support__person em {
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
    }

    .admin-support__person-copy {
        padding-right: 28px;
    }

    .admin-support__head {
        padding: 10px 12px;
        gap: 10px;
    }

    .admin-support__head-copy strong {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .admin-support__head-line {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        white-space: normal;
        overflow: visible;
    }

    .admin-support__head-copy .support-role,
    .admin-support__head-copy .support-status {
        display: inline-flex;
        width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .admin-support__head-mail {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-support__head .support-avatar--lg {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
    }

    .admin-support__back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        margin-left: -4px;
        border: none;
        border-radius: 50%;
        background: transparent;
        color: var(--vvs-admin, var(--maxton-text-main));
        cursor: pointer;
    }

    .admin-support__back:hover,
    .admin-support__back:focus-visible {
        background: var(--maxton-input);
    }

    .admin-support__back svg {
        width: 22px;
        height: 22px;
    }

    .admin-support__messages {
        padding: 12px 10px;
    }

    .admin-support__composer {
        padding: 8px 10px;
    }

    .admin-support__compose-main {
        flex: 1 1 auto;
        width: 100%;
    }

    .admin-support__composer .send-plane-btn,
    .admin-support__composer .sendButton {
        margin-left: 0;
    }
}

/* ── RETRY BUTTON ── */
.admin-status-error {
    display: block;
    color: var(--maxton-red);
    font-size: 13px;
    margin-bottom: 8px;
}

.admin-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid var(--maxton-green);
    border-radius: 8px;
    background: transparent;
    color: var(--maxton-green);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-retry-btn:hover {
    background: var(--maxton-green);
    color: #fff;
    transform: translateY(-1px);
}

.admin-retry-btn:active {
    transform: translateY(0);
}

.admin-retry-btn svg {
    width: 14px;
    height: 14px;
}

[data-theme="dark"] .admin-profile-form {
    --uv-ink: #ffffff;
    --uv-shadow: #ffffff;
}

[data-theme="dark"] .admin-profile-form__close {
    color: #ffffff;
    border-color: #ffffff;
    background: #0d0d14;
    box-shadow: 2px 2px 0 #ffffff;
}

[data-theme="dark"] .admin-profile-form__head {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

[data-theme="dark"] .admin-profile-form__head .admin-profile-form__close svg {
    stroke: #ffffff;
}

.admin-profile-form--embedded {
    --uv-primary: var(--accent, #c4956a);
    --uv-ink: var(--text-primary);
    --uv-shadow: var(--text-primary);
    width: 100%;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    transform: none !important;
}

.admin-profile-form--embedded:hover,
.admin-profile-form--embedded:active {
    transform: none !important;
    box-shadow: none;
}

.admin-profile-form--embedded::before {
    display: none;
}

.admin-profile-form--embedded .admin-profile-form__head,
.admin-profile-form--embedded .admin-profile-form__close {
    display: none;
}

[data-theme="dark"] .admin-profile-form--embedded {
    --uv-ink: #ffffff;
    --uv-shadow: #ffffff;
}

[data-theme="dark"] .admin-profile-form--embedded .admin-profile-form__save {
    color: #0d0d14;
}

.admin-profile-form__body {
    overflow: auto;
}

.admin-profile-form__hero {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 16px;
    padding: 16px;
    background: var(--uv-panel);
    border: 2.5px solid var(--uv-text);
    border-radius: 10px;
    box-shadow: 4px 4px 0 var(--uv-shadow);
    min-width: 0;
}

.admin-profile-form__hero .admin-profile-form__avatar {
    grid-row: 1 / span 2;
    padding: 0;
    border: 0;
}

.admin-profile-form__hero .admin-profile-form__avatar img,
.admin-profile-form__hero .admin-profile-form__avatar #adminAvatarInitialsMain {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 22px;
}

.admin-profile-form__hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.admin-profile-form__hero-copy strong,
.admin-profile-form__hero-copy > span:not(.user-role-badge) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-profile-form__hero-copy strong {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
}

.admin-profile-form__hero-copy > span:not(.user-role-badge) {
    font-size: 13px;
    color: var(--uv-muted);
}

.admin-profile-form__hero-hint {
    grid-column: 2 / -1;
    margin: 0;
    font-size: 11px;
    color: var(--uv-muted);
}

.admin-profile-form__card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: var(--uv-bg);
    border: 2.5px solid var(--uv-text);
    border-radius: 10px;
    box-shadow: 4px 4px 0 var(--uv-shadow);
    min-width: 0;
}

.admin-profile-form__card-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 2px dashed color-mix(in srgb, var(--uv-text) 30%, transparent);
}

.admin-profile-form__card-head .admin-profile-form__section-title {
    margin: 0;
    font-size: 12px;
    color: var(--uv-text);
}

.admin-profile-form__card-head .admin-profile-form__hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
}

.admin-profile-form__card .admin-profile-form__grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 14px;
}

.admin-profile-form__stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-profile-form__card .admin-profile-form__field {
    gap: 6px;
}

.admin-profile-form__card .admin-profile-form__field span {
    font-size: 11px;
}

.admin-profile-form__card .admin-profile-form__field input,
.admin-profile-form__card .admin-profile-form__field select {
    min-height: 42px;
    font-size: 14px;
}

.admin-profile-form__card .admin-profile-form__security {
    margin-top: 0;
    box-shadow: none;
    transform: none;
}

.admin-profile-form__ghost--solid {
    background: var(--uv-text);
    color: var(--uv-bg);
}

.admin-profile-form__pass input {
    padding-right: 48px;
}

.admin-profile-form__pass-toggle {
    right: 5px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: var(--uv-muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-profile-form__pass-toggle:hover,
.admin-profile-form__pass-toggle:focus-visible {
    color: var(--uv-text);
    background: color-mix(in srgb, var(--uv-text) 10%, transparent);
    outline: none;
}

.admin-profile-form__pass-toggle::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.admin-profile-form__pass-toggle.is-shown::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 19c-6.5 0-10-7-10-7a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c6.5 0 10 7 10 7a18.5 18.5 0 0 1-2.16 3.19M14.12 14.12a3 3 0 1 1-4.24-4.24'/%3E%3Cpath d='M1 1l22 22'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 19c-6.5 0-10-7-10-7a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c6.5 0 10 7 10 7a18.5 18.5 0 0 1-2.16 3.19M14.12 14.12a3 3 0 1 1-4.24-4.24'/%3E%3Cpath d='M1 1l22 22'/%3E%3C/svg%3E");
}

.admin-profile-form--embedded {
    container-type: inline-size;
    overflow: visible;
}

.admin-profile-form--embedded .admin-profile-form__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    overflow: visible;
}

.admin-profile-form--embedded .admin-profile-form__foot {
    position: static;
    bottom: auto;
    z-index: auto;
    margin-top: 4px;
    padding: 16px 0 2px;
    background: none;
}

@container (max-width: 520px) {
    .admin-profile-form__hero {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .admin-profile-form__hero .admin-profile-form__avatar {
        grid-row: auto;
    }

    .admin-profile-form__hero .admin-profile-form__avatar-actions,
    .admin-profile-form__hero-hint {
        grid-column: 1 / -1;
    }

    .admin-profile-form__hero .admin-profile-form__avatar-actions > * {
        flex: 1 1 0;
    }

    .admin-profile-form__card .admin-profile-form__security {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 600px) {
    .admin-profile-form__hero {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 12px;
        gap: 8px 12px;
    }

    .admin-profile-form__hero .admin-profile-form__avatar {
        grid-row: auto;
    }

    .admin-profile-form__hero .admin-profile-form__avatar-actions,
    .admin-profile-form__hero-hint {
        grid-column: 1 / -1;
    }

    .admin-profile-form__hero .admin-profile-form__avatar-actions > * {
        flex: 1 1 0;
        justify-content: center;
    }

    .admin-profile-form__card .admin-profile-form__security {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 1366px) {
    .maxton-main {
        padding: 0 12px 8px;
    }
}

@media (max-width: 1024px) {
    .maxton-icon-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .maxton-topbar {
        min-height: 56px;
        height: auto;
        flex-wrap: wrap;
        gap: 8px;
        padding: 6px 0;
    }

    .admin-view {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 720px) {
    .maxton-brand-name {
        font-size: 16px;
    }
}

/* Laptop at 100% zoom: keep the app inside the window and the usage pie above its legend. */
@media (min-width: 1001px) {
    #analyticsView {
        overflow: hidden;
    }

    .admin-usage__types .chart-pie-body,
    .admin-usage__library .chart-pie-body {
        overflow: hidden;
        min-height: 0;
    }

    .admin-usage__types .overview-legend,
    .admin-usage__library .overview-legend {
        flex: none;
        margin-top: 8px;
    }
}

@media (min-width: 1100px) {
    .maxton-brand {
        height: clamp(52px, 8vh, 70px);
    }

    .maxton-menu {
        padding: clamp(4px, 0.8vh, 12px) 10px;
        overflow: hidden;
        min-height: 0;
    }

    .maxton-menu-group {
        margin-bottom: clamp(6px, 1.4vh, 20px);
    }

    .maxton-menu-label {
        margin-bottom: clamp(2px, 0.5vh, 8px);
    }

    .maxton-menu-item {
        padding: clamp(4px, 0.75vh, 10px) 10px;
        margin-bottom: 1px;
    }

    #dashboardGrid {
        overflow: hidden;
        height: auto;
        grid-template-rows: repeat(4, minmax(0, 1fr));
        grid-auto-rows: minmax(0, 1fr);
        align-content: stretch;
        align-items: stretch;
        padding-bottom: 4px;
        gap: 10px;
    }

    #dashboardGrid > .maxton-card {
        min-height: 0;
        height: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    #dashboardGrid .chart-container-md,
    #dashboardGrid .chart-container-pie {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

    #dashboardGrid .card-accounts-pie .chart-ring-body {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        display: grid;
        grid-template-columns: minmax(0, 0.85fr) minmax(108px, 1.15fr);
        grid-template-rows: minmax(0, 1fr);
        align-items: center;
        justify-items: stretch;
        gap: 8px;
    }

    #dashboardGrid .card-accounts-pie .chart-ring {
        height: 100%;
        width: auto;
        max-width: 100%;
        max-height: 100%;
        aspect-ratio: 1;
        justify-self: center;
        min-height: 0;
    }

    #dashboardGrid .card-accounts-pie .overview-legend {
        width: 100%;
        align-self: center;
    }

    #dashboardGrid .card-overview-detail .overview-kpis {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        margin-top: 8px;
        gap: 6px;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        align-content: stretch;
    }

    #dashboardGrid .card-overview-detail .overview-kpi {
        min-height: 0;
        height: 100%;
        padding: 6px 10px;
        gap: 2px;
        justify-content: center;
        overflow: hidden;
    }

    #dashboardGrid .card-overview-detail .overview-kpi span {
        font-size: 11px;
    }

    #dashboardGrid .card-overview-detail .overview-kpi strong {
        font-size: clamp(14px, 1.7vh, 20px);
        line-height: 1.1;
    }

    #dashboardGrid .card-welcome .welcome-info {
        justify-content: flex-start;
        gap: 8px;
        overflow: hidden;
    }

    #dashboardGrid .welcome-greeting h2 {
        font-size: clamp(18px, 2.2vh, 28px);
    }

    #dashboardGrid .welcome-stats {
        flex: 1 1 auto;
        min-height: 0;
        gap: 8px;
    }

    #dashboardGrid .welcome-stat {
        min-height: 0;
        padding: 8px 10px;
        gap: 3px;
        justify-content: center;
        overflow: hidden;
    }

    #dashboardGrid .welcome-stat .w-stat-value {
        font-size: clamp(16px, 2vh, 24px);
    }

    #dashboardGrid .welcome-stat .w-stat-label {
        font-size: clamp(12px, 1.5vh, 16px);
        gap: 6px;
    }

    #dashboardGrid .welcome-stat .w-stat-label svg,
    #dashboardGrid .welcome-stat .admin-title-ico {
        width: 16px;
        height: 16px;
    }

    #dashboardGrid .welcome-stat .w-stat-legend {
        font-size: 10px;
    }
}

@media (min-width: 641px) and (max-width: 1099px) {
    #dashboardGrid {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: max-content;
        grid-auto-flow: row;
        align-items: stretch;
        align-content: start;
        height: auto;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        gap: 12px;
    }

    #dashboardGrid > .maxton-card {
        grid-row: auto;
        grid-column: span 6;
        height: auto;
        min-height: 0;
        max-height: none;
        align-self: stretch;
        overflow: hidden;
    }

    #dashboardGrid > .card-welcome,
    #dashboardGrid > .card-overview-detail {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    #dashboardGrid .chart-container-md {
        position: relative;
        flex: 1 1 auto;
        height: auto;
        min-height: 180px;
        max-height: none;
        margin-top: 8px;
        overflow: hidden;
    }

    #dashboardGrid .chart-container-md canvas {
        position: absolute !important;
        inset: 0;
        width: 100% !important;
        height: 100% !important;
    }
}

@media (max-width: 1099px) {
    #dashboardGrid {
        grid-template-rows: none;
        grid-auto-rows: max-content;
        grid-auto-flow: row;
        align-items: stretch;
        align-content: start;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .chart-ring-body,
    #dashboardGrid .card-accounts-pie .chart-ring-body {
        display: flex;
        flex: none;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        height: auto;
        min-height: unset;
        overflow: visible;
        gap: 12px;
        grid-template-columns: none;
        grid-template-rows: none;
    }

    .chart-ring,
    #dashboardGrid .card-accounts-pie .chart-ring {
        width: min(168px, 64vw);
        height: min(168px, 64vw);
        aspect-ratio: auto;
        max-width: min(168px, 64vw);
        max-height: none;
        min-height: unset;
        flex: none;
    }

    #dashboardGrid .card-accounts-pie,
    #dashboardGrid > .maxton-card {
        height: auto;
        min-height: 0;
        max-height: none;
        align-self: stretch;
        overflow: hidden;
    }

    .admin-usage__grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-rows: max-content;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .admin-usage__grid > .maxton-card,
    .admin-usage__trend,
    .admin-usage__types,
    .admin-usage__roles,
    .admin-usage__library {
        grid-column: 1 / -1;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    #analyticsView {
        overflow-x: hidden;
        overflow-y: auto;
    }
}

@media (pointer: coarse) {
    .maxton-menu-item {
        min-height: 44px;
    }
}
