/* App page design pass: profile, models, suggestions, and admin. */

.profile-page,
.models-page,
.suggestions-page,
.admin-page {
    --app-bg: #f7fbfa;
    --app-band: #ffffff;
    --app-surface: #ffffff;
    --app-surface-muted: #f4f7fb;
    --app-text: #111827;
    --app-muted: #667085;
    --app-soft: #8a94a6;
    --app-border: rgba(17, 24, 39, 0.1);
    --app-border-strong: rgba(17, 24, 39, 0.18);
    --app-primary: #3869ff;
    --app-primary-dark: #1648e8;
    --app-primary-soft: rgba(56, 105, 255, 0.12);
    --app-green: #13a571;
    --app-green-soft: rgba(19, 165, 113, 0.12);
    --app-amber: #d58a12;
    --app-amber-soft: rgba(213, 138, 18, 0.14);
    --app-rose: #e05270;
    --app-rose-soft: rgba(224, 82, 112, 0.12);
    --app-shadow: 0 18px 48px rgba(20, 31, 56, 0.1);
    --app-shadow-soft: 0 10px 30px rgba(20, 31, 56, 0.07);
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 28px 0 56px;
    color: var(--app-text);
}

html[data-theme="dark"] .profile-page,
html[data-theme="dark"] .models-page,
html[data-theme="dark"] .suggestions-page,
html[data-theme="dark"] .admin-page {
    --app-bg: #070b12;
    --app-band: #0b111b;
    --app-surface: #101723;
    --app-surface-muted: #151f2e;
    --app-text: #edf4ff;
    --app-muted: #a4b1c5;
    --app-soft: #7c899e;
    --app-border: rgba(229, 238, 255, 0.12);
    --app-border-strong: rgba(229, 238, 255, 0.22);
    --app-primary: #75a2ff;
    --app-primary-dark: #4f82f3;
    --app-primary-soft: rgba(117, 162, 255, 0.18);
    --app-green: #4bd6a0;
    --app-green-soft: rgba(75, 214, 160, 0.16);
    --app-amber: #f3bb55;
    --app-amber-soft: rgba(243, 187, 85, 0.16);
    --app-rose: #ff86a0;
    --app-rose-soft: rgba(255, 134, 160, 0.16);
    --app-shadow: 0 24px 58px rgba(0, 0, 0, 0.36);
    --app-shadow-soft: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.admin-modal {
    --app-bg: #f7fbfa;
    --app-band: #ffffff;
    --app-surface: #ffffff;
    --app-surface-muted: #f4f7fb;
    --app-text: #111827;
    --app-muted: #667085;
    --app-soft: #8a94a6;
    --app-border: rgba(17, 24, 39, 0.1);
    --app-border-strong: rgba(17, 24, 39, 0.18);
    --app-primary: #3869ff;
    --app-primary-dark: #1648e8;
    --app-primary-soft: rgba(56, 105, 255, 0.12);
    --app-green: #13a571;
    --app-green-soft: rgba(19, 165, 113, 0.12);
    --app-amber: #d58a12;
    --app-amber-soft: rgba(213, 138, 18, 0.14);
    --app-rose: #e05270;
    --app-rose-soft: rgba(224, 82, 112, 0.12);
    --app-shadow: 0 18px 48px rgba(20, 31, 56, 0.1);
    --app-shadow-soft: 0 10px 30px rgba(20, 31, 56, 0.07);
}

html[data-theme="dark"] .admin-modal {
    --app-bg: #070b12;
    --app-band: #0b111b;
    --app-surface: #101723;
    --app-surface-muted: #151f2e;
    --app-text: #edf4ff;
    --app-muted: #a4b1c5;
    --app-soft: #7c899e;
    --app-border: rgba(229, 238, 255, 0.12);
    --app-border-strong: rgba(229, 238, 255, 0.22);
    --app-primary: #75a2ff;
    --app-primary-dark: #4f82f3;
    --app-primary-soft: rgba(117, 162, 255, 0.18);
    --app-green: #4bd6a0;
    --app-green-soft: rgba(75, 214, 160, 0.16);
    --app-amber: #f3bb55;
    --app-amber-soft: rgba(243, 187, 85, 0.16);
    --app-rose: #ff86a0;
    --app-rose-soft: rgba(255, 134, 160, 0.16);
    --app-shadow: 0 24px 58px rgba(0, 0, 0, 0.36);
    --app-shadow-soft: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.admin-notification-banner {
    position: relative;
    z-index: 95;
    flex: 0 0 auto;
    width: 100%;
    height: 42px;
    overflow: hidden;
    border-bottom: 1px solid rgba(17, 24, 39, 0.1);
    background: #ffffff;
    color: #111827;
}

body:has(.admin-notification-banner) {
    --tchat-notification-height: 42px;
}

.admin-notification-banner-track {
    display: flex;
    width: max-content;
    height: 100%;
    align-items: center;
    padding-left: 100vw;
    white-space: nowrap;
    will-change: transform;
    animation: adminNotificationMarquee 14s linear infinite;
}

.admin-notification-banner-group {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 48px;
    padding-right: 0;
}

.admin-notification-banner-item {
    display: inline-flex;
    align-items: center;
    color: inherit;
    font-size: 0.88rem;
    font-weight: 800;
}

.admin-notification-banner:hover .admin-notification-banner-track {
    animation-play-state: paused;
}

body:has(.admin-notification-banner) .site-shell {
    height: calc(100dvh - var(--tchat-notification-height, 42px));
    min-height: calc(100dvh - var(--tchat-notification-height, 42px));
}

@keyframes adminNotificationMarquee {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(-100%, 0, 0);
    }
}

@media (max-width: 900px) {
    .admin-notification-banner-track {
        width: max-content;
        min-width: 100%;
        padding-left: 100vw;
        animation-duration: 12s;
    }

    .admin-notification-banner-group {
        width: auto;
        min-width: max-content;
        padding-right: 0;
    }

    .admin-notification-banner-item {
        min-width: max-content;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-notification-banner-track {
        animation: none;
        padding-left: 16px;
    }
}

html[data-theme="dark"] .admin-notification-banner {
    border-bottom-color: rgba(229, 238, 255, 0.12);
    background: #0b111b;
    color: #edf4ff;
}

body:has(.profile-page),
body:has(.models-page),
body:has(.suggestions-page),
body:has(.admin-page) {
    background: #f7fbfa;
    overflow-x: hidden;
}

html[data-theme="dark"] body:has(.profile-page),
html[data-theme="dark"] body:has(.models-page),
html[data-theme="dark"] body:has(.suggestions-page),
html[data-theme="dark"] body:has(.admin-page) {
    background: #070b12;
}

body:has(.profile-page) .site-shell,
body:has(.models-page) .site-shell,
body:has(.suggestions-page) .site-shell,
body:has(.admin-page) .site-shell,
body:has(.profile-page) .site-content,
body:has(.models-page) .site-content,
body:has(.suggestions-page) .site-content,
body:has(.admin-page) .site-content {
    background: #f7fbfa;
    box-shadow: none;
    overflow-x: hidden;
}

html[data-theme="dark"] body:has(.profile-page) .site-shell,
html[data-theme="dark"] body:has(.models-page) .site-shell,
html[data-theme="dark"] body:has(.suggestions-page) .site-shell,
html[data-theme="dark"] body:has(.admin-page) .site-shell,
html[data-theme="dark"] body:has(.profile-page) .site-content,
html[data-theme="dark"] body:has(.models-page) .site-content,
html[data-theme="dark"] body:has(.suggestions-page) .site-content,
html[data-theme="dark"] body:has(.admin-page) .site-content {
    background: #070b12;
}

body:has(.profile-page) .site-content::before,
body:has(.models-page) .site-content::before,
body:has(.suggestions-page) .site-content::before,
body:has(.admin-page) .site-content::before {
    display: none;
}

body:has(.profile-page) .site-main,
body:has(.models-page) .site-main,
body:has(.suggestions-page) .site-main,
body:has(.admin-page) .site-main {
    padding-bottom: 0;
}

@media (min-width: 901px) {
    .site-shell .site-sidebar.sidebar {
        width: var(--site-sidebar-width, 250px);
        min-width: var(--site-sidebar-width, 250px);
        max-width: var(--site-sidebar-width, 250px);
        flex: 0 0 var(--site-sidebar-width, 250px);
    }

    html[data-sidebar-collapsed="1"] .site-shell .site-sidebar.sidebar,
    .site-shell .site-sidebar.sidebar.collapsed {
        width: var(--site-sidebar-collapsed-width, 72px);
        min-width: var(--site-sidebar-collapsed-width, 72px);
        max-width: var(--site-sidebar-collapsed-width, 72px);
        flex-basis: var(--site-sidebar-collapsed-width, 72px);
    }
}

body:has(.profile-page) .site-sidebar.sidebar,
body:has(.models-page) .site-sidebar.sidebar,
body:has(.suggestions-page) .site-sidebar.sidebar,
body:has(.admin-page) .site-sidebar.sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(17, 24, 39, 0.1);
}

body:has(.profile-page) .sidebar-rail-head,
body:has(.models-page) .sidebar-rail-head,
body:has(.suggestions-page) .sidebar-rail-head,
body:has(.admin-page) .sidebar-rail-head,
body:has(.profile-page) .nav-items,
body:has(.models-page) .nav-items,
body:has(.suggestions-page) .nav-items,
body:has(.admin-page) .nav-items,
body:has(.profile-page) .bottom-nav,
body:has(.models-page) .bottom-nav,
body:has(.suggestions-page) .bottom-nav,
body:has(.admin-page) .bottom-nav {
    background: #ffffff;
    border-color: rgba(17, 24, 39, 0.1);
}

body:has(.profile-page) .sidebar-brand,
body:has(.models-page) .sidebar-brand,
body:has(.suggestions-page) .sidebar-brand,
body:has(.admin-page) .sidebar-brand,
body:has(.profile-page) .user-name,
body:has(.models-page) .user-name,
body:has(.suggestions-page) .user-name,
body:has(.admin-page) .user-name {
    color: #111827;
}

body:has(.profile-page) .sidebar-brand-mark,
body:has(.models-page) .sidebar-brand-mark,
body:has(.suggestions-page) .sidebar-brand-mark,
body:has(.admin-page) .sidebar-brand-mark {
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
}

body:has(.profile-page) .nav-item,
body:has(.models-page) .nav-item,
body:has(.suggestions-page) .nav-item,
body:has(.admin-page) .nav-item,
body:has(.profile-page) .sub-nav-item,
body:has(.models-page) .sub-nav-item,
body:has(.suggestions-page) .sub-nav-item,
body:has(.admin-page) .sub-nav-item,
body:has(.profile-page) .history-link,
body:has(.models-page) .history-link,
body:has(.suggestions-page) .history-link,
body:has(.admin-page) .history-link {
    border-radius: 8px;
    color: #667085;
    font-weight: 650;
}

body:has(.profile-page) .nav-item:hover,
body:has(.models-page) .nav-item:hover,
body:has(.suggestions-page) .nav-item:hover,
body:has(.admin-page) .nav-item:hover,
body:has(.profile-page) .nav-item.active,
body:has(.models-page) .nav-item.active,
body:has(.suggestions-page) .nav-item.active,
body:has(.admin-page) .nav-item.active,
body:has(.profile-page) .sub-nav-item:hover,
body:has(.models-page) .sub-nav-item:hover,
body:has(.suggestions-page) .sub-nav-item:hover,
body:has(.admin-page) .sub-nav-item:hover,
body:has(.profile-page) .sub-nav-item.active,
body:has(.models-page) .sub-nav-item.active,
body:has(.suggestions-page) .sub-nav-item.active,
body:has(.admin-page) .sub-nav-item.active,
body:has(.profile-page) .user-block:hover,
body:has(.models-page) .user-block:hover,
body:has(.suggestions-page) .user-block:hover,
body:has(.admin-page) .user-block:hover,
body:has(.profile-page) .user-block.active,
body:has(.models-page) .user-block.active,
body:has(.suggestions-page) .user-block.active,
body:has(.admin-page) .user-block.active {
    background: #f4f7fb;
    color: #111827;
}

html[data-theme="dark"] body:has(.profile-page) .site-sidebar.sidebar,
html[data-theme="dark"] body:has(.models-page) .site-sidebar.sidebar,
html[data-theme="dark"] body:has(.suggestions-page) .site-sidebar.sidebar,
html[data-theme="dark"] body:has(.admin-page) .site-sidebar.sidebar,
html[data-theme="dark"] body:has(.profile-page) .sidebar-rail-head,
html[data-theme="dark"] body:has(.models-page) .sidebar-rail-head,
html[data-theme="dark"] body:has(.suggestions-page) .sidebar-rail-head,
html[data-theme="dark"] body:has(.admin-page) .sidebar-rail-head,
html[data-theme="dark"] body:has(.profile-page) .nav-items,
html[data-theme="dark"] body:has(.models-page) .nav-items,
html[data-theme="dark"] body:has(.suggestions-page) .nav-items,
html[data-theme="dark"] body:has(.admin-page) .nav-items,
html[data-theme="dark"] body:has(.profile-page) .bottom-nav,
html[data-theme="dark"] body:has(.models-page) .bottom-nav,
html[data-theme="dark"] body:has(.suggestions-page) .bottom-nav,
html[data-theme="dark"] body:has(.admin-page) .bottom-nav {
    background: #0b111b;
    border-color: rgba(229, 238, 255, 0.12);
}

html[data-theme="dark"] body:has(.profile-page) .sidebar-brand,
html[data-theme="dark"] body:has(.models-page) .sidebar-brand,
html[data-theme="dark"] body:has(.suggestions-page) .sidebar-brand,
html[data-theme="dark"] body:has(.admin-page) .sidebar-brand,
html[data-theme="dark"] body:has(.profile-page) .user-name,
html[data-theme="dark"] body:has(.models-page) .user-name,
html[data-theme="dark"] body:has(.suggestions-page) .user-name,
html[data-theme="dark"] body:has(.admin-page) .user-name {
    color: #edf4ff;
}

html[data-theme="dark"] body:has(.profile-page) .sidebar-brand-mark,
html[data-theme="dark"] body:has(.models-page) .sidebar-brand-mark,
html[data-theme="dark"] body:has(.suggestions-page) .sidebar-brand-mark,
html[data-theme="dark"] body:has(.admin-page) .sidebar-brand-mark {
    background: #edf4ff;
    color: #0b111b;
}

html[data-theme="dark"] body:has(.profile-page) .nav-item,
html[data-theme="dark"] body:has(.models-page) .nav-item,
html[data-theme="dark"] body:has(.suggestions-page) .nav-item,
html[data-theme="dark"] body:has(.admin-page) .nav-item,
html[data-theme="dark"] body:has(.profile-page) .sub-nav-item,
html[data-theme="dark"] body:has(.models-page) .sub-nav-item,
html[data-theme="dark"] body:has(.suggestions-page) .sub-nav-item,
html[data-theme="dark"] body:has(.admin-page) .sub-nav-item {
    color: #a4b1c5;
}

html[data-theme="dark"] body:has(.profile-page) .nav-item:hover,
html[data-theme="dark"] body:has(.models-page) .nav-item:hover,
html[data-theme="dark"] body:has(.suggestions-page) .nav-item:hover,
html[data-theme="dark"] body:has(.admin-page) .nav-item:hover,
html[data-theme="dark"] body:has(.profile-page) .nav-item.active,
html[data-theme="dark"] body:has(.models-page) .nav-item.active,
html[data-theme="dark"] body:has(.suggestions-page) .nav-item.active,
html[data-theme="dark"] body:has(.admin-page) .nav-item.active,
html[data-theme="dark"] body:has(.profile-page) .sub-nav-item:hover,
html[data-theme="dark"] body:has(.models-page) .sub-nav-item:hover,
html[data-theme="dark"] body:has(.suggestions-page) .sub-nav-item:hover,
html[data-theme="dark"] body:has(.admin-page) .sub-nav-item:hover,
html[data-theme="dark"] body:has(.profile-page) .sub-nav-item.active,
html[data-theme="dark"] body:has(.models-page) .sub-nav-item.active,
html[data-theme="dark"] body:has(.suggestions-page) .sub-nav-item.active,
html[data-theme="dark"] body:has(.admin-page) .sub-nav-item.active,
html[data-theme="dark"] body:has(.profile-page) .user-block:hover,
html[data-theme="dark"] body:has(.models-page) .user-block:hover,
html[data-theme="dark"] body:has(.suggestions-page) .user-block:hover,
html[data-theme="dark"] body:has(.admin-page) .user-block:hover,
html[data-theme="dark"] body:has(.profile-page) .user-block.active,
html[data-theme="dark"] body:has(.models-page) .user-block.active,
html[data-theme="dark"] body:has(.suggestions-page) .user-block.active,
html[data-theme="dark"] body:has(.admin-page) .user-block.active {
    background: #151f2e;
    color: #edf4ff;
}

/* Shared sidebar skin for every signed-in app route. */
.site-shell .site-sidebar.sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(17, 24, 39, 0.1);
}

.site-shell .sidebar-rail-head,
.site-shell .nav-items,
.site-shell .bottom-nav {
    background: #ffffff;
    border-color: rgba(17, 24, 39, 0.1);
}

.site-shell .sidebar-brand,
.site-shell .workspace-name,
.site-shell .cloud-sync-status-label,
.site-shell .user-name {
    color: #111827;
}

.site-shell .sidebar-brand-mark,
.site-shell .workspace-logo {
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
}

.site-shell .nav-item,
.site-shell .sub-nav-item,
.site-shell .history-link {
    border-radius: 8px;
    color: #667085;
    font-weight: 650;
}

.site-shell .history-item {
    min-height: 36px;
}

.site-shell .history-link {
    min-height: 36px;
    align-items: center;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.2;
}

.site-shell .history-title {
    line-height: 1.2;
}

.site-shell .sub-nav-item {
    min-height: 34px;
    flex: 0 0 auto;
}

.site-shell .nav-group.open .sub-nav-items {
    max-height: 420px;
    overflow: visible;
}

.site-shell .nav-item:hover,
.site-shell .nav-item.active,
.site-shell .sub-nav-item:hover,
.site-shell .sub-nav-item.active,
.site-shell .history-link:hover,
.site-shell .history-link.active,
.site-shell .user-block:hover,
.site-shell .user-block.active,
.site-shell .user-block-theme:hover,
.site-shell .user-block-logout:hover {
    background: #f4f7fb;
    color: #111827;
}

.site-shell .nav-item:hover svg:not(.dropdown-icon),
.site-shell .nav-item.active svg:not(.dropdown-icon),
.site-shell .admin-sub-nav-item:hover svg,
.site-shell .admin-sub-nav-item.active svg,
.site-shell .nav-item:hover .dropdown-icon,
.site-shell .nav-item.active .dropdown-icon {
    color: #111827;
}

.site-shell .sidebar-collapse-toggle,
.site-shell .cloud-sync-status,
.site-shell .history-load-more-cloud {
    background: #ffffff;
    border-color: rgba(17, 24, 39, 0.1);
    color: #667085;
}

.site-shell .sidebar-collapse-toggle:hover,
.site-shell .sidebar-collapse-toggle:focus-visible,
.site-shell .history-load-more-cloud:hover,
.site-shell .history-load-more-cloud:focus-visible {
    background: #f4f7fb;
    border-color: rgba(17, 24, 39, 0.18);
    color: #111827;
}

html[data-theme="dark"] .site-shell .site-sidebar.sidebar,
html[data-theme="dark"] .site-shell .sidebar-rail-head,
html[data-theme="dark"] .site-shell .nav-items,
html[data-theme="dark"] .site-shell .bottom-nav {
    background: #0b111b;
    border-color: rgba(229, 238, 255, 0.12);
}

html[data-theme="dark"] .site-shell .sidebar-brand,
html[data-theme="dark"] .site-shell .workspace-name,
html[data-theme="dark"] .site-shell .cloud-sync-status-label,
html[data-theme="dark"] .site-shell .user-name {
    color: #edf4ff;
}

html[data-theme="dark"] .site-shell .sidebar-brand-mark,
html[data-theme="dark"] .site-shell .workspace-logo {
    background: #edf4ff;
    color: #0b111b;
}

html[data-theme="dark"] .site-shell .nav-item,
html[data-theme="dark"] .site-shell .sub-nav-item,
html[data-theme="dark"] .site-shell .history-link {
    color: #a4b1c5;
}

html[data-theme="dark"] .site-shell .nav-item:hover,
html[data-theme="dark"] .site-shell .nav-item.active,
html[data-theme="dark"] .site-shell .sub-nav-item:hover,
html[data-theme="dark"] .site-shell .sub-nav-item.active,
html[data-theme="dark"] .site-shell .history-link:hover,
html[data-theme="dark"] .site-shell .history-link.active,
html[data-theme="dark"] .site-shell .user-block:hover,
html[data-theme="dark"] .site-shell .user-block.active,
html[data-theme="dark"] .site-shell .user-block-theme:hover,
html[data-theme="dark"] .site-shell .user-block-logout:hover,
html[data-theme="dark"][data-sidebar-collapsed="1"] .site-shell .user-block-main:hover,
html[data-theme="dark"][data-sidebar-collapsed="1"] .site-shell .user-block-theme:hover,
html[data-theme="dark"][data-sidebar-collapsed="1"] .site-shell .user-block-logout:hover {
    background: #151f2e;
    color: #edf4ff;
}

html[data-theme="dark"] .site-shell .nav-item:hover svg:not(.dropdown-icon),
html[data-theme="dark"] .site-shell .nav-item.active svg:not(.dropdown-icon),
html[data-theme="dark"] .site-shell .admin-sub-nav-item:hover svg,
html[data-theme="dark"] .site-shell .admin-sub-nav-item.active svg,
html[data-theme="dark"] .site-shell .nav-item:hover .dropdown-icon,
html[data-theme="dark"] .site-shell .nav-item.active .dropdown-icon {
    color: #edf4ff;
}

html[data-theme="dark"] .site-shell .sidebar-collapse-toggle,
html[data-theme="dark"] .site-shell .cloud-sync-status,
html[data-theme="dark"] .site-shell .history-load-more-cloud {
    background: #101723;
    border-color: rgba(229, 238, 255, 0.12);
    color: #a4b1c5;
}

html[data-theme="dark"] .site-shell .sidebar-collapse-toggle:hover,
html[data-theme="dark"] .site-shell .sidebar-collapse-toggle:focus-visible,
html[data-theme="dark"] .site-shell .history-load-more-cloud:hover,
html[data-theme="dark"] .site-shell .history-load-more-cloud:focus-visible {
    background: #151f2e;
    border-color: rgba(229, 238, 255, 0.22);
    color: #edf4ff;
}

.profile-page h1,
.models-page h1,
.suggestions-page h1,
.admin-page h1,
.profile-page h2,
.models-page h2,
.suggestions-page h2,
.admin-page h2,
.profile-page h3,
.models-page h3,
.suggestions-page h3,
.admin-page h3 {
    color: var(--app-text);
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.profile-page p,
.models-page p,
.suggestions-page p,
.admin-page p {
    color: var(--app-muted);
}

.profile-page .card,
.suggestions-page .card,
.admin-page .card,
.models-hero-copy,
.models-hero-stats,
.models-toolbar,
.model-card,
.api-note,
.admin-suggestions-stat {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-soft);
    backdrop-filter: none;
}

.profile-page .btn,
.models-page .btn,
.suggestions-page .btn,
.admin-page .btn {
    min-height: 38px;
    border-radius: 999px;
    font-weight: 750;
}

.profile-page .btn-primary,
.models-page .btn-primary,
.suggestions-page .btn-primary,
.admin-page .btn-primary {
    background: var(--app-primary);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(56, 105, 255, 0.22);
}

.profile-page .btn-primary:hover,
.models-page .btn-primary:hover,
.suggestions-page .btn-primary:hover,
.admin-page .btn-primary:hover {
    background: var(--app-primary-dark);
    color: #ffffff;
}

.profile-page .btn-outline,
.models-page .btn-outline,
.suggestions-page .btn-outline,
.admin-page .btn-outline {
    border-color: var(--app-border);
    background: var(--app-surface-muted);
    color: var(--app-text);
}

.profile-page .form-group input,
.profile-page .form-group select,
.profile-page .form-group textarea,
.admin-page .form-group input,
.admin-page .form-group select,
.admin-page .form-group textarea,
.suggestions-textarea,
.admin-suggestion-form .admin-select,
.admin-suggestion-form .admin-input-sm {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: none;
}

.profile-page .form-group input:focus,
.profile-page .form-group select:focus,
.profile-page .form-group textarea:focus,
.admin-page .form-group input:focus,
.admin-page .form-group select:focus,
.admin-page .form-group textarea:focus,
.suggestions-textarea:focus,
.admin-suggestion-form .admin-select:focus,
.admin-suggestion-form .admin-input-sm:focus {
    border-color: rgba(56, 105, 255, 0.48);
    box-shadow: 0 0 0 4px var(--app-primary-soft);
    background: var(--app-surface);
}

.profile-page .form-group label,
.admin-page .form-group label,
.suggestions-label,
.admin-suggestion-field-label {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.suggestions-header,
.admin-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 18px;
    padding: 24px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-soft);
}

.suggestions-kicker,
.models-kicker {
    display: inline-flex;
    width: max-content;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.suggestions-title,
.admin-page-title {
    margin: 12px 0 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.04;
    font-weight: 850;
}

.suggestions-subtitle,
.admin-page-subtitle {
    max-width: 620px;
    margin: 12px 0 0;
    color: var(--app-muted);
    font-size: 0.96rem;
    line-height: 1.65;
}

.suggestions-header-stats {
    min-width: 220px;
    display: grid;
    gap: 8px;
}

.suggestions-header-stats span {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-text);
    font-size: 0.84rem;
    font-weight: 800;
}

/* Profile */
.profile-overview-grid,
.profile-section-grid,
.profile-main-column,
.profile-side-column {
    gap: 16px;
}

.profile-usage-card,
.profile-section-card {
    padding: 22px;
    border-radius: 8px;
    background: var(--app-surface);
    border-color: var(--app-border);
}

.profile-usage-card::before,
.profile-section-card::before {
    display: none;
}

.profile-usage-head,
.profile-section-head {
    border-bottom-color: var(--app-border);
}

.profile-card-title,
.profile-section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 850;
}

.profile-usage-value {
    color: var(--app-text);
    font-size: clamp(1.9rem, 3vw, 2.35rem);
}

.profile-usage-total,
.profile-reset-text,
.profile-sync-copy,
.profile-api-key-date,
.profile-detail-label {
    color: var(--app-muted);
}

.profile-progress-bar {
    height: 8px;
}

.profile-progress-bar::-webkit-progress-bar {
    background: var(--app-surface-muted);
    border-radius: 999px;
}

.profile-progress-bar::-webkit-progress-value,
.profile-progress-bar::-moz-progress-bar {
    background: var(--app-primary);
}

.profile-progress-bar-monthly::-webkit-progress-value,
.profile-progress-bar-monthly::-moz-progress-bar {
    background: var(--app-text);
}

.profile-detail,
.profile-api-item {
    border-radius: 8px;
    border-color: var(--app-border);
    background: var(--app-surface-muted);
    box-shadow: none;
}

.profile-detail-icon {
    border-radius: 8px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.profile-detail-value,
.profile-sync-state,
.profile-api-key-value,
.profile-api-endpoint-value {
    color: var(--app-text);
}

.profile-api-key-value,
.profile-api-endpoint-value {
    border-color: var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
}

.profile-api-new-key-notice {
    background: var(--app-green-soft);
    border-color: rgba(19, 165, 113, 0.26);
}

.profile-sync-slider {
    background: rgba(17, 24, 39, 0.18);
}

.profile-sync-toggle input:checked + .profile-sync-slider {
    background: var(--app-primary);
}

/* Models */
.models-page {
    max-width: 1180px;
    overflow-x: clip;
}

.models-hero {
    gap: 16px;
    margin-bottom: 16px;
    min-width: 0;
}

.models-hero-copy {
    min-height: 236px;
    padding: 28px;
    min-width: 0;
}

.models-hero-copy::before {
    display: none;
}

.models-hero h1 {
    max-width: 720px;
    margin-top: 14px;
    font-size: clamp(2.3rem, 4.8vw, 3.65rem);
    line-height: 1.04;
    letter-spacing: 0;
    font-weight: 850;
}

.models-hero p {
    color: var(--app-muted);
}

.models-hero-stats {
    gap: 10px;
    padding: 12px;
    min-width: 0;
}

.models-stat,
.model-specs div {
    border-color: var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
}

.models-stat-value,
.model-name,
.model-specs dd {
    color: var(--app-text);
}

.models-stat-label,
.model-provider,
.model-specs dt,
.models-toolbar-label {
    color: var(--app-muted);
}

.models-toolbar {
    margin-bottom: 16px;
    border-radius: 8px;
    min-width: 0;
}

.models-toolbar code,
.model-id,
.api-note-hint code {
    border-color: var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-text);
}

.models-grid {
    gap: 16px;
    min-width: 0;
}

.model-card {
    min-height: 250px;
    padding: 18px;
    border-radius: 8px;
    min-width: 0;
}

.model-card:hover {
    border-color: rgba(56, 105, 255, 0.34);
    box-shadow: var(--app-shadow);
}

.model-mark {
    border-radius: 8px;
    background: var(--app-text);
    color: var(--app-bg);
}

.model-copy-btn,
.admin-action-btn {
    border-radius: 8px;
    background: var(--app-surface-muted);
    border-color: var(--app-border);
    color: var(--app-muted);
}

.model-copy-btn.is-copied,
.profile-copy-btn.is-copied {
    border-color: rgba(19, 165, 113, 0.34);
    background: var(--app-green-soft);
    color: var(--app-green);
    animation: copy-success-pop 480ms cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

.model-copy-btn.is-copied svg {
    animation: copy-success-spin 480ms ease;
}

.model-copy-btn.is-failed,
.profile-copy-btn.is-failed {
    border-color: rgba(224, 82, 112, 0.32);
    background: var(--app-rose-soft);
    color: var(--app-rose);
    animation: copy-failed-shake 360ms ease;
}

.model-copy-btn:hover,
.admin-action-btn--outline:hover {
    border-color: var(--app-border-strong);
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.model-footer {
    border-top-color: var(--app-border);
}

.model-link {
    color: var(--app-primary);
}

.api-note {
    margin-top: 16px;
    padding: 20px;
    border-radius: 8px;
}

.api-note pre {
    border-radius: 8px;
}

.api-note-hint {
    border-radius: 8px;
    background: var(--app-amber-soft);
    border-color: rgba(213, 138, 18, 0.26);
    color: var(--app-text);
}

@keyframes copy-success-pop {
    0% { transform: scale(0.92); }
    48% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes copy-success-spin {
    0% { transform: rotate(0deg) scale(0.85); }
    60% { transform: rotate(8deg) scale(1.12); }
    100% { transform: rotate(0deg) scale(1); }
}

@keyframes copy-failed-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Suggestions */
.suggestions-page {
    max-width: 920px;
    gap: 16px;
}

.suggestions-card {
    padding: 22px;
    border-radius: 8px;
}

.suggestions-card-title {
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 850;
}

.suggestions-remaining,
.suggestions-count-badge {
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.suggestions-banner {
    border-radius: 8px;
}

.suggestions-banner-success {
    background: var(--app-green-soft);
    border-color: rgba(19, 165, 113, 0.26);
    color: var(--app-green);
}

.suggestions-banner-error {
    background: var(--app-rose-soft);
    border-color: rgba(224, 82, 112, 0.26);
    color: var(--app-rose);
}

.suggestion-item {
    border-color: var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
}

.suggestion-date,
.suggestions-empty,
.suggestions-char-counter,
.suggestions-limit-reached {
    color: var(--app-muted);
}

.suggestion-body {
    color: var(--app-text);
}

.suggestion-admin-note,
.admin-suggestion-note {
    border-left-color: var(--app-primary);
    border-radius: 8px;
    background: var(--app-primary-soft);
    color: var(--app-text);
}

.suggestion-status {
    font-weight: 800;
}

.suggestion-status-waiting {
    background: rgba(138, 148, 166, 0.16);
    color: #5f6b7d;
}

.suggestion-status-pending {
    background: var(--app-amber-soft);
    color: var(--app-amber);
}

.suggestion-status-finished {
    background: var(--app-green-soft);
    color: var(--app-green);
}

.suggestion-status-rejected {
    background: var(--app-rose-soft);
    color: var(--app-rose);
}

/* Admin */
.admin-page {
    max-width: 1180px;
}

.admin-codex-check-all-form {
    margin: 0;
}

.admin-codex-header-side {
    display: grid;
    justify-items: end;
    gap: 10px;
    min-width: min(100%, 460px);
}

.admin-codex-check-all-btn {
    white-space: nowrap;
}

.admin-codex-check-progress {
    max-width: 460px;
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.35;
    text-align: right;
}

.admin-codex-check-progress.is-success {
    color: var(--app-green);
}

.admin-codex-check-progress.is-error {
    color: var(--app-rose);
}

.admin-codex-check-all-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.admin-stats-grid,
.admin-charts-grid,
.admin-suggestions-stats,
.admin-suggestions-grid {
    gap: 16px;
}

.admin-dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-dashboard-summary {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.admin-dashboard-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.admin-dashboard-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.admin-summary-grid {
    gap: 12px;
}

.admin-summary-grid--codex {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(260px, 1.35fr);
}

.admin-summary-card {
    --summary-color: var(--app-primary);
    --summary-soft: var(--app-primary-soft);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    min-height: 132px;
    padding: 18px;
    border-radius: 8px;
    overflow: hidden;
}

.admin-summary-card--success {
    --summary-color: var(--app-green);
    --summary-soft: var(--app-green-soft);
}

.admin-summary-card--warning {
    --summary-color: var(--app-amber);
    --summary-soft: var(--app-amber-soft);
}

.admin-summary-card--codex {
    --summary-color: var(--app-amber);
    --summary-soft: var(--app-amber-soft);
}

.admin-summary-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.admin-summary-label {
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 850;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.admin-summary-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--summary-color);
    box-shadow: 0 0 0 5px var(--summary-soft);
    flex: 0 0 10px;
}

.admin-summary-value {
    color: var(--app-text);
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.admin-summary-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -4px;
}

.admin-summary-inline span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.admin-summary-inline strong {
    color: var(--app-text);
    font-size: 0.84rem;
    font-weight: 900;
}

.admin-usage-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px;
}

.admin-usage-graph-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.admin-usage-graph-card {
    --graph-color: var(--app-primary);
    --graph-soft: var(--app-primary-soft);
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 18px;
    border-radius: 8px;
    overflow: hidden;
    justify-content: space-between;
}

.admin-usage-graph-card--active,
.admin-usage-graph-card--new {
    --graph-color: var(--app-green);
    --graph-soft: var(--app-green-soft);
}

.admin-usage-graph-card--usage {
    --graph-color: var(--app-amber);
    --graph-soft: var(--app-amber-soft);
}

.admin-usage-graph-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--app-border);
}

.admin-usage-graph-head .admin-section-desc {
    margin: 4px 0 0;
}

.admin-usage-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.admin-usage-hero strong {
    color: var(--app-text);
    font-size: clamp(1.8rem, 3.2vw, 2.55rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
}

.admin-usage-hero span {
    max-width: 110px;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: right;
}

.admin-trend-bars {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    min-height: 128px;
    padding: 10px 0 0;
    border-bottom: 1px solid var(--app-border);
}

.admin-trend-bar-item {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
}

.admin-trend-bar {
    align-self: end;
    width: 100%;
    height: var(--bar-height, 0%);
    min-height: 4px;
    border-radius: 3px 3px 0 0;
    background: var(--graph-color);
}

.admin-trend-bar.is-zero {
    min-height: 3px;
    opacity: 0.35;
}

.admin-trend-label {
    color: var(--app-soft);
    font-size: 0.66rem;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.admin-window-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    overflow: hidden;
}

.admin-window-metric {
    min-width: 0;
    padding: 10px 12px;
    background: var(--app-surface);
}

.admin-window-metric + .admin-window-metric {
    border-left: 1px solid var(--app-border);
}

.admin-window-metric strong,
.admin-window-metric span {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-window-metric strong {
    color: var(--app-text);
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.05;
}

.admin-window-metric span {
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.admin-metric-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    overflow: hidden;
}

.admin-metric-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 12px;
    background: var(--app-surface);
}

.admin-metric-row + .admin-metric-row {
    border-top: 1px solid var(--app-border);
}

.admin-metric-label {
    min-width: 0;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.admin-metric-value {
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.admin-stat-card {
    min-height: 108px;
    align-items: center;
    padding: 20px;
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
}

.admin-stat-body {
    min-width: 0;
}

.admin-stat-value,
.admin-stat-label {
    overflow-wrap: anywhere;
}

.admin-stat-icon {
    border-radius: 8px;
}

.admin-stat-icon--primary {
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.admin-stat-icon--success {
    background: var(--app-green-soft);
    color: var(--app-green);
}

.admin-stat-icon--warning {
    background: var(--app-amber-soft);
    color: var(--app-amber);
}

.admin-stat-value,
.admin-user-name,
.admin-section-title,
.admin-modal-title,
.admin-codex-cell strong {
    color: var(--app-text);
}

.admin-stat-label,
.admin-section-desc,
.admin-text-muted,
.admin-meta,
.admin-user-email,
.admin-suggestion-date,
.admin-suggestions-empty {
    color: var(--app-muted);
}

.admin-section-card,
.admin-chart-card,
.admin-table-card,
.admin-suggestion-card,
.admin-suggestions-empty-card {
    border-radius: 8px;
}

.admin-section-head,
.admin-modal-header,
.admin-modal-actions,
.admin-plan-create-actions,
.admin-codex-panel-actions {
    border-color: var(--app-border);
}

.admin-plan-create-card,
.admin-codex-panel {
    overflow: hidden;
}

.admin-codex-panel-shell {
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
}

.admin-codex-panel-intro,
.admin-codex-panel-body {
    min-width: 0;
}

.admin-plan-create-intro,
.admin-codex-panel-intro {
    border-color: var(--app-border);
    background: var(--app-surface-muted);
}

.admin-codex-panel--manual .admin-codex-panel-intro,
.admin-codex-panel--token .admin-codex-panel-intro {
    background: var(--app-surface-muted);
}

.admin-plan-create-kicker,
.admin-codex-panel-kicker {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-weight: 850;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.2;
}

.admin-codex-panel-title,
.admin-codex-panel-desc {
    overflow-wrap: anywhere;
}

.admin-codex-panel--manual .admin-codex-panel-kicker {
    background: var(--app-green-soft);
    color: var(--app-green);
}

.admin-codex-panel--token .admin-codex-panel-kicker {
    background: var(--app-amber-soft);
    color: var(--app-amber);
}

.admin-plan-create-chip,
.admin-codex-panel-tag {
    border-color: var(--app-border);
    background: var(--app-surface);
    color: var(--app-muted);
}

.admin-codex-inline-note {
    border-color: var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-codex-inline-note code,
.admin-codex-id,
.admin-mono {
    color: var(--app-text);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-table th,
.admin-table td {
    border-color: var(--app-border);
}

.admin-table th {
    background: var(--app-surface-muted);
    color: var(--app-muted);
}

.admin-table tbody tr:hover {
    background: var(--app-primary-soft);
}

.admin-usage-table-card {
    margin-top: 16px;
}

.admin-table-card .admin-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 18px 20px;
}

.admin-table-card .admin-section-desc {
    margin: 4px 0 0;
}

.admin-table--usage {
    min-width: 920px;
}

.admin-table-more {
    display: flex;
    justify-content: center;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--app-border);
}

.admin-user-avatar {
    border-radius: 8px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.admin-action-btn--danger {
    background: var(--app-rose-soft);
    color: var(--app-rose);
}

.admin-action-btn--danger:hover {
    background: var(--app-rose);
    color: #ffffff;
}

.admin-action-btn--success {
    background: var(--app-green-soft);
    color: var(--app-green);
}

.admin-action-btn--success:hover {
    background: var(--app-green);
    color: #ffffff;
}

.admin-modal {
    background: rgba(15, 23, 42, 0.42);
}

.admin-modal-content {
    border-radius: 8px;
    background: var(--app-surface, #ffffff);
    background-color: var(--app-surface, #ffffff);
    border-color: var(--app-border);
}

.admin-modal-close {
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
}

.admin-modal-btn--cancel {
    background: var(--app-surface-muted);
    border-color: var(--app-border);
    color: var(--app-text);
}

.admin-user-edit-modal {
    padding: 18px;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 1;
    animation: none;
}

.admin-user-edit-dialog {
    width: min(100%, 640px);
    max-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface, #ffffff);
    background-color: var(--app-surface, #ffffff);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 1;
    overflow: hidden;
}

.admin-user-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted, #f4f7fb);
}

.admin-user-edit-form {
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    background: var(--app-surface, #ffffff);
}

.admin-user-edit-body {
    display: grid;
    gap: 16px;
    padding: 18px;
    overflow-y: auto;
}

.admin-user-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-user-edit-field-full {
    margin-bottom: 0;
}

.admin-user-edit-body .form-group {
    margin-bottom: 0;
}

.admin-user-edit-label-note {
    display: inline;
    margin-left: 6px;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.admin-user-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--app-border);
    background: var(--app-surface-muted, #f4f7fb);
}

.admin-user-edit-actions .btn {
    flex: 0 0 auto;
    min-height: 40px;
    min-width: 128px;
    border-radius: 8px;
    box-shadow: none;
}

.admin-user-edit-actions .btn:hover,
.admin-user-edit-modal .admin-modal-close:hover {
    transform: none;
    box-shadow: none;
}

.admin-user-edit-modal .admin-modal-close {
    border-radius: 8px;
    background: var(--app-surface, #ffffff);
    border-color: var(--app-border);
}

.admin-user-edit-body .form-group input,
.admin-user-edit-body .form-group select {
    min-height: 42px;
    border-radius: 8px;
    background: var(--app-surface, #ffffff);
}

.admin-user-edit-body .form-group input:focus,
.admin-user-edit-body .form-group select:focus {
    border-color: var(--app-border-strong);
    box-shadow: none;
}

.admin-modal[hidden] {
    display: none !important;
}

.admin-page > .alert + .admin-section-card,
.admin-page > .alert + .admin-codex-panel {
    margin-top: 16px;
}

.admin-limit-loading {
    color: var(--app-muted);
}

.admin-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--app-border);
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

.admin-table-card .admin-section-head + .admin-table-toolbar {
    border-top: 0;
}

.admin-table-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.admin-table-toolbar-group--end {
    justify-content: flex-end;
    margin-left: auto;
}

.admin-bulk-selected-count,
.admin-table-range,
.admin-pagination-ellipsis {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.admin-bulk-action:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.admin-pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.admin-pagination-pages {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.admin-pagination-page,
.admin-pagination-ellipsis {
    display: inline-flex;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-muted);
    text-decoration: none;
    line-height: 1;
}

.admin-pagination-page:hover,
.admin-pagination-page:focus-visible {
    border-color: var(--app-border-strong);
    color: var(--app-text);
    outline: none;
}

.admin-pagination-page.is-active {
    border-color: rgba(56, 105, 255, 0.4);
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-weight: 900;
}

.admin-pagination-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 8px;
    box-sizing: border-box;
}

.admin-table--users .admin-table-actions-th,
.admin-table--users .admin-table-actions-cell {
    width: 156px;
    min-width: 156px;
    max-width: 156px;
    padding-right: 18px;
    padding-left: 12px;
}

.admin-table--users .admin-table-actions {
    justify-content: flex-end;
    gap: 8px;
    padding-right: 2px;
}

.admin-table-select-th,
.admin-table-select-cell {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    text-align: center !important;
}

.admin-table-select-th input,
.admin-table-select-cell input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--app-primary);
    cursor: pointer;
}

.admin-row-selected {
    background: var(--app-primary-soft);
}

.admin-table tbody tr.admin-row-selected:hover {
    background: var(--app-primary-soft);
}

.admin-confirm-modal {
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 1;
    animation: none;
}

.admin-confirm-dialog {
    width: min(100%, 460px);
    max-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface, #ffffff);
    background-color: var(--app-surface, #ffffff);
    color: var(--app-text);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    opacity: 1;
    overflow: hidden;
}

.admin-confirm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted, #f4f7fb);
}

.admin-confirm-body {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.admin-confirm-message {
    margin: 0;
    color: var(--app-text);
    font-size: 0.92rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.admin-confirm-note {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 750;
    line-height: 1.45;
}

.admin-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--app-border);
    background: var(--app-surface-muted, #f4f7fb);
}

.admin-confirm-delete-btn {
    background: var(--app-rose);
    color: #ffffff;
}




.admin-dynamic-alert {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .admin-table-toolbar,
    .admin-table-toolbar-group,
    .admin-table-toolbar-group--end {
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        margin-left: 0;
    }

    .admin-pagination {
        width: 100%;
        justify-content: space-between;
    }

    .admin-pagination-pages {
        overflow-x: auto;
        padding-bottom: 2px;
    }
}

.admin-suggestions-stat {
    border-radius: 8px;
    color: inherit;
}

.admin-suggestions-stat.active {
    border-color: rgba(56, 105, 255, 0.46);
    box-shadow: 0 0 0 4px var(--app-primary-soft);
}

.admin-suggestions-stat-value {
    color: var(--app-text);
}

.admin-suggestions-stat-label {
    color: var(--app-muted);
}

.admin-suggestion-text {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-text);
}

.badge {
    font-weight: 800;
}

.badge-admin,
.badge-success {
    background: var(--app-green-soft);
    color: var(--app-green);
}

.badge-warning {
    background: var(--app-amber-soft);
    color: var(--app-amber);
}

.badge-banned,
.badge-inactive {
    background: var(--app-rose-soft);
    color: var(--app-rose);
}

/* Admin notifications */
.admin-notifications-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-notifications-page .card,
.admin-notifications-page .alert {
    margin-bottom: 0;
}

.admin-notification-kicker {
    display: inline-flex;
    width: max-content;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.admin-notifications-header-meta {
    grid-template-columns: repeat(3, minmax(92px, 1fr));
}

.admin-notification-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
    gap: 16px;
    align-items: stretch;
}

.admin-notification-composer-card,
.admin-notification-preview-card {
    min-width: 0;
}

.admin-notification-composer-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-notification-card-icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.admin-notification-composer-head .admin-section-desc {
    margin: 4px 0 0;
}

.admin-notification-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-notification-form-grid {
    display: grid;
    grid-template-columns: minmax(120px, 160px) minmax(180px, 1fr);
    gap: 10px;
    align-items: end;
}

.admin-notification-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.admin-notification-field span {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.admin-page .admin-notification-field input,
.admin-page .admin-notification-field textarea {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0.7rem 0.82rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text);
    font: inherit;
    font-size: 0.9rem;
    box-shadow: none;
    box-sizing: border-box;
}

.admin-page .admin-notification-field textarea {
    min-height: 104px;
    line-height: 1.5;
    resize: vertical;
}

.admin-page .admin-notification-field input:focus,
.admin-page .admin-notification-field textarea:focus {
    outline: none;
    border-color: rgba(56, 105, 255, 0.48);
    box-shadow: 0 0 0 4px var(--app-primary-soft);
}

.admin-notification-counter {
    justify-self: end;
    color: var(--app-soft);
    font-size: 0.76rem;
    font-weight: 800;
}

.admin-notification-counter strong {
    color: var(--app-text);
}

.admin-notification-field.is-near-limit .admin-notification-counter,
.admin-notification-field.is-near-limit .admin-notification-counter strong {
    color: var(--app-amber);
}

.admin-notification-toggle {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-text);
    cursor: pointer;
}

.admin-notification-toggle input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    accent-color: var(--app-primary);
}

.admin-notification-toggle span {
    display: grid;
    gap: 2px;
    min-width: 0;
    letter-spacing: 0;
    text-transform: none;
}

.admin-notification-toggle strong {
    color: var(--app-text);
    font-size: 0.86rem;
    font-weight: 850;
    line-height: 1.05;
}

.admin-notification-toggle small {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.1;
}

.admin-notification-form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 14px;
    border-top: 1px solid var(--app-border);
}

.admin-notification-form-actions .btn,
.admin-notification-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-notification-preview-head {
    align-items: center;
    padding: 0 0 14px;
    margin-bottom: 16px;
}

.admin-notification-live-pill {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--app-green-soft);
    color: var(--app-green);
    font-size: 0.76rem;
    font-weight: 850;
}

.admin-notification-preview-banner {
    position: relative;
    overflow: hidden;
    min-height: 64px;
    border: 1px solid rgba(17, 24, 39, 0.18);
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
}

.admin-notification-preview-track {
    display: flex;
    width: max-content;
    min-width: 100%;
    min-height: 64px;
    align-items: center;
    gap: 34px;
    padding: 0 22px;
    white-space: nowrap;
    animation: adminNotificationPreviewDrift 24s linear infinite;
}

.admin-notification-preview-item {
    display: inline-flex;
    align-items: center;
    max-width: min(560px, 76vw);
    font-size: 0.9rem;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-notification-preview-item::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    margin-right: 10px;
    border-radius: 999px;
    background: var(--app-green);
}

.admin-notification-preview-item.is-empty,
.admin-notification-preview-item--empty {
    color: rgba(255, 255, 255, 0.66);
}

.admin-notification-active-stack {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    max-height: 220px;
    overflow-y: auto;
}

.admin-notification-active-item {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 11px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-text);
    font-size: 0.86rem;
    font-weight: 750;
    line-height: 1.45;
}

.admin-notification-active-item span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-notification-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--app-green);
    box-shadow: 0 0 0 4px var(--app-green-soft);
}

.admin-notification-active-empty {
    margin: 0;
    padding: 14px;
    border: 1px dashed var(--app-border-strong);
    border-radius: 8px;
    color: var(--app-muted);
    text-align: center;
}

.admin-notification-table-head {
    align-items: center;
}

.admin-notification-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    min-width: min(100%, 440px);
}

.admin-notification-filters {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 38px;
    padding: 3px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface-muted);
}

.admin-notification-filter {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--app-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
}

.admin-notification-filter:hover,
.admin-notification-filter:focus-visible,
.admin-notification-filter.is-active {
    background: var(--app-surface);
    color: var(--app-text);
    outline: none;
    box-shadow: 0 1px 4px rgba(20, 31, 56, 0.08);
}

.admin-notification-search {
    display: inline-flex;
    min-width: 190px;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-muted);
}

.admin-notification-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--app-text);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
}

.admin-notification-list {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.admin-notification-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    gap: 14px;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
}

.admin-notification-row[hidden] {
    display: none;
}

.admin-notification-row.is-active {
    border-color: rgba(19, 165, 113, 0.34);
}

.admin-notification-row-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 12px;
}

.admin-notification-row-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.admin-notification-row-chip,
.admin-notification-row-date {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 0 9px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-muted);
    font-size: 0.74rem;
    font-weight: 820;
    white-space: nowrap;
}

.admin-notification-row-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.45fr) auto;
    gap: 10px;
    align-items: end;
}

.admin-notification-row-form .admin-notification-field textarea {
    min-height: 92px;
}

.admin-notification-row-fields {
    display: grid;
    grid-template-columns: minmax(80px, 0.65fr) minmax(128px, 1fr);
    gap: 10px;
    align-items: end;
}

.admin-notification-save {
    display: flex;
    justify-content: flex-end;
}

.admin-notification-save-btn {
    min-width: 86px;
}

.admin-notification-row-side {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding-left: 14px;
    border-left: 1px solid var(--app-border);
}

.admin-notification-mini-preview {
    display: flex;
    min-height: 72px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 0.84rem;
    font-weight: 760;
    line-height: 1.45;
}

.admin-notification-mini-preview span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}

.admin-notification-row-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.admin-notification-empty {
    margin: 0;
}

@keyframes adminNotificationPreviewDrift {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(-40%, 0, 0);
    }
}

html[data-theme="dark"] .admin-notification-preview-banner {
    border-color: rgba(229, 238, 255, 0.12);
    background: #0b111b;
    color: #edf4ff;
}

html[data-theme="dark"] .admin-notification-filter:hover,
html[data-theme="dark"] .admin-notification-filter:focus-visible,
html[data-theme="dark"] .admin-notification-filter.is-active {
    box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
    .admin-notification-preview-track {
        animation: none;
    }
}

@media (max-width: 1020px) {
    .admin-notification-workspace,
    .admin-notification-row {
        grid-template-columns: 1fr;
    }

    .admin-notification-row-side {
        padding-top: 12px;
        padding-left: 0;
        border-top: 1px solid var(--app-border);
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .admin-notification-table-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-notification-toolbar {
        width: 100%;
        justify-content: stretch;
    }

    .admin-notification-filters,
    .admin-notification-search {
        flex: 1 1 100%;
    }

    .admin-notification-filter {
        flex: 1 1 0;
    }

    .admin-notification-form-grid,
    .admin-notification-row-form {
        grid-template-columns: 1fr;
    }

    .admin-notification-row-fields {
        grid-template-columns: 1fr;
    }

    .admin-notification-save {
        justify-content: stretch;
    }

    .admin-notification-save-btn {
        width: 100%;
        justify-content: center;
    }

    .admin-notification-row-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .admin-notification-kicker {
        max-width: 100%;
        white-space: normal;
    }

    .admin-notification-list {
        padding: 10px;
    }

    .admin-notification-row {
        padding: 12px;
    }

    .admin-notification-preview-track {
        gap: 22px;
        padding-inline: 14px;
    }
}

/* Admin providers */
.admin-providers-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-providers-page .card,
.admin-providers-page .alert {
    margin-bottom: 0;
}

.admin-providers-header-meta,
.admin-codex-header-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    gap: 8px;
    min-width: min(100%, 360px);
}

.admin-codex-header-meta {
    grid-template-columns: repeat(4, minmax(86px, 1fr));
    min-width: min(100%, 460px);
}

.admin-codex-limit-totals {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(118px, max-content));
    gap: 8px;
    width: max-content;
    min-width: 0;
    justify-self: end;
}

.admin-providers-header-meta span,
.admin-codex-header-meta span,
.admin-codex-limit-totals span {
    display: flex;
    min-width: 0;
    min-height: 52px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-providers-header-meta strong,
.admin-codex-header-meta strong,
.admin-codex-limit-totals strong {
    color: var(--app-text);
    font-size: 1.24rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
}

.admin-codex-limit-totals span {
    min-height: 38px;
    gap: 2px;
    padding: 7px 10px;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
}

.admin-codex-limit-totals strong {
    font-size: 0.98rem;
}

.admin-codex-limit-totals span.is-good strong {
    color: var(--app-green);
}

.admin-codex-limit-totals span.is-warning strong {
    color: var(--app-amber);
}

.admin-codex-limit-totals span.is-danger strong {
    color: var(--app-rose);
}

.admin-codex-limit-totals span.is-muted strong {
    color: var(--app-muted);
}

.admin-provider-create-card .admin-codex-panel-tags {
    margin-top: 14px;
}

.admin-provider-model-block {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-muted);
}

.admin-provider-model-block--modal {
    margin-top: 16px;
}

.admin-provider-model-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.admin-provider-model-block-head .admin-section-desc {
    margin: 4px 0 0;
}

.admin-provider-model-title {
    margin: 0;
    color: var(--app-text);
    font-size: 0.96rem;
    font-weight: 850;
    line-height: 1.2;
}

.provider-models-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.provider-models-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) minmax(140px, 1fr) minmax(150px, 1fr) minmax(104px, 0.7fr) minmax(104px, 0.7fr) 38px;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.admin-page .provider-models-row input {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0.66rem 0.78rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text);
    font: inherit;
    font-size: 0.88rem;
    box-shadow: none;
}

.admin-page .provider-models-row input:focus {
    outline: none;
    border-color: rgba(56, 105, 255, 0.48);
    box-shadow: 0 0 0 4px var(--app-primary-soft);
}

.admin-provider-model-remove {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-muted);
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.admin-provider-model-remove:hover,
.admin-provider-model-remove:focus-visible {
    border-color: rgba(224, 82, 112, 0.36);
    background: var(--app-rose-soft);
    color: var(--app-rose);
    transform: translateY(-1px);
    outline: none;
}

.admin-provider-table-head {
    align-items: center;
}

.admin-provider-head-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--app-amber-soft);
    color: var(--app-amber);
    font-size: 0.76rem;
    font-weight: 850;
    white-space: nowrap;
}

.admin-table--providers {
    min-width: 1060px;
}

.admin-table--providers .admin-table-actions-th,
.admin-table--providers .admin-table-actions-cell {
    width: 142px;
    min-width: 142px;
    max-width: 142px;
    text-align: center;
}

.admin-table--providers .admin-table-actions {
    width: 100%;
    justify-content: center;
}

.admin-provider-cell {
    display: flex;
    min-width: 0;
    max-width: 360px;
    flex-direction: column;
    gap: 6px;
}

.admin-provider-cell-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-provider-cell-title strong {
    min-width: 0;
    color: var(--app-text);
    font-weight: 850;
    overflow-wrap: anywhere;
}

.admin-provider-key {
    display: inline-flex;
    max-width: 100%;
    min-height: 24px;
    align-items: center;
    padding: 0 8px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface-muted);
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.admin-provider-base-url {
    display: block;
    min-width: 0;
    max-width: 100%;
    color: var(--app-muted);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-provider-kind {
    min-width: 76px;
    text-align: center;
}

.admin-provider-kind--openai {
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.admin-provider-kind--anthropic {
    background: var(--app-green-soft);
    color: var(--app-green);
}

.admin-provider-status-cell,
.admin-codex-status-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
}

.admin-provider-limit-cell {
    display: grid;
    gap: 6px;
    min-width: 132px;
}

.admin-provider-limit-cell span {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 9px;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--app-surface-muted);
}

.admin-provider-limit-cell strong {
    min-width: 0;
    color: var(--app-text);
    font-size: 0.82rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.admin-provider-limit-cell small {
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.admin-provider-models-list {
    min-width: 142px;
}

.admin-provider-models-list summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface-muted);
    color: var(--app-text);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
    list-style: none;
}

.admin-provider-models-list summary::-webkit-details-marker {
    display: none;
}

.admin-provider-models-list summary svg {
    flex: 0 0 auto;
    transition: transform 0.16s ease;
}

.admin-provider-models-list[open] summary svg {
    transform: rotate(180deg);
}

.admin-provider-model-chip-list {
    display: flex;
    max-height: 210px;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding-right: 4px;
    overflow-y: auto;
}

.admin-provider-model-chip {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--app-surface-muted);
}

.admin-provider-model-chip code {
    color: var(--app-text);
    font-size: 0.76rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.admin-provider-model-chip small {
    color: var(--app-muted);
    font-size: 0.72rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.admin-provider-date {
    color: var(--app-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.admin-provider-modal {
    max-width: 820px;
    padding: 22px;
}

.admin-provider-modal .admin-modal-actions {
    margin-top: 18px;
}

.admin-page .form-group .admin-provider-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--app-muted);
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
}

.admin-page .form-group .admin-provider-check input {
    width: 15px;
    min-width: 15px;
    height: 15px;
    min-height: 15px;
    padding: 0;
    accent-color: var(--app-primary);
    box-shadow: none;
}

/* Dark page components */
html[data-theme="dark"] .profile-page .card,
html[data-theme="dark"] .suggestions-page .card,
html[data-theme="dark"] .admin-page .card,
html[data-theme="dark"] .models-hero-copy,
html[data-theme="dark"] .models-hero-stats,
html[data-theme="dark"] .models-toolbar,
html[data-theme="dark"] .model-card,
html[data-theme="dark"] .api-note,
html[data-theme="dark"] .admin-suggestions-stat {
    background: var(--app-surface);
    border-color: var(--app-border);
    box-shadow: var(--app-shadow-soft);
}

html[data-theme="dark"] .suggestions-header,
html[data-theme="dark"] .admin-page-header {
    background: var(--app-surface);
    border-color: var(--app-border);
}

html[data-theme="dark"] .profile-detail,
html[data-theme="dark"] .profile-api-item,
html[data-theme="dark"] .models-stat,
html[data-theme="dark"] .model-specs div,
html[data-theme="dark"] .model-id,
html[data-theme="dark"] .suggestion-item,
html[data-theme="dark"] .admin-plan-create-intro,
html[data-theme="dark"] .admin-codex-panel-intro,
html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .admin-suggestion-text {
    background: var(--app-surface-muted);
    border-color: var(--app-border);
}

html[data-theme="dark"] .model-mark {
    background: #edf4ff;
    color: #0b111b;
}

html[data-theme="dark"] .profile-api-key-value,
html[data-theme="dark"] .profile-api-endpoint-value,
html[data-theme="dark"] .profile-page .form-group input,
html[data-theme="dark"] .profile-page .form-group select,
html[data-theme="dark"] .profile-page .form-group textarea,
html[data-theme="dark"] .admin-page .form-group input,
html[data-theme="dark"] .admin-page .form-group select,
html[data-theme="dark"] .admin-page .form-group textarea,
html[data-theme="dark"] .suggestions-textarea,
html[data-theme="dark"] .admin-suggestion-form .admin-select,
html[data-theme="dark"] .admin-suggestion-form .admin-input-sm,
html[data-theme="dark"] .models-toolbar code,
html[data-theme="dark"] .api-note-hint code {
    background: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}

html[data-theme="dark"] .suggestion-status-waiting {
    background: rgba(164, 177, 197, 0.18);
    color: #c6d1e2;
}

html[data-theme="dark"] .admin-modal {
    background: rgba(3, 6, 12, 0.66);
}

html[data-theme="dark"] .admin-modal-content {
    background: var(--app-surface);
    border-color: var(--app-border);
}

@media (max-width: 980px) {
    .profile-page,
    .models-page,
    .suggestions-page,
    .admin-page {
        padding-top: 16px;
    }

    .suggestions-header,
    .admin-page-header,
    .models-hero {
        grid-template-columns: 1fr;
    }

    .suggestions-header-stats {
        min-width: 0;
    }

    .profile-section-grid,
    .models-hero {
        gap: 16px;
    }

    .models-hero-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body:has(.profile-page) .site-main,
    body:has(.models-page) .site-main,
    body:has(.suggestions-page) .site-main,
    body:has(.admin-page) .site-main {
        padding-top: 4.25rem;
    }

    .profile-page,
    .models-page,
    .suggestions-page,
    .admin-page {
        padding-bottom: 34px;
    }

    .suggestions-header,
    .admin-page-header,
    .models-hero-copy,
    .models-hero-stats,
    .models-toolbar,
    .api-note {
        padding: 18px;
    }

    .suggestions-title,
    .admin-page-title,
    .models-hero h1 {
        font-size: 2.15rem;
    }

    .models-hero-stats,
    .profile-overview-grid,
    .profile-details-grid,
    .profile-form-grid,
    .admin-charts-grid,
    .admin-usage-graph-grid {
        grid-template-columns: 1fr;
    }

    .admin-stats-grid,
    .admin-suggestions-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-summary-grid--codex {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-summary-card--codex {
        grid-column: 1 / -1;
    }

    .admin-dashboard-meta {
        justify-content: flex-start;
    }

    .admin-plan-create-shell,
    .admin-codex-panel-shell {
        grid-template-columns: 1fr;
    }

    .admin-plan-create-intro,
    .admin-codex-panel-intro {
        border-right: 0;
        border-bottom: 1px solid var(--app-border);
    }

    .admin-codex-header-side,
    .admin-providers-header-meta,
    .admin-codex-header-meta,
    .admin-codex-limit-totals {
        width: 100%;
        min-width: 0;
    }

    .admin-codex-header-side {
        justify-items: stretch;
    }

    .admin-provider-model-block-head,
    .admin-provider-table-head {
        align-items: flex-start;
    }

    .provider-models-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-provider-model-remove {
        grid-column: 2;
        justify-self: end;
    }
}

@media (max-width: 520px) {
    .suggestions-header,
    .admin-page-header,
    .models-hero-copy,
    .models-hero-stats,
    .models-toolbar,
    .api-note,
    .profile-usage-card,
    .profile-section-card,
    .suggestions-card,
    .admin-stat-card,
    .admin-section-card,
    .admin-chart-card,
    .admin-usage-graph-card,
    .admin-summary-card {
        padding: 16px;
    }

    .suggestions-title,
    .admin-page-title,
    .models-hero h1 {
        font-size: 1.82rem;
        line-height: 1.08;
        overflow-wrap: normal;
    }

    .models-page,
    .profile-page,
    .suggestions-page,
    .admin-page {
        width: 100%;
        max-width: 100%;
    }

    .models-hero,
    .models-grid,
    .models-toolbar,
    .model-card,
    .models-hero-copy,
    .models-hero-stats,
    .api-note,
    .suggestions-header,
    .admin-page-header {
        max-width: 100%;
        min-width: 0;
    }

    .models-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .model-specs {
        grid-template-columns: 1fr;
    }

    .admin-stats-grid,
    .admin-suggestions-stats {
        grid-template-columns: 1fr;
    }

    .admin-summary-grid--codex {
        grid-template-columns: 1fr;
    }

    .admin-summary-card--codex {
        grid-column: auto;
    }

    .admin-providers-header-meta,
    .admin-codex-header-meta,
    .admin-codex-limit-totals {
        grid-template-columns: 1fr;
    }

    .admin-provider-model-block-head,
    .admin-provider-table-head {
        flex-direction: column;
        align-items: stretch;
    }

    .provider-models-row {
        grid-template-columns: 1fr;
    }

    .admin-provider-model-remove {
        grid-column: auto;
        justify-self: end;
    }

    .admin-provider-modal {
        padding: 16px;
    }

    .admin-user-edit-modal {
        padding: 12px;
    }

    .admin-user-edit-grid {
        grid-template-columns: 1fr;
    }

    .admin-user-edit-actions {
        flex-direction: column-reverse;
    }

    .admin-user-edit-actions .btn {
        width: 100%;
    }

    .admin-usage-graph-head,
    .admin-usage-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-usage-hero span {
        max-width: none;
        text-align: left;
    }

    .admin-window-metrics {
        grid-template-columns: 1fr;
    }

    .admin-window-metric + .admin-window-metric {
        border-left: 0;
        border-top: 1px solid var(--app-border);
    }

    .admin-trend-bars {
        gap: 5px;
        padding-inline: 8px;
    }

    .admin-trend-label {
        font-size: 0.58rem;
    }

    .suggestions-form-actions,
    .admin-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .suggestions-form-actions .btn,
    .admin-modal-actions .btn {
        width: 100%;
    }
}
