/* admin-theme.css - Premium Glassmorphic Theme v2 */

body {
    background-color: var(--os-bg);
    color: var(--os-text);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Typography Overrides */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
}
.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Modern Minimal Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(151, 168, 195, 0.5);
    border-radius: 10px;
    border: 2px solid var(--os-bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--os-accent);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(151, 168, 195, 0.3);
}

/* Loader */
.loader {
    border: 3px solid rgba(151, 168, 195, 0.4);
    border-top: 3px solid var(--os-accent);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Drop Shadows and Utilities */
.drop-shadow-glow {
    filter: drop-shadow(0 0 15px rgba(var(--os-accent-rgb), 0.5));
}
.drop-shadow-glow-danger {
    filter: drop-shadow(0 0 15px rgba(var(--os-danger-rgb), 0.5));
}

/* Form Controls */
.input-field {
    background: rgba(15, 20, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--os-text-strong);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.input-field:focus {
    outline: none;
    border-color: var(--os-accent);
    background: rgba(15, 20, 35, 0.8);
    box-shadow: 0 0 0 4px rgba(var(--os-accent-rgb), 0.15), inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Toggle Checkbox */
input:checked + div {
    background-color: var(--os-accent);
    box-shadow: 0 0 10px rgba(var(--os-accent-rgb), 0.4);
}
input:checked + div:after {
    transform: translateX(100%);
    border-color: var(--os-bg);
}

/* Navigation Links */
.nav-item {
    position: relative;
    color: var(--os-muted);
    transition: all 0.2s ease;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: transparent;
    width: 100%;
    text-align: left;
    line-height: 1.2;
}
.nav-item > i {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}
.nav-item > span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-item:hover {
    color: var(--os-text);
    background: rgba(255, 255, 255, 0.05);
}
.nav-item:hover > i { opacity: 1; }
.nav-item.active {
    color: var(--os-accent);
    background: linear-gradient(90deg, rgba(var(--os-accent-rgb), 0.15) 0%, rgba(var(--os-accent-rgb), 0.03) 100%);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--os-accent);
}
.nav-item.active > i { opacity: 1; }

/* Nav Badge */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--os-danger);
    color: var(--os-text-strong);
    font-size: 11px;
    font-weight: 650;
    padding: 0 8px;
    margin-left: auto;
    box-shadow: 0 0 10px rgba(var(--os-danger-rgb), 0.5);
}

/* Dashboard area is a passthrough container - children manage their own layout */
#dashboard-area {
    width: 100%;
}
.admin-content-wrap {
    width: 100%;
    max-width: none !important;
}
.admin-table-panel {
    min-width: 0;
}
.admin-table-scroll {
    width: 100%;
}
#admin-data-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}
.admin-table-panel th,
.admin-table-panel td {
    white-space: normal;
}
.admin-table-panel .whitespace-nowrap {
    white-space: nowrap;
}
.admin-table-panel .truncate {
    min-width: 0;
}
.stat-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
    min-width: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}
.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(var(--os-accent-rgb), 0.4) !important;
    box-shadow: 0 12px 40px rgba(var(--os-accent-rgb), 0.15) !important;
}

.lbvr-events-toolbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.lbvr-events-search {
    min-width: min(100%, 320px);
    flex: 1 1 320px;
}

.lbvr-event-filter {
    min-width: 136px;
}

.lbvr-events-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 0.85rem;
    align-items: start;
}

.lbvr-events-table-wrap {
    min-width: 0;
}

.lbvr-events-table {
    min-width: 820px;
}

.lbvr-events-table td {
    vertical-align: top;
}

.lbvr-events-table td:nth-child(2) {
    max-width: 240px;
    overflow-wrap: anywhere;
}

.lbvr-events-table td:nth-child(6) {
    max-width: 340px;
    overflow-wrap: anywhere;
}

.lbvr-event-detail {
    position: sticky;
    top: 1rem;
    min-width: 0;
}

.lbvr-event-meta {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: rgba(8, 9, 13, 0.55);
    padding: 0.65rem;
}

.lbvr-event-meta span,
.lbvr-event-meta strong {
    display: block;
    min-width: 0;
}

.lbvr-event-meta span {
    color: #747d91;
    font-size: 0.71rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0.01em;
}

.lbvr-event-meta strong {
    color: var(--os-text);
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lbvr-event-detail-json {
    max-height: 460px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    padding: 0.85rem;
}

.lbvr-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: none;
    white-space: nowrap;
}

.lbvr-pill-ok {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.22);
}

.lbvr-pill-warn {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.22);
}

.lbvr-pill-danger {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.28);
}

.lbvr-perf-samples-scroll {
    max-height: 620px;
    overflow: auto;
}

.lbvr-perf-samples-table {
    min-width: 1180px;
}

.lbvr-perf-samples-scroll thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--os-panel);
}

@media (max-width: 1100px) {
    .lbvr-events-grid {
        grid-template-columns: 1fr;
    }

    .lbvr-event-detail {
        position: static;
    }
}

/* Table Styles - Modern Rows */
table {
    border-collapse: separate;
    border-spacing: 0 6px;
    width: 100%;
    padding: 0 0.75rem;
}
table thead tr th {
    color: var(--os-muted);
    border: none;
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.01em;
    background: transparent;
    text-transform: none;
}
tbody tr {
    background: rgba(255, 255, 255, 0.025);
    transition: background 0.15s ease, box-shadow 0.15s ease;
    border-radius: 10px;
}
tbody tr:hover {
    background: rgba(var(--os-accent-rgb), 0.06);
    box-shadow: 0 2px 10px rgba(var(--os-accent-rgb), 0.08);
}
tbody td {
    border: none;
    padding: 0.9rem 1rem;
    font-size: 0.875rem;
    vertical-align: middle;
}
tbody tr td:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
tbody tr td:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

/* Editor Components */
.news-lang-tabs { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.news-lang-tab {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(15, 20, 35, 0.6);
    color: var(--os-muted);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.news-lang-tab:hover { border-color: var(--os-accent); color: var(--os-accent); }
.news-lang-tab.is-active {
    background: rgba(var(--os-accent-rgb), 0.15);
    color: var(--os-accent);
    border-color: var(--os-accent);
    box-shadow: 0 0 15px rgba(var(--os-accent-rgb), 0.3);
}
.news-lang-pane { display: none; }
.news-lang-pane.is-active { display: block; animation: fadeIn 0.4s ease; }

.news-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.news-tool-btn {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(15, 20, 35, 0.6);
    color: var(--os-muted);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.news-tool-btn:hover { border-color: var(--os-accent); color: var(--os-accent); background: rgba(var(--os-accent-rgb), 0.1); }
.news-file-btn input { display: none; }
.news-tool-sep { width: 1px; background: rgba(255,255,255,0.12); align-self: stretch; flex-shrink: 0; }
.news-editor {
    min-height: 320px;
    max-height: 600px;
    overflow-y: auto;
    background: rgba(15, 20, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    color: var(--os-text);
    line-height: 1.7;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}
.news-editor:focus {
    outline: none;
    border-color: var(--os-accent);
    box-shadow: 0 0 0 4px rgba(var(--os-accent-rgb), 0.15);
}

.rich-editor-root {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rich-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.rich-preview-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(var(--os-accent-rgb), 0.08);
    color: var(--os-accent);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
}

.rich-preview-toggle:hover {
    border-color: var(--os-accent);
    background: rgba(var(--os-accent-rgb), 0.14);
}

.rich-toolbar .news-tool-btn {
    min-height: 38px;
}

.rich-editor h1,
.rich-preview h1,
.news-editor h1 {
    margin: 1rem 0 0.55rem;
    color: var(--os-text-strong);
    font-size: 1.55rem;
    font-weight: 700;
}

.rich-editor h2,
.rich-preview h2,
.news-editor h2 {
    margin: 1rem 0 0.5rem;
    color: var(--os-text-strong);
    font-size: 1.35rem;
    font-weight: 700;
}

.rich-editor h3,
.rich-preview h3,
.news-editor h3 {
    margin: 0.85rem 0 0.45rem;
    color: #E2E8F0;
    font-size: 1.1rem;
    font-weight: 650;
}

.rich-editor h4,
.rich-preview h4,
.news-editor h4 {
    margin: 0.75rem 0 0.35rem;
    color: #7ab8d1;
    font-size: 0.95rem;
    font-weight: 650;
    text-transform: none;
}

.rich-editor p,
.rich-preview p,
.news-editor p {
    margin: 0.55rem 0;
}

.rich-editor ul,
.rich-editor ol,
.rich-preview ul,
.rich-preview ol,
.news-editor ul,
.news-editor ol {
    margin: 0.65rem 0;
    padding-left: 1.45rem;
}

.rich-editor ul,
.rich-preview ul,
.news-editor ul {
    list-style: disc;
}

.rich-editor ol,
.rich-preview ol,
.news-editor ol {
    list-style: decimal;
}

.rich-editor blockquote,
.rich-preview blockquote,
.news-editor blockquote {
    margin: 0.8rem 0;
    border-left: 3px solid var(--os-accent);
    border-radius: 0 12px 12px 0;
    background: rgba(var(--os-accent-rgb), 0.07);
    padding: 0.8rem 1rem;
    color: #E2E8F0;
}

.rich-editor img,
.rich-preview img,
.news-editor img {
    display: block;
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: rgba(0,0,0,0.3);
    margin: 0.9rem 0;
}

.rich-editor pre,
.rich-preview pre,
.news-editor pre {
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    background: rgba(0,0,0,0.28);
    padding: 0.9rem;
    color: #E2E8F0;
}

.rich-editor code,
.rich-preview code,
.news-editor code {
    color: #93C5FD;
    font-family: 'JetBrains Mono', monospace;
}

.rich-editor table,
.rich-preview table,
.news-editor table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    overflow: hidden;
}

.rich-editor th,
.rich-editor td,
.rich-preview th,
.rich-preview td,
.news-editor th,
.news-editor td {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.65rem 0.8rem;
    text-align: left;
}

.rich-editor th,
.rich-preview th,
.news-editor th {
    background: rgba(var(--os-accent-rgb), 0.08);
    color: var(--os-text-strong);
    font-size: 0.78rem;
    text-transform: none;
}

.rich-preview {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    background: rgba(8, 9, 13, 0.86);
    padding: 1.2rem;
    color: var(--os-text);
    line-height: 1.7;
}

/* Uploads */
.img-upload-dropzone {
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
}
.img-upload-dropzone:hover {
    border-color: var(--os-accent);
    background: rgba(var(--os-accent-rgb), 0.05);
}
.img-upload-input { display: none; }
.img-upload-thumb { max-height: 200px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.img-upload-progress { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.img-upload-bar { height: 100%; width: 60%; background: var(--os-accent); animation: imgUploadPulse 1.5s ease-in-out infinite; box-shadow: 0 0 10px var(--os-accent); }

@keyframes imgUploadPulse {
    0%, 100% { width: 30%; margin-left: 0; }
    50% { width: 60%; margin-left: 20%; }
}

.img-upload-url {
    width: 100%;
    background: rgba(15, 20, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: var(--os-text);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box !important;
    display: block;
}
.img-upload-url:focus { border-color: var(--os-accent); box-shadow: 0 0 0 4px rgba(var(--os-accent-rgb), 0.15); }

/* Subscription Picker */
.sub-dur-btn {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(15, 20, 35, 0.6);
    color: var(--os-muted);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}
.sub-dur-btn:hover { border-color: var(--os-accent); color: var(--os-accent); }
.sub-dur-active {
    background: rgba(var(--os-accent-rgb), 0.15);
    color: var(--os-accent);
    border-color: var(--os-accent);
    box-shadow: 0 0 15px rgba(var(--os-accent-rgb), 0.2);
}

/* Drawer / Modal Animations */
.drawer-backdrop, .modal-backdrop {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.drawer-content {
    animation: slideLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideLeft {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Mobile Sidebar ===== */
@media (max-width: 767px) {
    #sidebar {
        transform: translateX(-120%);
    }
    #sidebar.mobile-open {
        display: flex !important;
        transform: translateX(0);
    }
}

/* ===== Nav Category Headers ===== */
.nav-category-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0.01em;
    color: #3C4B70;
    user-select: none;
}
.nav-category-label:first-child {
    margin-top: 0;
}
.nav-category-label .cat-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(60,75,112,0.4), transparent);
}

/* ===== Collapsible LEGACY section ===== */
.nav-legacy-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0.01em;
    color: #6B5A3C;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    user-select: none;
}
.nav-legacy-toggle:hover {
    color: #F59E0B;
    background: rgba(245,158,11,0.05);
}
.nav-legacy-toggle .legacy-chevron {
    font-size: 0.6rem;
    transition: transform 0.3s ease;
}
.nav-legacy-toggle.expanded .legacy-chevron {
    transform: rotate(90deg);
}
.nav-legacy-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-legacy-items.expanded {
    max-height: 600px;
}
.nav-legacy-items .nav-item {
    opacity: 0.7;
    font-size: 0.85rem;
    padding-left: 1.75rem;
}
.nav-legacy-items .nav-item:hover {
    opacity: 1;
}
.nav-legacy-items .nav-item.active {
    opacity: 1;
}

/* ===== Dashboard Home Page ===== */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
@media (min-width: 640px) {
    .home-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.25rem;
    }
}
.home-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.home-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}
.home-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(var(--os-accent-rgb),0.3);
    box-shadow: 0 12px 40px rgba(var(--os-accent-rgb),0.1);
}
.home-card .home-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}
.home-card:hover .home-icon {
    transform: scale(1.1);
}
.home-card .home-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--os-text);
    margin-bottom: 0.25rem;
}
.home-card .home-desc {
    font-size: 0.75rem;
    color: var(--os-muted);
    line-height: 1.4;
}
.home-section-title {
    font-size: 0.7rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0.01em;
    color: #3C4B70;
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
}
.home-section-title.legacy-title {
    color: #6B5A3C;
}
.home-card.legacy-card {
    border-color: rgba(245,158,11,0.1);
    opacity: 0.7;
}
.home-card.legacy-card:hover {
    opacity: 1;
    border-color: rgba(245,158,11,0.3);
    box-shadow: 0 12px 40px rgba(245,158,11,0.08);
}

/* ===== Layout polish & overlap fixes ===== */

/* Category labels - icon + text spacing */
.nav-category-label > i,
.nav-legacy-toggle > i:not(.legacy-chevron) {
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

/* Sidebar internals - tighter scroll area */
#sidebar nav#nav-tabs {
    padding: 0.5rem 0.75rem;
    gap: 0;
}

/* Top header - prevent button collision */
header .flex.gap-4 { gap: 0.625rem; }
header h2#page-title {
    font-size: clamp(1rem, 2vw, 1.6rem);
    line-height: 1.2;
}
header button {
    flex-shrink: 0;
}
@media (max-width: 640px) {
    header { padding-left: 0.875rem; padding-right: 0.875rem; }
    header button { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }
    header #export-btn,
    header #add-btn { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* Sidebar bottom - cleaner */
#sidebar > div:last-child { padding: 1.25rem; }

/* Stat-card icon row uses gap from base now; ensure inner flex children don't overflow */
.stat-card .text-lg,
.stat-card .text-xl,
.stat-card .text-2xl {
    line-height: 1.1;
    word-break: break-word;
}

/* Page title truncation safety */
header > div:first-child { min-width: 0; flex: 1; }
header > div:first-child h2 { min-width: 0; }

/* Main content padding - reduce on mobile */
@media (max-width: 768px) {
    main > div.flex-1.overflow-auto { padding: 1rem !important; }
    .stat-card { padding: 0.85rem 0.95rem; border-radius: 12px; }
    .stat-card .text-lg { font-size: 1.05rem; }
}

/* App shell - smaller gutter on mobile */
@media (max-width: 768px) {
    #app-screen { padding: 0.5rem !important; gap: 0.5rem !important; }
    main { border-radius: 1.25rem !important; }
}

/* Fix sidebar mobile slide */
@media (max-width: 767px) {
    #sidebar {
        width: min(85vw, 300px);
        inset: 0.5rem auto 0.5rem 0.5rem;
    }
}

/* Drawer responsive */
@media (max-width: 768px) {
    #modal .drawer-content {
        max-width: 100% !important;
    }
    #modal .px-10 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
    #modal .py-8 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    #modal .p-10 { padding: 1.25rem !important; }
}

/* Home grid: tighter on small */
@media (max-width: 640px) {
    .home-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
    .home-card { padding: 1rem; }
    .home-card .home-icon { width: 40px; height: 40px; margin-bottom: 0.6rem; font-size: 1.05rem; }
    .home-card .home-label { font-size: 0.85rem; }
    .home-card .home-desc { font-size: 0.7rem; }
}

/* Pagination buttons spacing */
#pagination-area { gap: 0.5rem; flex-wrap: wrap; }

/* Form field labels & spacing inside drawer */
#data-form label {
    display: block;
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0.01em;
    color: var(--os-muted);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Auth screen on small screens */
@media (max-width: 480px) {
    #auth-screen { padding: 1rem; box-sizing: border-box; }
    #auth-screen > .auth-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
        padding: 2rem 1.25rem;
    }
    #auth-screen h2 { font-size: 1.5rem; letter-spacing: 0.01em; }
}

/* Toast container mobile */
@media (max-width: 640px) {
    #toast-container { right: 1rem !important; left: 1rem; bottom: 1rem !important; }
}

/* ===== Admin user directory ===== */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--os-accent-rgb), 0.1);
    border: 1px solid rgba(var(--os-accent-rgb), 0.25);
    color: #7dd3fc;
    font-weight: 650;
    font-size: 0.78rem;
    letter-spacing: 0;
}
.user-avatar-lg {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 1rem;
}
.user-cell-name,
.user-editor-name {
    color: var(--os-text-strong);
    font-weight: 650;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-cell-email,
.user-editor-email {
    color: var(--os-accent);
    font-size: 0.82rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-cell-email a,
.user-editor-email a,
.admin-detail-email {
    color: inherit;
    text-decoration: none;
}
.user-cell-email a:hover,
.user-editor-email a:hover,
.admin-detail-email:hover {
    text-decoration: underline;
}
.user-cell-sub,
.user-editor-id {
    color: var(--os-muted-2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    width: fit-content;
    border-radius: 999px;
    padding: 0.34rem 0.58rem;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}
.risk-high {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.38);
    color: #fca5a5;
}
.risk-medium {
    background: rgba(251, 191, 36, 0.13);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fcd34d;
}
.risk-low {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.32);
    color: #7dd3fc;
}
.risk-clear {
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.28);
    color: #86efac;
}
.activity-mini {
    display: grid;
    grid-template-columns: repeat(2, minmax(42px, 1fr));
    gap: 0.4rem;
    min-width: 116px;
}
.activity-mini span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #CBD5E1;
    font-size: 0.78rem;
}
.activity-mini i {
    color: var(--os-muted-2);
    width: 12px;
    text-align: center;
}
.risk-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.risk-filter-group button {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 20, 35, 0.55);
    color: var(--os-muted);
    border-radius: 999px;
    padding: 0.5rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 650;
    transition: all 0.2s ease;
}
.risk-filter-group button:hover,
.risk-filter-group button.active {
    border-color: var(--os-accent);
    color: var(--os-accent);
    background: rgba(var(--os-accent-rgb), 0.1);
}
.category-select {
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 20, 35, 0.72);
    color: #CBD5E1;
    border-radius: 10px;
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    outline: none;
}
.category-select:focus {
    border-color: var(--os-accent);
    box-shadow: 0 0 0 3px rgba(var(--os-accent-rgb), 0.12);
}
.funnel-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 38px;
    border: 1px solid rgba(var(--os-accent-rgb), 0.35);
    color: var(--os-accent);
    background: rgba(var(--os-accent-rgb), 0.08);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 650;
    transition: all 0.2s ease;
}
.funnel-action-btn:hover {
    color: var(--os-bg);
    background: var(--os-accent);
}
.group-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    max-width: 180px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--group-color) 48%, transparent);
    background: color-mix(in srgb, var(--group-color) 15%, transparent);
    color: var(--os-text);
    padding: 0.34rem 0.62rem;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.group-badge-empty {
    color: var(--os-muted);
}
.group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--group-color);
    box-shadow: 0 0 10px color-mix(in srgb, var(--group-color) 55%, transparent);
    flex-shrink: 0;
}
.user-editor-header,
.subscription-user-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}
.user-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.toggle-row {
    display: flex !important;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}
.toggle-row input {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    accent-color: var(--os-accent);
}
.toggle-row strong {
    display: block;
    color: var(--os-text);
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0;
}
.toggle-row em {
    display: block;
    color: var(--os-muted);
    font-style: normal;
    font-size: 0.78rem;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
}
.user-editor-section,
.admin-detail-risk {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.025);
}
.user-editor-section-title {
    color: var(--os-muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-transform: none;
    margin-bottom: 0.75rem;
}
.user-editor-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.user-editor-facts span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    background: rgba(15, 20, 35, 0.65);
    color: var(--os-muted);
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
}
.user-editor-facts strong {
    color: var(--os-text);
}
.risk-reason-list {
    display: grid;
    gap: 0.4rem;
    color: #CBD5E1;
    font-size: 0.82rem;
    line-height: 1.45;
}
.risk-reason-list li {
    list-style: none;
    position: relative;
    padding-left: 1rem;
}
.risk-reason-list li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #F59E0B;
    position: absolute;
    left: 0;
    top: 0.52em;
}
.link-action,
.primary-action,
.secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 650;
    transition: all 0.2s ease;
}
.link-action {
    color: var(--os-accent);
}
.link-action:hover {
    color: var(--os-text);
}
.admin-detail-modal {
    width: min(760px, 100%);
    max-height: min(86vh, 840px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(11, 14, 23, 0.96);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.admin-detail-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-detail-head h3 {
    color: var(--os-text-strong);
    font-weight: 650;
    font-size: 1.05rem;
    line-height: 1.2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-detail-head p {
    color: var(--os-muted-2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    margin-top: 0.2rem;
}
.admin-detail-close {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    color: var(--os-muted);
    background: rgba(255, 255, 255, 0.04);
}
.admin-detail-close:hover {
    color: var(--os-text-strong);
    background: rgba(var(--os-danger-rgb), 0.18);
}
.admin-detail-body {
    overflow-y: auto;
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
}
.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}
.admin-detail-grid div {
    min-width: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    padding: 0.85rem;
}
.admin-detail-grid span {
    display: block;
    color: var(--os-muted-2);
    font-size: 0.72rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0.01em;
    margin-bottom: 0.3rem;
}
.admin-detail-grid strong {
    display: block;
    min-width: 0;
    color: var(--os-text);
    font-size: 0.86rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-detail-grid a {
    color: var(--os-accent);
}
.admin-detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.primary-action {
    background: var(--os-accent);
    color: var(--os-bg);
    padding: 0.75rem 1rem;
}
.secondary-action {
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #CBD5E1;
    padding: 0.75rem 1rem;
}
.secondary-action:hover {
    color: var(--os-text-strong);
    border-color: var(--os-accent);
}
.user-funnel-window {
    width: 100%;
    max-width: none;
    height: min(860px, 82vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(11, 14, 23, 0.98);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}
.user-funnel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}
.user-funnel-head h3 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    color: var(--os-text);
    font-size: 1.05rem;
    font-weight: 700;
}
.user-funnel-head p {
    margin-top: 0.25rem;
    color: var(--os-muted-2);
    font-size: 0.78rem;
}
.user-funnel-body {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.funnel-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--os-accent);
    font-size: 0.8rem;
    font-weight: 650;
    text-transform: none;
}
.user-funnel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.user-funnel-create {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}
.user-funnel-create .input-field {
    width: min(340px, 42vw);
    padding: 0.75rem 1rem;
    font-size: 0.86rem;
    border-radius: 10px;
}
.user-funnel-create input[type="color"] {
    width: 42px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(15, 20, 35, 0.72);
    padding: 4px;
}
.user-funnel-count {
    color: var(--os-muted);
    font-size: 0.78rem;
    font-weight: 650;
    white-space: nowrap;
}
.user-funnel-board {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(340px, 460px);
    gap: 0.9rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 1.35rem 1.35rem;
}
.user-funnel-column {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid var(--group-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.028);
}
.user-funnel-column-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.user-funnel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--os-text);
    font-size: 0.9rem;
    font-weight: 700;
}
.user-funnel-column-head p {
    margin-top: 0.25rem;
    color: var(--os-muted-2);
    font-size: 0.72rem;
}
.user-funnel-column-head strong {
    color: var(--os-accent);
    font-size: 0.86rem;
}
.user-funnel-list {
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.7rem;
    padding: 0.8rem;
}
.user-funnel-empty {
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    color: var(--os-muted-2);
    text-align: center;
    font-size: 0.78rem;
}
.user-funnel-card {
    width: 100%;
    display: grid;
    gap: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(5, 5, 10, 0.48);
    padding: 0.8rem;
}
.user-funnel-card-top {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.user-funnel-card .risk-badge {
    padding: 0.32rem 0.48rem;
}
.user-funnel-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--os-muted-2);
    font-size: 0.72rem;
    font-weight: 650;
}
@media (max-width: 720px) {
    .user-editor-grid,
    .admin-detail-grid {
        grid-template-columns: 1fr;
    }
    .admin-detail-head {
        align-items: flex-start;
    }
    .admin-detail-actions {
        flex-direction: column;
    }
    .primary-action,
    .secondary-action {
        justify-content: center;
        width: 100%;
    }
    .user-funnel-toolbar,
    .user-funnel-create {
        align-items: stretch;
        flex-direction: column;
    }
    .user-funnel-create .input-field {
        width: 100%;
    }
    .user-funnel-board {
        grid-auto-columns: minmax(260px, 86vw);
    }
}

/* ===== Embedded user funnel panel ===== */
#user-funnel-win {
    margin: 0;
}
#user-funnel-win .user-funnel-window {
    box-shadow: 0 0 0 1px rgba(var(--os-accent-rgb),0.1), 0 32px 80px rgba(0,0,0,0.65);
    border-color: rgba(var(--os-accent-rgb),0.12);
}

/* Funnel search field */
.user-funnel-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.user-funnel-search-icon {
    position: absolute;
    left: 0.75rem;
    color: #4B5563;
    font-size: 0.78rem;
    pointer-events: none;
}
.user-funnel-search-input {
    background: rgba(15, 20, 35, 0.6);
    border: 1px solid rgba(255,255,255,0.1);
    color: #CBD5E1;
    border-radius: 10px;
    padding: 0.55rem 0.9rem 0.55rem 2.1rem;
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
    width: 200px;
    transition: border-color 0.2s, width 0.3s;
}
.user-funnel-search-input:focus {
    border-color: var(--os-accent);
    box-shadow: 0 0 0 3px rgba(var(--os-accent-rgb), 0.1);
    width: 260px;
}
.user-funnel-search-input::placeholder { color: #4B5563; }

/* Funnel column count badge */
.user-funnel-col-count {
    color: var(--os-accent);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    background: rgba(var(--os-accent-rgb),0.08);
    border: 1px solid rgba(var(--os-accent-rgb),0.2);
    border-radius: 8px;
    padding: 0.2rem 0.6rem;
    flex-shrink: 0;
}

/* Ungrouped warning badge */
.funnel-col-badge-warn {
    font-size: 0.75rem;
    opacity: 0.75;
    margin-left: 0.2rem;
}

/* "По группе" sort toggle active state */
.funnel-action-btn.sort-group-active {
    background: rgba(var(--os-accent-rgb), 0.18);
    border-color: var(--os-accent);
    color: var(--os-text-strong);
    box-shadow: 0 0 12px rgba(var(--os-accent-rgb),0.25);
}

/* Drag and Drop Trello-like Funnel */
.user-funnel-card {
    cursor: grab;
}
.user-funnel-card:active {
    cursor: grabbing;
}
.user-funnel-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    background: rgba(15, 20, 35, 0.8);
    border: 1px dashed rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 0 0 1px rgba(var(--os-accent-rgb),0.3);
}
.user-funnel-column {
    transition: background-color 0.2s, box-shadow 0.2s;
}
.user-funnel-column.drag-over {
    background-color: rgba(var(--os-accent-rgb), 0.03);
    box-shadow: inset 0 0 0 2px rgba(var(--os-accent-rgb), 0.5);
    border-radius: 12px;
}

/* ===== Funnel column header improvements ===== */
.user-funnel-column-head {
    align-items: center;
    cursor: default;
    user-select: none;
}
.funnel-drag-handle {
    color: #4B5563;
    cursor: grab;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s;
    flex-shrink: 0;
}
.funnel-drag-handle:hover { color: var(--os-accent); }
.funnel-drag-handle.is-locked { cursor: not-allowed; opacity: 0.4; }
.funnel-drag-handle:active { cursor: grabbing; }

.funnel-col-title-wrap { min-width: 0; flex: 1; }
.funnel-col-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.funnel-col-desc {
    margin-top: 0.2rem;
    color: var(--os-muted-2);
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funnel-col-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    position: relative;
}
.funnel-col-icon-btn {
    width: 28px; height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--os-muted-2);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-size: 0.78rem;
    padding: 0;
}
.funnel-col-icon-btn:hover {
    color: var(--os-text-strong);
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
}

/* Column action menu (popover) */
.funnel-col-menu-wrap { position: relative; }
.funnel-col-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    z-index: 50;
    min-width: 200px;
    background: rgba(10, 12, 20, 0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.55);
    padding: 0.35rem;
    backdrop-filter: blur(12px);
}
.funnel-col-menu.open { display: block; }
.funnel-col-menu button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: #CBD5E1;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    transition: background 0.12s, color 0.12s;
}
.funnel-col-menu button i { width: 14px; color: var(--os-accent); }
.funnel-col-menu button:hover { background: rgba(var(--os-accent-rgb),0.08); color: var(--os-text-strong); }
.funnel-col-menu .funnel-menu-danger { color: #fca5a5; }
.funnel-col-menu .funnel-menu-danger i { color: #fca5a5; }
.funnel-col-menu .funnel-menu-danger:hover { background: rgba(var(--os-danger-rgb),0.12); color: var(--os-text-strong); }
.funnel-col-menu hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 0.25rem 0.2rem;
}

/* Column conversion progress bar */
.funnel-col-progress {
    height: 3px;
    background: rgba(255,255,255,0.04);
    overflow: hidden;
    margin: 0;
}
.funnel-col-progress-bar {
    height: 100%;
    background: var(--group-color);
    box-shadow: 0 0 8px var(--group-color);
    transition: width 0.3s;
}

/* Inline group editor */
.funnel-col-editor {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(var(--os-accent-rgb),0.03);
}
.funnel-editor-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
}
.funnel-editor-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--os-muted);
    text-transform: none;
    font-weight: 650;
    letter-spacing: 0.01em;
}
.funnel-editor-form .input-field {
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    border-radius: 8px;
}
.funnel-editor-form input[type="color"] {
    width: 44px;
    height: 38px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: rgba(15,20,35,0.72);
    padding: 3px;
    cursor: pointer;
}
.funnel-editor-full { grid-column: 1 / -1; }
.funnel-editor-presets {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.funnel-color-preset {
    width: 22px; height: 22px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.15);
    cursor: pointer;
    padding: 0;
    transition: transform 0.12s, border-color 0.12s;
}
.funnel-color-preset:hover {
    transform: scale(1.15);
    border-color: var(--os-text-strong);
}
.funnel-editor-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.funnel-editor-actions .primary-action,
.funnel-editor-actions .secondary-action {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
}

/* Per-column toolbar (sort + mini stats) */
.funnel-col-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    background: rgba(255,255,255,0.015);
}
.funnel-col-sort {
    background: rgba(15,20,35,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    color: #CBD5E1;
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
    outline: none;
    cursor: pointer;
}
.funnel-col-sort:focus { border-color: var(--os-accent); }
.funnel-col-mini-stats {
    display: flex;
    gap: 0.55rem;
    font-size: 0.7rem;
    color: var(--os-muted-2);
    font-weight: 700;
}
.funnel-col-mini-stats i { margin-right: 0.2rem; opacity: 0.6; }
.funnel-col-mini-stats span { white-space: nowrap; }

/* Card footer (select + quick actions) */
.funnel-card-footer {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.funnel-card-select { flex: 1; min-width: 0; }
.funnel-card-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--os-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.funnel-card-icon:hover {
    background: rgba(var(--os-accent-rgb),0.1);
    color: var(--os-accent);
    border-color: rgba(var(--os-accent-rgb),0.3);
}
.funnel-card-id { cursor: pointer; }
.funnel-card-id:hover .user-cell-name { color: var(--os-accent); }
.funnel-plan-pill {
    color: var(--p, var(--os-muted-2));
    background: color-mix(in srgb, var(--p, var(--os-muted-2)) 12%, transparent);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0.04em;
}

/* Toolbar stats separator */
.funnel-stat-sep { color: #334155; margin: 0 0.15rem; }
.user-funnel-count {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.user-funnel-count i { opacity: 0.6; margin-right: 0.15rem; }

/* Funnel toolbar action button (expand all etc.) */
.funnel-action-btn {
    background: rgba(15,20,35,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--os-muted);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.funnel-action-btn:hover {
    color: var(--os-accent);
    border-color: rgba(var(--os-accent-rgb),0.3);
    background: rgba(var(--os-accent-rgb),0.05);
}

/* ===== Collapsed columns ===== */
.user-funnel-column.is-collapsed {
    grid-row: span 1;
    width: 56px;
    min-width: 56px;
}
.user-funnel-column.is-collapsed .funnel-col-title-wrap,
.user-funnel-column.is-collapsed .funnel-col-progress,
.user-funnel-column.is-collapsed .funnel-col-toolbar,
.user-funnel-column.is-collapsed .user-funnel-list,
.user-funnel-column.is-collapsed .funnel-col-editor,
.user-funnel-column.is-collapsed .funnel-col-menu-wrap,
.user-funnel-column.is-collapsed .funnel-drag-handle {
    display: none !important;
}
.user-funnel-column.is-collapsed .user-funnel-column-head {
    flex-direction: column;
    height: 100%;
    gap: 0.5rem;
    padding: 0.6rem 0.3rem;
    align-items: center;
}
.user-funnel-column.is-collapsed .funnel-col-actions {
    flex-direction: column;
    gap: 0.4rem;
}

/* Need column to span full board height even when collapsed */
.user-funnel-board { align-items: stretch; }

/* ===== Column reorder drop indicators ===== */
.user-funnel-column.column-dragging {
    opacity: 0.55;
    transform: scale(0.98);
}
.user-funnel-column.column-drop-before {
    box-shadow: inset 4px 0 0 var(--os-accent);
}
.user-funnel-column.column-drop-after {
    box-shadow: inset -4px 0 0 var(--os-accent);
}

/* Search-hit highlight */
.user-funnel-column.has-search-hits {
    border-color: rgba(var(--os-accent-rgb),0.3);
}

/* ===== FRONTLINE.OS admin redesign ===== */
/* v3 readability palette: lifted graphite surfaces (no pure black),
   softened ink (peak contrast ~13:1 instead of 19:1), calm statuses.
   Keep --os-accent in sync with ADMIN_OS_COLORS in admin-panel.js. */
:root {
    --os-bg: #14171e;
    --os-bg-2: #171a22;
    --os-sidebar: #191d26;
    --os-panel: #1d222c;
    --os-panel-2: #181c25;
    --os-panel-3: #242a36;
    --os-border: rgba(151, 168, 195, 0.14);
    --os-border-strong: rgba(151, 168, 195, 0.26);
    --os-hairline: rgba(151, 168, 195, 0.09);
    --os-text: #e7ebf2;
    --os-text-strong: #f3f5f9;
    --os-muted: #a7b1c2;
    --os-muted-2: #7f8ba0;
    --os-accent: #7ab8d1;
    --os-accent-rgb: 122, 184, 209;
    --os-accent-hover: #9bd0e2;
    --os-accent-ink: #10151c;
    --os-accent-soft: rgba(122, 184, 209, 0.12);
    --os-accent-border: rgba(122, 184, 209, 0.32);
    --os-brand: #f28a4b;
    --os-brand-soft: rgba(242, 138, 75, 0.12);
    --os-brand-border: rgba(242, 138, 75, 0.26);
    --os-danger: #ef617a;
    --os-danger-rgb: 239, 97, 122;
    --os-success: #43c78e;
    --os-info: #5fc6dc;
    --os-warning: #e9b95f;
    --os-radius: 12px;
    --os-radius-sm: 8px;
    --os-shadow: 0 16px 40px rgba(9, 11, 16, 0.32);
    --os-font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --os-font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
}

html,
body.admin-os-body {
    background: var(--os-bg);
    color: var(--os-text);
}

body.admin-os-body {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 30%),
        var(--os-bg);
}

.auth-card,
.os-panel,
.tactical-panel,
.modal-content,
.admin-table-panel {
    background: var(--os-panel);
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    box-shadow: none;
    backdrop-filter: none;
}

.auth-card {
    background: var(--os-panel-2);
    box-shadow: var(--os-shadow);
    box-sizing: border-box;
    max-width: min(32rem, calc(100vw - 2rem));
}

#auth-subtext {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.admin-auth-title {
    margin: 0 0 0.75rem;
    color: var(--os-text-strong);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    line-height: 1.2;
    text-transform: uppercase;
}

.admin-auth-subtitle {
    max-width: 29rem;
    margin: 0;
    color: var(--os-muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

.admin-auth-content {
    width: 100%;
    margin-top: 1.6rem;
}

.admin-auth-form {
    display: grid;
    gap: 0.7rem;
    width: 100%;
    text-align: left;
}

.admin-auth-form label {
    margin-top: 0.25rem;
    color: var(--os-muted);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-auth-form input {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius-sm);
    outline: none;
    background: var(--os-bg);
    color: var(--os-text-strong);
    padding: 0.75rem 0.9rem;
    font: 500 0.94rem/1.2 var(--os-font-sans);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.admin-auth-form input:focus-visible {
    border-color: var(--os-accent);
    box-shadow: 0 0 0 3px var(--os-accent-soft);
}

.admin-auth-form .admin-auth-otp {
    text-align: center;
    font-family: var(--os-font-mono);
    font-size: 1.45rem;
    font-weight: 750;
    letter-spacing: 0.38em;
    padding-left: 1.28rem;
}

.admin-auth-primary,
.admin-auth-secondary {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: var(--os-radius-sm);
    padding: 0.75rem 1rem;
    cursor: pointer;
    font: 750 0.78rem/1 var(--os-font-sans);
    letter-spacing: 0.07em;
    text-decoration: none;
    text-transform: uppercase;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease, opacity 120ms ease;
}

.admin-auth-primary {
    margin-top: 0.55rem;
    border: 1px solid var(--os-accent);
    background: var(--os-accent);
    color: var(--os-bg);
}

.admin-auth-primary:hover:not(:disabled),
.admin-auth-primary:focus-visible {
    border-color: var(--os-text-strong);
    background: var(--os-text-strong);
}

.admin-auth-secondary {
    border: 1px solid var(--os-border);
    background: transparent;
    color: var(--os-muted);
}

.admin-auth-secondary:hover:not(:disabled),
.admin-auth-secondary:focus-visible {
    border-color: var(--os-muted);
    color: var(--os-text-strong);
}

.admin-auth-primary:disabled,
.admin-auth-secondary:disabled {
    cursor: wait;
    opacity: 0.58;
}

.admin-auth-link {
    width: 100%;
    box-sizing: border-box;
}

.admin-auth-note {
    margin: 1rem 0 0;
    color: var(--os-muted);
    font-size: 0.73rem;
    line-height: 1.45;
}

.admin-auth-error {
    display: none;
    width: 100%;
    margin: 1rem 0 0;
    box-sizing: border-box;
    border: 1px solid rgba(var(--os-danger-rgb), 0.32);
    border-radius: var(--os-radius-sm);
    background: rgba(var(--os-danger-rgb), 0.08);
    color: var(--os-danger);
    padding: 0.72rem 0.85rem;
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: left;
}

.admin-auth-error.is-visible {
    display: block;
}

.admin-auth-actions {
    display: grid;
    gap: 0.7rem;
}

.admin-auth-loader {
    margin: 0 auto;
    width: 46px;
    height: 46px;
    border-width: 3px;
}

.admin-auth-qr {
    display: grid;
    min-height: 216px;
    place-items: center;
}

.admin-auth-qr img {
    display: block;
    width: 216px;
    height: 216px;
    max-width: 100%;
    border-radius: var(--os-radius-sm);
    background: #fff;
    padding: 8px;
    box-sizing: border-box;
}

.admin-auth-secret-wrap {
    display: grid;
    gap: 0.45rem;
    margin: 1rem 0 1.2rem;
    color: var(--os-muted);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
}

.admin-auth-secret-wrap code {
    overflow-wrap: anywhere;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius-sm);
    background: var(--os-bg);
    color: var(--os-text-strong);
    padding: 0.7rem;
    font: 650 0.76rem/1.45 var(--os-font-mono);
    letter-spacing: 0.07em;
    text-transform: none;
}

.auth-mark,
.admin-brand-mark {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: var(--os-brand);
    color: var(--os-text-strong);
    box-shadow: 0 16px 36px rgba(242, 138, 75, 0.18);
}

.auth-mark {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
}

.admin-os-shell {
    background: var(--os-bg);
}

#app-screen.admin-os-shell.flex {
    display: flex;
}

.admin-sidebar {
    width: 324px;
    min-width: 324px;
    height: 100%;
    inset: 0 auto 0 0;
    background: var(--os-sidebar);
    border-right: 1px solid var(--os-border);
    border-radius: 0;
    box-shadow: none;
}

.admin-brand {
    height: 96px;
    gap: 14px;
    border-bottom: 1px solid var(--os-border);
}

.admin-brand-title {
    color: var(--os-text);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0;
}

#sidebar nav#nav-tabs {
    gap: 0.35rem;
    padding: 0.75rem 0.7rem 1rem;
}

.nav-section {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.35rem;
    border: 1px solid transparent;
    border-radius: var(--os-radius);
    transition: background 0.18s ease, border-color 0.18s ease;
}

.nav-section.is-current {
    border-color: var(--os-border);
    background: rgba(255, 255, 255, 0.022);
}

.nav-category-label,
.nav-legacy-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 36px;
    margin: 0;
    padding: 0.25rem 0.45rem;
    color: #8d96a8;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-transform: none;
}

.nav-category-icon {
    display: inline-grid;
    flex: 0 0 26px;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--os-border);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.025);
    color: #707a8e;
    font-size: 0.7rem;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.nav-section.is-current .nav-category-icon {
    border-color: var(--os-accent-border);
    background: var(--os-accent-soft);
    color: var(--os-accent-hover);
}

.nav-category-title {
    min-width: 0;
    overflow-wrap: anywhere;
}

.nav-category-count {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    padding: 0 0.35rem;
    border: 1px solid var(--os-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    color: #778195;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0;
}

.nav-category-items {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.nav-item {
    position: relative;
    min-height: 58px;
    margin: 0;
    padding: 0.48rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 9px;
    appearance: none;
    cursor: pointer;
    color: #a9b1c3;
    font: inherit;
    letter-spacing: 0;
    isolation: isolate;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.nav-item::before {
    content: '';
    position: absolute;
    z-index: 1;
    top: 50%;
    left: -1px;
    width: 3px;
    height: 28px;
    border-radius: 0 999px 999px 0;
    background: var(--os-accent);
    opacity: 0;
    transform: translateY(-50%) scaleY(0.45);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.nav-item-icon {
    display: inline-grid;
    flex: 0 0 36px !important;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--os-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    color: #8d97aa;
    font-size: 0.9rem;
    overflow: visible !important;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.nav-item:hover {
    border-color: rgba(255, 255, 255, 0.075);
    background: rgba(255, 255, 255, 0.04);
    color: var(--os-text);
}

.nav-item:hover .nav-item-icon {
    border-color: var(--os-border-strong);
    background: rgba(255, 255, 255, 0.055);
    color: var(--os-text);
}

.nav-item:focus-visible {
    outline: none;
    border-color: var(--os-accent);
    box-shadow: 0 0 0 2px rgba(122, 184, 209, 0.2);
}

.nav-item:active {
    background: rgba(255, 255, 255, 0.065);
}

.nav-item.active {
    border-color: var(--os-accent-border);
    background: linear-gradient(100deg, rgba(122, 184, 209, 0.15), rgba(122, 184, 209, 0.055));
    color: var(--os-text);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.nav-item.active::before {
    opacity: 1;
    transform: translateY(-50%) scaleY(1);
}

.nav-item.active .nav-item-icon {
    border-color: var(--os-accent-border);
    background: var(--os-accent-soft);
    color: var(--os-accent-hover);
}

.nav-item-arrow {
    display: inline-grid;
    flex: 0 0 20px !important;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-left: 0.1rem;
    color: #596276;
    font-size: 0.64rem;
    overflow: visible !important;
    transition: color 0.16s ease, transform 0.16s ease;
}

.nav-item:hover .nav-item-arrow,
.nav-item.active .nav-item-arrow {
    color: var(--os-accent);
}

.nav-item:hover .nav-item-arrow {
    transform: translateX(2px);
}

.nav-badge {
    flex: 0 0 auto !important;
    min-width: 24px;
    height: 24px;
    margin-left: 0.2rem;
    overflow: visible !important;
    border-radius: 999px;
    background: var(--os-brand-soft);
    border: 1px solid var(--os-brand-border);
    color: var(--os-text-strong);
    box-shadow: none;
}

.nav-legacy-items .nav-item {
    padding-left: 0.55rem;
    opacity: 0.64;
}

.nav-legacy-toggle {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    text-align: left;
}

.nav-legacy-toggle:hover {
    border-color: rgba(245, 181, 68, 0.16);
    background: rgba(245, 181, 68, 0.045);
}

.nav-legacy-toggle:focus-visible {
    outline: none;
    border-color: var(--os-warning);
    box-shadow: 0 0 0 2px rgba(245, 181, 68, 0.16);
}

.nav-legacy-toggle .legacy-chevron {
    flex: 0 0 10px;
    color: #756b5c;
    font-size: 0.6rem;
}

.admin-user-dock {
    padding: 20px;
    background: var(--os-bg-2);
    border-top: 1px solid var(--os-border);
}

.admin-user-avatar {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: #232735;
    border: 1px solid var(--os-border-strong);
    color: var(--os-text-strong);
    font-weight: 700;
}

.admin-user-online {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid var(--os-bg-2);
    background: var(--os-success);
}

.admin-logout-btn,
.admin-action-btn,
.admin-icon-btn {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid var(--os-border);
    background: rgba(255, 255, 255, 0.035);
    color: var(--os-muted);
}

.admin-logout-btn:hover,
.admin-action-btn:hover,
.admin-icon-btn:hover {
    border-color: var(--os-border-strong);
    background: rgba(255, 255, 255, 0.065);
    color: var(--os-text-strong);
}

.admin-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    transition: all 0.16s ease;
}

.admin-icon-btn.hidden {
    display: none !important;
}

@media (min-width: 640px) {
    .admin-icon-btn.sm\:hidden {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .admin-icon-btn.md\:hidden {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .admin-icon-btn.lg\:hidden {
        display: none !important;
    }
}

.admin-primary-btn {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--os-accent);
    color: var(--os-bg-2);
    padding: 0.68rem 1.1rem;
    box-shadow: 0 13px 30px rgba(122, 184, 209, 0.16);
}

.admin-primary-btn:hover {
    background: var(--os-accent-hover);
    color: #060608;
}

.admin-main-shell {
    background: var(--os-bg);
}

.admin-topbar {
    min-height: 46px;
    padding: 0 1.35rem;
    background: var(--os-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.admin-title-stack {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
}

.admin-kicker {
    color: var(--os-muted-2);
    font-size: 0.72rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0.01em;
}

#page-title {
    color: var(--os-text);
    font-size: 1rem;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.admin-status-strip {
    align-items: center;
    gap: 1rem;
    margin-left: 1.25rem;
    padding-left: 1.25rem;
    border-left: 1px solid var(--os-border);
    color: var(--os-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.admin-status-strip span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.admin-status-strip .is-hot {
    color: var(--os-text-strong);
}

.admin-status-strip .is-hot i {
    color: var(--os-accent);
}

.admin-workspace {
    padding: 2rem 2.5rem;
    background: radial-gradient(900px 420px at 75% 18%, rgba(122, 184, 209, 0.025), transparent 64%), var(--os-bg);
}

.admin-content-wrap {
    max-width: none !important;
    margin: 0 !important;
}

.admin-toolbar-slot:empty {
    display: none;
}

.admin-toolbar-slot > .flex {
    margin: 0 0 0.85rem !important;
    padding: 0.85rem;
    background: var(--os-panel);
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
}

.admin-toolbar-slot .relative.flex-1 {
    max-width: none !important;
}

.stat-card,
.home-card,
.admin-detail-modal,
.user-editor-section,
.subscription-user-card,
.user-editor-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018));
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    box-shadow: none;
    backdrop-filter: none;
}

#user-detail-modal.modal-backdrop {
    background: rgba(0, 0, 0, 0.68);
}

.admin-detail-modal {
    background: linear-gradient(180deg, var(--os-panel), var(--os-panel-2));
    box-shadow: var(--os-shadow);
}

.stat-card {
    min-height: 78px;
    padding: 0.95rem 1rem;
    gap: 0.32rem;
}

.stat-card::before,
.home-card::before {
    display: none;
}

.stat-card:hover,
.home-card:hover {
    transform: none;
    border-color: var(--os-accent-border) !important;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22) !important;
}

.home-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.admin-command-center {
    display: grid;
    gap: 1rem;
}

.command-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    gap: 1.25rem;
    align-items: end;
    padding: 1.45rem;
    background:
        radial-gradient(620px 180px at 20% 0%, rgba(122, 184, 209, 0.1), transparent 70%),
        var(--os-panel);
}

.command-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--os-accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
    margin-bottom: 0.75rem;
}

.command-hero h3 {
    color: var(--os-text-strong);
    font-size: clamp(1.7rem, 3vw, 2.55rem);
    line-height: 1;
    font-weight: 950;
    letter-spacing: 0;
    margin: 0 0 0.65rem;
}

.command-hero p {
    color: var(--os-muted);
    font-size: 1rem;
    line-height: 1.55;
    margin: 0;
    max-width: 780px;
}

.command-search {
    position: relative;
}

.command-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--os-accent);
}

.command-search input {
    width: 100%;
    min-height: 54px;
    padding: 0 1rem 0 2.8rem;
    font-size: 0.96rem;
    font-weight: 700;
}

.command-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.command-kpis .stat-card {
    text-align: left;
    cursor: pointer;
}

.command-kpis .stat-card span,
.stat-card span {
    display: block;
    color: var(--os-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
}

.command-kpis .stat-card strong {
    display: block;
    color: var(--os-text-strong);
    font-size: 1.45rem;
    line-height: 1.05;
    margin-top: 0.35rem;
}

.command-kpis .stat-card em {
    display: block;
    color: #747d91;
    font-style: normal;
    font-size: 0.78rem;
    margin-top: 0.4rem;
}

.command-tools {
    display: grid;
    gap: 1.35rem;
}

.command-section {
    display: grid;
    gap: 0.75rem;
}

.home-card {
    min-height: 154px;
    padding: 1.05rem;
    text-align: left;
    appearance: none;
}

.home-card .home-icon {
    width: 42px;
    height: 42px;
    border-radius: 9px;
    background: var(--os-accent-soft) !important;
    border-color: var(--os-accent-border) !important;
    color: var(--os-accent) !important;
}

.home-card .home-label {
    color: var(--os-text-strong);
    font-size: 0.96rem;
}

.home-card .home-desc {
    color: var(--os-muted);
}

.home-section-title {
    color: var(--os-muted);
    letter-spacing: 0.01em;
}

.home-section-title.legacy-title,
.nav-legacy-toggle {
    color: #8a7662;
}

.home-card.legacy-card {
    border-color: rgba(255, 255, 255, 0.05);
    opacity: 0.65;
}

.admin-table-panel {
    min-height: 300px;
    border-radius: var(--os-radius);
    background: var(--os-panel);
}

.admin-table-scroll {
    overflow: auto;
}

#admin-data-table {
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
    padding: 0;
}

table {
    border-spacing: 0;
    padding: 0;
}

.admin-table-panel thead {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--os-panel-3) !important;
}

.admin-table-panel th {
    color: #8f98aa;
    padding: 0.78rem 0.95rem;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--os-border);
}

.admin-table-panel td {
    padding: 0.72rem 0.95rem;
    color: #d9dde6;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.admin-table-panel tbody tr {
    background: transparent;
    border-radius: 0;
}

.admin-table-panel tbody tr:hover {
    background: rgba(122, 184, 209, 0.045);
    box-shadow: none;
}

.admin-table-panel.has-sticky-actions th:last-child,
.admin-table-panel.has-sticky-actions td:last-child {
    position: sticky;
    right: 0;
    z-index: 4;
    background: var(--os-panel);
    box-shadow: -1px 0 0 rgba(255, 255, 255, 0.055);
}

.admin-table-panel.has-sticky-actions thead th:last-child {
    z-index: 6;
    background: var(--os-panel-3);
}

.admin-table-panel tbody tr td:first-child,
.admin-table-panel tbody tr td:last-child {
    border-radius: 0;
}

#empty-state {
    color: var(--os-muted);
}

#empty-state i {
    color: var(--os-accent) !important;
}

.input-field,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
input[type="email"],
textarea,
select,
.category-select,
.funnel-col-sort {
    border-radius: 8px !important;
    border-color: var(--os-border) !important;
    background: rgba(8, 9, 13, 0.86) !important;
    color: var(--os-text) !important;
    box-shadow: none !important;
}

.input-field:focus,
input:focus,
textarea:focus,
select:focus,
.category-select:focus {
    outline: none !important;
    border-color: var(--os-accent) !important;
    box-shadow: 0 0 0 3px rgba(122, 184, 209, 0.16) !important;
}

.risk-filter-group button,
.funnel-action-btn,
.news-lang-tab,
.news-tool-btn,
.sub-dur-btn {
    border-radius: 8px;
    border-color: var(--os-border);
    background: rgba(255, 255, 255, 0.035);
    color: var(--os-muted);
}

.risk-filter-group button:hover,
.risk-filter-group button.active,
.funnel-action-btn:hover,
.funnel-action-btn.sort-group-active,
.news-lang-tab:hover,
.news-lang-tab.is-active,
.news-tool-btn:hover,
.sub-dur-btn:hover,
.sub-dur-active {
    border-color: var(--os-accent-border);
    background: var(--os-accent-soft);
    color: var(--os-accent);
    box-shadow: none;
}

.news-editor,
.rich-preview,
.img-upload-url,
.img-upload-dropzone {
    border-radius: var(--os-radius);
    border-color: var(--os-border);
    background: rgba(8, 9, 13, 0.86);
}

.rich-preview-toggle {
    border-color: var(--os-accent-border);
    background: var(--os-accent-soft);
    color: var(--os-accent);
}

.img-upload-dropzone:hover,
.img-upload-dragover {
    border-color: var(--os-accent) !important;
    background: var(--os-accent-soft) !important;
}

.img-upload-bar,
.loader {
    border-top-color: var(--os-accent) !important;
}

.loader {
    border-color: rgba(255, 255, 255, 0.12);
    border-top-color: var(--os-accent);
}

.drop-shadow-glow {
    filter: drop-shadow(0 0 12px rgba(122, 184, 209, 0.28));
}

.user-avatar,
.risk-filter-group button.active,
.category-select:focus {
    border-color: var(--os-accent-border);
}

.user-avatar,
.user-cell-email,
.admin-detail-email,
a.text-accent,
.text-accent,
.funnel-col-menu button i,
.funnel-card-id:hover .user-cell-name {
    color: var(--os-accent) !important;
}

.bg-accent {
    background-color: var(--os-accent) !important;
}

.border-accent {
    border-color: var(--os-accent) !important;
}

.hover\:border-accent:hover {
    border-color: var(--os-accent) !important;
}

.hover\:text-accent:hover {
    color: var(--os-accent) !important;
}

.text-bg {
    color: var(--os-bg-2) !important;
}

input:checked + div {
    background-color: var(--os-accent);
    box-shadow: none;
}

.drawer-backdrop,
.modal-backdrop {
    animation: fadeIn 0.16s ease;
}

.os-drawer {
    background: var(--os-sidebar);
    border-left: 1px solid var(--os-border);
    box-shadow: -28px 0 60px rgba(0, 0, 0, 0.48);
}

.drawer-head,
.drawer-foot {
    background: var(--os-bg-2);
    border-color: var(--os-border);
}

.drawer-head {
    border-bottom: 1px solid var(--os-border);
}

.drawer-foot {
    border-top: 1px solid var(--os-border);
}

.drawer-body {
    background: #10131a;
}

.os-confirm {
    background: var(--os-sidebar);
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    box-shadow: var(--os-shadow);
}

.toast {
    background: var(--os-bg-2) !important;
    border-color: var(--os-border) !important;
    border-radius: 10px !important;
    box-shadow: var(--os-shadow) !important;
}

#pagination-area button {
    border-radius: 8px !important;
}

#pagination-area .bg-accent {
    color: var(--os-bg-2) !important;
}

.tactical-panel {
    background: var(--os-panel);
    border-color: var(--os-border);
    border-radius: var(--os-radius);
}

.group-badge {
    border-radius: 999px;
}

.funnel-col-menu button:hover,
.funnel-card-icon:hover,
.funnel-action-btn:hover {
    background: var(--os-accent-soft);
    color: var(--os-accent);
    border-color: var(--os-accent-border);
}

.user-funnel-column.has-search-hits,
.user-funnel-column.column-drop-before,
.user-funnel-column.column-drop-after {
    border-color: var(--os-accent-border);
    box-shadow: inset 0 0 0 1px rgba(122, 184, 209, 0.12);
}

@media (max-width: 1024px) {
    .admin-sidebar {
        width: 300px;
        min-width: 300px;
    }
    .admin-workspace {
        padding: 1.5rem;
    }
    .command-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .command-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    #sidebar.admin-sidebar {
        width: min(88vw, 320px);
        min-width: 0;
        inset: 0;
        transform: translateX(-105%);
    }
    #sidebar.admin-sidebar.mobile-open {
        display: flex !important;
        transform: translateX(0);
    }
    .admin-topbar {
        min-height: 62px;
        padding: 0 0.75rem;
    }
    .admin-workspace {
        padding: 1rem;
    }
    .command-hero {
        padding: 1.1rem;
        gap: 1rem;
    }
    .command-hero h3 {
        font-size: 1.85rem;
        line-height: 1.05;
    }
    .command-hero p {
        font-size: 0.94rem;
    }
    .command-search input {
        min-height: 48px;
        font-size: 0.86rem;
    }
    .command-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .command-kpis .stat-card strong {
        font-size: 1.25rem;
    }
    .admin-title-stack {
        display: block;
    }
    .admin-kicker {
        display: none;
    }
    #page-title {
        font-size: 1rem;
    }
    .admin-primary-btn,
    .admin-action-btn {
        min-height: 40px;
        padding: 0.55rem 0.75rem;
    }
    .home-grid {
        grid-template-columns: 1fr;
    }
    .admin-table-panel.has-sticky-actions th:last-child,
    .admin-table-panel.has-sticky-actions td:last-child {
        position: static;
        box-shadow: none;
    }
}

/* ===== Data workspace menu ===== */
.nav-item > .nav-item-copy {
    display: grid;
    flex: 1 1 auto;
    gap: 0.15rem;
    min-width: 0;
    white-space: normal;
    overflow: hidden;
}

.nav-item-title {
    display: block;
    min-width: 0;
    color: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
}

.nav-item-desc {
    display: block;
    color: var(--os-muted);
    font-size: 0.71rem;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: normal;
}

.nav-item:hover .nav-item-desc,
.nav-item.active .nav-item-desc {
    color: #b4bdcc;
}

.command-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.workflow-rail,
.pinned-tools,
.module-section,
.data-workspace-head,
.data-filter-row {
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    background: var(--os-panel);
}

.workflow-rail {
    display: grid;
    gap: 0.65rem;
    padding: 0.9rem;
    position: sticky;
    top: 1rem;
}

.workflow-rail-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.25rem 0.2rem 0.55rem;
    border-bottom: 1px solid var(--os-border);
}

.workflow-rail-head span {
    color: var(--os-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.workflow-rail-head strong {
    color: var(--os-accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.workflow-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 0.75rem;
    width: 100%;
    padding: 0.78rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--os-text);
    text-align: left;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.workflow-item:hover,
.workflow-item:focus-visible {
    border-color: var(--os-accent-border);
    background: var(--os-accent-soft);
    outline: none;
}

.workflow-icon,
.module-row-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--os-accent-soft);
    color: var(--os-accent);
    flex-shrink: 0;
}

.workflow-copy {
    display: grid;
    gap: 0.28rem;
    min-width: 0;
}

.workflow-copy strong {
    color: var(--os-text-strong);
    font-size: 0.92rem;
    line-height: 1.15;
}

.workflow-copy small {
    color: var(--os-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.workflow-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.workflow-tags em {
    color: #aeb6c8;
    background: rgba(255, 255, 255, 0.055);
    border-radius: 999px;
    padding: 0.12rem 0.42rem;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 650;
}

.command-main,
.module-directory {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.pinned-tools,
.module-section {
    padding: 1rem;
}

.module-section-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.module-section-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--os-text-strong);
    font-size: 0.86rem;
    font-weight: 950;
    line-height: 1.2;
    letter-spacing: 0;
}

.module-section-title i {
    color: var(--os-accent);
}

.module-section-head p {
    color: var(--os-muted);
    margin: 0.32rem 0 0;
    font-size: 0.8rem;
    line-height: 1.35;
}

.module-section-head > span {
    color: #7a8498;
    border: 1px solid var(--os-border);
    border-radius: 999px;
    padding: 0.22rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.module-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.module-list.is-pinned {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 72px;
    width: 100%;
    padding: 0.72rem;
    border: 1px solid var(--os-border);
    border-radius: 10px;
    background: rgba(8, 9, 13, 0.42);
    color: var(--os-text);
    text-align: left;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.module-row:hover,
.module-row:focus-visible,
.module-row.is-active {
    border-color: var(--os-accent-border);
    background: rgba(122, 184, 209, 0.08);
    outline: none;
}

.module-row.is-compact {
    grid-template-columns: 38px minmax(0, 1fr) auto;
}

.module-row.is-compact .module-row-meta {
    display: none;
}

.module-row-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.module-row-title {
    color: var(--os-text-strong);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-row-desc {
    color: var(--os-muted);
    font-size: 0.72rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-row-meta,
.tool-badge {
    justify-self: end;
    white-space: nowrap;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.module-row-meta {
    color: #7d879a;
    border: 1px solid var(--os-border);
    padding: 0.2rem 0.48rem;
}

.tool-badge {
    min-width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    color: var(--os-bg-2);
    background: var(--os-accent);
    padding: 0 0.45rem;
}

.module-section-foot {
    color: #737d90;
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--os-border);
    font-size: 0.72rem;
    font-weight: 650;
}

.empty-directory {
    display: grid;
    place-items: center;
    gap: 0.45rem;
    min-height: 180px;
    border: 1px dashed var(--os-border-strong);
    border-radius: var(--os-radius);
    color: var(--os-muted);
    text-align: center;
}

.empty-directory i {
    color: var(--os-accent);
    font-size: 1.4rem;
}

.empty-directory strong {
    color: var(--os-text-strong);
}

.data-workspace-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.data-workspace-copy {
    min-width: 0;
}

.data-workspace-kicker {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--os-accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.data-workspace-copy h3 {
    color: var(--os-text-strong);
    margin: 0.25rem 0 0;
    font-size: 1.1rem;
    font-weight: 950;
    line-height: 1.15;
}

.data-workspace-copy p {
    color: var(--os-muted);
    margin: 0.3rem 0 0;
    max-width: 760px;
    font-size: 0.84rem;
    line-height: 1.4;
}

.data-workspace-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.38rem;
    max-width: 360px;
}

.data-workspace-meta span,
.data-workspace-meta em {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0.22rem 0.58rem;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.data-workspace-meta span {
    background: var(--os-accent-soft);
    color: var(--os-accent);
    border: 1px solid var(--os-accent-border);
}

.data-workspace-meta em {
    color: #9aa3b5;
    border: 1px solid var(--os-border);
}

.related-tabs {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--os-border);
}

.related-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 34px;
    border: 1px solid var(--os-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: #a9b1c3;
    padding: 0.35rem 0.62rem;
    font-size: 0.76rem;
    font-weight: 650;
}

.related-tabs button:hover,
.related-tabs button:focus-visible {
    border-color: var(--os-accent-border);
    background: var(--os-accent-soft);
    color: var(--os-accent);
    outline: none;
}

.data-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.75rem;
    margin-bottom: 0.85rem;
}

.data-filter-row .relative {
    min-width: min(100%, 280px);
}

.column-config-btn {
    gap: 0.45rem;
}

.column-config-btn b {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 22px;
    border-radius: 999px;
    background: var(--os-accent-soft);
    color: var(--os-accent);
    font-size: 0.72rem;
    font-weight: 950;
}

.column-settings-backdrop {
    position: fixed;
    inset: 0;
    z-index: 85;
    display: flex;
    justify-content: flex-end;
}

.column-settings-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
}

.column-settings-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(460px, 100%);
    height: 100%;
    background: var(--os-sidebar);
    border-left: 1px solid var(--os-border);
    box-shadow: -28px 0 60px rgba(0, 0, 0, 0.48);
}

.column-settings-head,
.column-settings-foot {
    flex-shrink: 0;
    background: var(--os-bg-2);
    border-color: var(--os-border);
}

.column-settings-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem;
    border-bottom: 1px solid var(--os-border);
}

.column-settings-head h3 {
    margin: 0.25rem 0 0;
    color: var(--os-text-strong);
    font-size: 1.15rem;
    font-weight: 950;
}

.column-settings-head p {
    margin: 0.35rem 0 0;
    color: var(--os-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.column-settings-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
}

.column-settings-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    color: var(--os-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.column-settings-summary span,
.column-settings-summary em {
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-style: normal;
}

.column-settings-summary span {
    background: var(--os-accent-soft);
    border: 1px solid var(--os-accent-border);
    color: var(--os-accent);
}

.column-settings-summary em {
    border: 1px solid var(--os-border);
}

.column-settings-list {
    display: grid;
    gap: 0.5rem;
}

.column-settings-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 58px;
    padding: 0.68rem 0.75rem;
    border: 1px solid var(--os-border);
    border-radius: 10px;
    background: rgba(8, 9, 13, 0.42);
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.column-settings-item:hover {
    border-color: var(--os-accent-border);
    background: rgba(122, 184, 209, 0.08);
}

.column-settings-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--os-accent);
    flex-shrink: 0;
}

.column-settings-item span {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.column-settings-item strong {
    color: var(--os-text-strong);
    font-size: 0.9rem;
    line-height: 1.2;
}

.column-settings-item small {
    color: #7d879a;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.column-settings-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--os-border);
}

@media (max-width: 1180px) {
    .command-layout {
        grid-template-columns: 1fr;
    }
    .workflow-rail {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .workflow-rail-head {
        grid-column: 1 / -1;
    }
    .module-list.is-pinned {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .nav-item-desc {
        display: none;
    }
    .workflow-rail,
    .module-list,
    .module-list.is-pinned {
        grid-template-columns: 1fr;
    }
    .workflow-rail {
        padding: 0.75rem;
    }
    .module-row {
        grid-template-columns: 38px minmax(0, 1fr);
    }
    .module-row-meta {
        display: none;
    }
    .data-workspace-head {
        grid-template-columns: 1fr;
    }
    .data-workspace-meta {
        justify-content: flex-start;
        max-width: none;
    }
    .related-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.15rem;
    }
    .related-tabs button {
        flex: 0 0 auto;
    }
    .column-settings-panel {
        width: 100%;
    }
    .column-settings-foot {
        flex-wrap: wrap;
    }
    .column-settings-foot button {
        flex: 1 1 auto;
    }
}

/* ===== Project error analytics ===== */
.error-analytics-toolbar,
.error-analytics-health,
.error-analytics-kpi,
.error-analytics-timeline,
.error-analytics-breakdown,
.error-analytics-state,
.error-detail__summary,
.error-detail__main,
.error-detail__side {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--os-bg-2); /* Richer dark panel background */
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#search-area:has(> .error-analytics-toolbar) {
    position: sticky;
    top: 0;
    z-index: 18;
}

.error-analytics-toolbar {
    position: relative;
    display: grid;
    gap: 0.85rem;
    padding: 1.15rem;
    background: var(--os-bg-2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.error-analytics-toolbar__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.error-analytics-toolbar__heading {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.error-analytics-toolbar__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--os-accent);
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.error-analytics-toolbar__heading h2 {
    margin: 0;
    color: var(--os-text-strong);
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
}

.error-analytics-toolbar__heading p {
    max-width: 760px;
    margin: 0;
    color: var(--os-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    line-height: 1.45;
}

.error-analytics-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.error-analytics-toolbar__button,
.error-analytics-toolbar__reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--os-muted);
    padding: 0.4rem 0.85rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.error-analytics-toolbar__button:hover,
.error-analytics-toolbar__button:focus-visible,
.error-analytics-toolbar__reset:hover,
.error-analytics-toolbar__reset:focus-visible {
    border-color: var(--os-accent);
    background: rgba(122, 184, 209, 0.1);
    color: var(--os-text-strong);
    outline: none;
}

.error-analytics-toolbar__button--primary {
    border-color: rgba(122, 184, 209, 0.3);
    background: rgba(122, 184, 209, 0.15);
    color: var(--os-accent-hover);
}

.error-analytics-toolbar__button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.error-analytics-toolbar__reset {
    border-color: transparent;
    background: transparent;
    color: var(--os-accent);
}

.error-analytics-toolbar input[type="search"],
.error-analytics-toolbar input[type="date"],
.error-analytics-select,
.error-detail textarea {
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: var(--os-bg-2);
    color: var(--os-text-strong);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.error-analytics-toolbar input[type="search"] {
    width: 100%;
    padding: 0.4rem 0.75rem 0.4rem 2.25rem;
}

.error-analytics-toolbar input[type="date"] {
    width: 145px;
    padding: 0.4rem 0.65rem;
    color-scheme: dark;
}

.error-analytics-toolbar input:focus-visible,
.error-analytics-select:focus-visible,
.error-detail textarea:focus-visible {
    border-color: var(--os-accent);
    box-shadow: 0 0 0 3px rgba(122, 184, 209, 0.15);
}

.error-analytics-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem;
    min-width: 0;
}

.error-analytics-filter--primary {
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.error-analytics-filter--secondary {
    display: grid;
    grid-template-columns: minmax(240px, 1.8fr) repeat(auto-fit, minmax(120px, 1fr));
    align-items: end;
    width: 100%;
    gap: 0.65rem;
}

.error-analytics-filter__group,
.error-analytics-filter__field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.error-analytics-filter__group--period {
    justify-items: end;
}

.error-analytics-filter__field--search {
    min-width: 210px;
}

.error-analytics-filter__search-wrap {
    position: relative;
    display: block;
    min-width: 0;
}

.error-analytics-filter__search-wrap > i {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 0.78rem;
    color: var(--os-muted-2);
    font-size: 0.75rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.error-analytics-filter--secondary .error-analytics-select {
    width: 100%;
    max-width: none;
}

.error-analytics-filter__label {
    display: grid;
    gap: 0.35rem;
    color: var(--os-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}

.error-analytics-select {
    padding: 0.4rem 1.9rem 0.4rem 0.65rem;
}

.error-analytics-segment {
    display: inline-flex;
    min-height: 34px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    background: var(--os-bg-2);
}

.error-analytics-segment__button {
    min-height: 28px;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    color: var(--os-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-analytics-segment__button:hover,
.error-analytics-segment__button:focus-visible {
    color: var(--os-text-strong);
    outline: none;
}

.error-analytics-segment__button[aria-pressed="true"],
.error-analytics-segment__button.is-active {
    background: rgba(122, 184, 209, 0.15);
    color: var(--os-accent-hover);
}

.error-analytics-custom-range {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.error-analytics-custom-range > span {
    color: var(--os-muted-2);
    font-size: 0.75rem;
}

.error-analytics-toolbar__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--os-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
}

.error-analytics-toolbar__meta strong {
    color: var(--os-text-strong);
    font-weight: 600;
}

.error-analytics-toolbar__reset {
    color: var(--os-accent);
    cursor: pointer;
    font-weight: 650;
    background: none;
    border: none;
    padding: 0;
}

.error-analytics-health {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    overflow: hidden;
    gap: 0.65rem;
}

.error-analytics-health__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    min-height: 48px;
    padding: 0.85rem 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    background: var(--os-bg-2);
    color: var(--os-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.74rem;
}

.error-analytics-health__item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--os-muted-2);
}

.error-analytics-health__item--ok::before {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.error-analytics-health__item--stale::before {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.error-analytics-health__item strong {
    color: var(--os-text-strong);
    font-weight: 600;
}

.error-analytics-health__copy,
.error-analytics-health__metrics {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.error-analytics-health__copy > span,
.error-analytics-health__metrics > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-analytics-health__metrics {
    justify-items: end;
    color: var(--os-muted-2);
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    text-align: right;
}

.error-analytics-health__metrics b {
    color: var(--os-text-strong);
    font-weight: 600;
}

.error-analytics-health__warning {
    color: var(--os-warning);
    white-space: normal !important;
}

.error-analytics-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.65rem;
}

.error-analytics-kpi {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    min-height: 82px;
    padding: 0.85rem 1.15rem;
    background: var(--os-bg-2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.error-analytics-kpi:hover {
    border-color: rgba(122, 184, 209, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.error-analytics-kpi__label {
    color: var(--os-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}

.error-analytics-kpi__value {
    overflow: hidden;
    color: var(--os-text-strong);
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
}

.error-analytics-kpi__meta {
    color: var(--os-muted-2);
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    line-height: 1.35;
}

.error-analytics-analysis-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.8fr);
    gap: 0.65rem;
}

.error-analytics-timeline,
.error-analytics-breakdown {
    min-width: 0;
    padding: 1.15rem;
    background: var(--os-bg-2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.error-analytics-timeline > header,
.error-analytics-breakdown > header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.7rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.52rem;
}

.error-analytics-timeline h3,
.error-analytics-breakdown h3 {
    margin: 0;
    color: var(--os-text-strong);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.error-analytics-timeline header span,
.error-analytics-breakdown header span {
    color: var(--os-muted-2);
    font-size: 0.72rem;
}

.error-analytics-chart-container {
    position: relative;
    height: 180px;
    width: 100%;
}

.error-analytics-breakdown__list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.error-analytics-breakdown__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
    min-width: 0;
    color: var(--os-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
}

.error-analytics-breakdown__item > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-analytics-breakdown__item strong {
    color: var(--os-text-strong);
    font-weight: 600;
}

button.error-analytics-breakdown__item {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    padding: 0.35rem 0.5rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

button.error-analytics-breakdown__item:hover,
button.error-analytics-breakdown__item:focus-visible {
    border-color: rgba(122, 184, 209, 0.2);
    background: rgba(122, 184, 209, 0.06);
    color: var(--os-text-strong);
    outline: none;
}

.error-analytics-breakdown__empty,
.error-analytics-timeline__empty {
    display: grid;
    place-items: center;
    min-height: 124px;
    color: var(--os-muted-2);
    font-size: 0.78rem;
    text-align: center;
}

#admin-data-table.error-group-table {
    min-width: 1120px;
    table-layout: fixed;
}

.error-group-table th,
.error-group-table td {
    vertical-align: top;
}

.error-group-table th:nth-child(1) { width: 116px; }
.error-group-table th:nth-child(2) { width: 40%; }
.error-group-table th:nth-child(3),
.error-group-table th:nth-child(4) { width: 118px; }
.error-group-table th:nth-child(5) { width: 190px; }
.error-group-table th:nth-child(6) { width: 150px; }
.error-group-table th:last-child { width: 66px; }

.error-group-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.error-group-row:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

.error-group-row:focus-within {
    background: rgba(122, 184, 209, 0.035) !important;
}

.error-group-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    width: 100%;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.error-group-sort i {
    margin-left: auto;
    color: var(--os-muted-2);
    font-size: 0.68rem;
}

.error-group-sort:hover,
.error-group-sort:focus-visible,
.error-group-sort.is-active {
    color: var(--os-accent-hover);
    outline: none;
}

.error-group-message {
    display: grid;
    gap: 0.25rem;
    width: 100%;
    min-width: 0;
    color: inherit;
    text-align: left;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.error-group-message__title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--os-text-strong);
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.error-group-message__frame {
    overflow: hidden;
    color: var(--os-muted-2);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-group-source {
    display: grid;
    gap: 0.38rem;
    justify-items: start;
}

.error-group-source small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--os-muted-2);
    font-size: 0.72rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-group-note {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-top: 0.38rem;
    border: 1px solid rgba(245, 181, 68, 0.28);
    border-radius: 6px;
    background: rgba(245, 181, 68, 0.08);
    color: var(--os-warning);
    font-size: 0.72rem;
}

.error-group-metric {
    display: grid;
    gap: 0.16rem;
    font-variant-numeric: tabular-nums;
}

.error-group-metric strong {
    color: var(--os-text-strong);
    font-size: 0.88rem;
    font-weight: 600;
}

.error-group-metric span {
    color: var(--os-muted-2);
    font-size: 0.72rem;
}

.error-group-impact,
.error-group-time {
    font-variant-numeric: tabular-nums;
}

.error-group-impact strong,
.error-group-time strong {
    display: block;
    color: var(--os-text-strong);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}

.error-group-impact span,
.error-group-impact small,
.error-group-time span {
    display: block;
    margin-top: 0.14rem;
    overflow: hidden;
    color: var(--os-muted-2);
    font-size: 0.72rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-group-actions,
.error-group-actions-heading {
    text-align: center;
}

.error-group-open {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(122, 184, 209, 0.15);
    border-radius: 6px;
    background: rgba(122, 184, 209, 0.08);
    color: var(--os-accent);
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-group-open:hover,
.error-group-open:focus-visible {
    border-color: var(--os-accent);
    background: rgba(122, 184, 209, 0.25);
    color: var(--os-text-strong);
    outline: none;
}

.error-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 20px;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    color: var(--os-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.71rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    line-height: 1.2;
    text-transform: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.error-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

.error-badge--status-unresolved,
.error-badge--level-exception,
.error-badge--level-fatal,
.error-badge--level-critical {
    color: #ff4a6b;
    border-color: rgba(255, 74, 107, 0.22);
    background: rgba(255, 74, 107, 0.06);
}
.error-badge--status-investigating,
.error-badge--level-assert,
.error-badge--level-warning,
.error-badge--level-warn {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(245, 158, 11, 0.06);
}
.error-badge--status-resolved {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.22);
    background: rgba(16, 185, 129, 0.06);
}
.error-badge--status-ignored,
.error-badge--level-info,
.error-badge--level-debug {
    color: var(--os-muted);
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(148, 163, 184, 0.06);
}
.error-badge--level-error {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(239, 68, 68, 0.06);
}
.error-badge--source-game {
    color: var(--os-accent-hover);
    border-color: rgba(122, 184, 209, 0.25);
    background: rgba(122, 184, 209, 0.06);
}
.error-badge--source-launcher {
    color: #a78bfa;
    border-color: rgba(167, 139, 250, 0.25);
    background: rgba(167, 139, 250, 0.06);
}

.error-analytics-state {
    display: grid;
    place-items: center;
    gap: 0.65rem;
    min-height: 180px;
    padding: 2rem;
    color: var(--os-muted);
    text-align: center;
}

.error-analytics-state i {
    color: var(--os-accent);
    font-size: 1.4rem;
}

.error-analytics-state h3 {
    margin: 0;
    color: var(--os-text-strong);
    font-size: 0.95rem;
    font-weight: 700;
}

.error-analytics-state p {
    max-width: 560px;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.45;
}

.error-analytics-state--error {
    border-color: rgba(239, 68, 68, 0.22);
}

.error-analytics-state--error i {
    color: #ef4444;
}

.error-analytics-state__spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--os-accent);
    border-radius: 50%;
    animation: error-analytics-spin 0.7s linear infinite;
}

.error-analytics-state__action,
.error-detail-load-more {
    min-height: 32px;
    border: 1px solid rgba(122, 184, 209, 0.22);
    border-radius: 6px;
    background: rgba(122, 184, 209, 0.08);
    color: var(--os-accent-hover);
    padding: 0.4rem 0.85rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    font-weight: 650;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-analytics-state__action:hover,
.error-analytics-state__action:focus-visible,
.error-detail-load-more:hover,
.error-detail-load-more:focus-visible {
    border-color: var(--os-accent);
    background: rgba(122, 184, 209, 0.18);
    color: var(--os-text-strong);
    outline: none;
}

@keyframes error-analytics-spin {
    to { transform: rotate(360deg); }
}

.error-detail-overlay {
    z-index: 90;
    background: var(--os-bg-2) !important; /* Cohesive visual dark */
    overflow-x: hidden;
}

.error-detail-overlay > div {
    width: min(1520px, 100%);
}

.error-detail {
    display: grid;
    gap: 0.85rem;
    min-width: 0;
    padding-bottom: 2rem;
}

.error-detail__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.error-detail__identity {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.error-detail__identity h2 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--os-text-strong);
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
}

.error-detail__identity code {
    overflow: hidden;
    color: var(--os-muted-2);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-detail-header__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
}

.error-detail-fingerprint {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.error-detail-fingerprint code {
    display: block;
    min-width: 0;
}

.error-detail-fingerprint button {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: transparent;
    color: var(--os-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-detail-fingerprint button:hover,
.error-detail-fingerprint button:focus-visible {
    border-color: rgba(122, 184, 209, 0.25);
    background: rgba(122, 184, 209, 0.06);
    color: var(--os-text-strong);
    outline: none;
}

.error-detail-top-frame {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--os-muted);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    line-height: 1.45;
}

.error-detail__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.error-detail__actions button,
.error-detail__workflow button,
.error-event-inspector button {
    min-height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--os-muted);
    padding: 0.35rem 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-detail__actions button:hover,
.error-detail__actions button:focus-visible,
.error-detail__workflow button:hover,
.error-detail__workflow button:focus-visible,
.error-event-inspector button:hover,
.error-event-inspector button:focus-visible {
    border-color: var(--os-accent);
    background: rgba(122, 184, 209, 0.1);
    color: var(--os-text-strong);
    outline: none;
}

.error-detail__summary {
    padding: 1rem;
    background: var(--os-bg-2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.error-detail-analysis {
    margin-top: 0.85rem;
}

.error-detail__kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.error-detail__kpis > div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.75rem;
    background: var(--os-bg-2);
}

.error-detail__kpis span {
    color: var(--os-muted-2);
    font-family: 'Inter', sans-serif;
    font-size: 0.71rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-transform: none;
}

.error-detail__kpis strong {
    overflow: hidden;
    color: var(--os-text-strong);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-overflow: ellipsis;
}

.error-detail__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
    gap: 0.85rem;
    align-items: start;
    min-width: 0;
}

.error-detail__main,
.error-detail__side {
    min-width: 0;
    overflow: hidden;
}

.error-detail__main {
    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
    min-height: 560px;
    background: var(--os-bg-2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.error-detail__side {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    background: var(--os-bg-2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.error-detail__workflow {
    display: grid;
    gap: 0.65rem;
}

.error-detail__workflow > header,
.error-event-list__header,
.error-event-inspector__header,
.error-event-environment-section > header,
.error-event-block > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
}

.error-detail__workflow header span,
.error-event-list__header span,
.error-event-inspector__header span,
.error-event-environment-section header span,
.error-event-block header span {
    display: block;
    color: var(--os-muted-2);
    font-family: 'Inter', sans-serif;
    font-size: 0.71rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-transform: none;
}

.error-detail__workflow header small {
    color: var(--os-muted-2);
    font-size: 0.72rem;
    text-align: right;
}

.error-detail__workflow form {
    display: grid;
    align-items: stretch;
    gap: 0.65rem;
}

.error-detail__workflow form .error-analytics-select {
    width: 100%;
    max-width: none;
}

.error-detail__workflow form > button {
    border-color: rgba(122, 184, 209, 0.22);
    background: rgba(122, 184, 209, 0.08);
    color: var(--os-accent-hover);
}

.error-detail-workflow__error {
    margin: 0;
    color: var(--os-danger);
    font-size: 0.74rem;
    line-height: 1.4;
}

.error-detail__workflow h3,
.error-event-inspector h3 {
    margin: 0;
    color: var(--os-text-strong);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.error-detail__workflow textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    padding: 0.65rem;
    line-height: 1.45;
}

.error-event-list {
    display: grid;
    align-content: start;
    max-height: 68vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    scrollbar-width: thin;
}

.error-event-list__header {
    position: sticky;
    z-index: 2;
    top: 0;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--os-bg-2);
}

.error-event-list__header h3,
.error-event-inspector__header h3,
.error-event-environment-section h4,
.error-event-block h4 {
    margin: 0.14rem 0 0;
    overflow-wrap: anywhere;
    color: var(--os-text-strong);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.35;
}

.error-event-list__header > strong {
    color: var(--os-text-strong);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.error-event-list__items {
    display: grid;
}

.error-event-list__footer {
    display: grid;
    place-items: center;
    min-height: 46px;
    color: var(--os-muted-2);
    font-size: 0.74rem;
    text-align: center;
}

.error-event-list__empty,
.error-event-inspector__empty {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    min-height: 160px;
    padding: 1rem;
    color: var(--os-muted-2);
    font-size: 0.78rem;
    text-align: center;
}

.error-event-item {
    display: grid;
    gap: 0.32rem;
    width: 100%;
    min-width: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid transparent;
    background: transparent;
    color: var(--os-muted);
    padding: 0.85rem 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.error-event-item:hover {
    background: rgba(255, 255, 255, 0.015);
}

.error-event-item--selected,
.error-event-item.is-selected {
    border-left-color: var(--os-accent);
    background: rgba(122, 184, 209, 0.05) !important;
    color: var(--os-text-strong);
}

.error-event-item strong {
    color: var(--os-text-strong);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.error-event-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.error-event-item__top time {
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: var(--os-muted-2);
}

.error-event-item__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin-top: 0.15rem;
}

.error-event-item__meta em {
    font-style: normal;
    font-size: 0.72rem;
    color: var(--os-muted-2);
}

.error-event-item__meta b {
    margin-left: auto;
    color: var(--os-accent-hover);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.error-event-inspector {
    display: grid;
    align-content: start;
    gap: 0.85rem;
    padding: 1rem;
    max-height: 68vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.error-event-inspector__header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.52rem;
}

.error-event-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
}

.error-event-environment {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem 0.85rem;
}

.error-event-environment > div {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.error-event-environment span {
    overflow: hidden;
    color: var(--os-muted-2);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

.error-event-environment span code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.68rem;
    text-transform: none;
    opacity: 0.75;
}

.error-event-environment strong {
    display: block;
    overflow: hidden;
    margin-top: 0.18rem;
    color: var(--os-text-strong);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-event-environment-section {
    display: grid;
    gap: 0.65rem;
}

.error-event-environment-section > header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.4rem;
}

.error-event-block {
    display: grid;
    gap: 0.52rem;
}

.error-event-block > header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.4rem;
    align-items: center;
}

.error-event-block button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 24px;
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: transparent;
    color: var(--os-muted);
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
}

.error-event-block button:hover {
    border-color: rgba(122, 184, 209, 0.25);
    color: var(--os-text-strong);
    background: rgba(122, 184, 209, 0.05);
}

.error-event-stack,
.error-event-context {
    max-height: 320px;
    overflow: auto;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: var(--os-bg-2);
    color: #d5dae4;
    padding: 0.85rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    scrollbar-width: thin;
}

.error-event-stack__empty,
.error-event-environment__empty {
    display: grid;
    place-items: center;
    min-height: 80px;
    color: var(--os-muted-2);
    font-size: 0.74rem;
}

.error-detail-load-more {
    width: calc(100% - 2rem);
    margin: 0.85rem 1rem;
}

@media (max-width: 1180px) {
    .error-analytics-filter--secondary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .error-analytics-filter__field--search {
        grid-column: span 2;
    }

    .error-analytics-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .error-analytics-analysis-grid,
    .error-detail__layout {
        grid-template-columns: 1fr;
    }

    .error-detail__side {
        position: static;
    }
}

@media (max-width: 760px) {
    #search-area:has(> .error-analytics-toolbar) {
        position: static;
    }

    .error-analytics-toolbar {
        position: static;
        padding: 0.7rem;
        box-shadow: none;
    }

    .error-analytics-toolbar__top {
        grid-template-columns: 1fr;
    }

    .error-analytics-toolbar__actions {
        justify-content: flex-start;
    }

    .error-analytics-filter--primary,
    .error-analytics-filter--secondary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .error-analytics-filter__group {
        width: 100%;
    }

    .error-analytics-filter--primary .error-analytics-filter__group {
        grid-column: 1 / -1;
    }

    .error-analytics-filter__group--period,
    .error-analytics-filter__field--search {
        grid-column: 1 / -1;
        justify-items: stretch;
    }

    .error-analytics-filter {
        align-items: stretch;
    }

    .error-analytics-filter__label {
        flex: 1 1 calc(50% - 0.55rem);
        min-width: 130px;
    }

    .error-analytics-segment {
        width: 100%;
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .error-analytics-segment__button {
        flex: 1 1 auto;
    }

    .error-analytics-select,
    .error-analytics-toolbar input[type="date"] {
        width: 100%;
        max-width: none;
    }

    .error-analytics-custom-range {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .error-analytics-custom-range .error-analytics-toolbar__button {
        grid-column: 1 / -1;
    }

    .error-analytics-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .error-analytics-health {
        grid-template-columns: 1fr;
    }

    .error-analytics-health__item + .error-analytics-health__item {
        border-top: 1px solid var(--os-border);
        border-left-width: 3px;
    }

    .error-analytics-health__item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .error-analytics-health__item > :last-child {
        grid-column: 2;
    }

    .error-analytics-analysis-grid {
        grid-template-columns: 1fr;
    }

    #admin-data-table.error-group-table,
    .error-group-table tbody,
    .error-group-table tr,
    .error-group-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .error-group-table thead {
        display: none;
    }

    .error-group-table tbody {
        display: grid;
        gap: 0.65rem;
        padding: 0.65rem;
    }

    .error-group-table .error-group-row {
        overflow: hidden;
        border: 1px solid var(--os-border);
        border-radius: var(--os-radius-sm);
        background: var(--os-panel-2);
    }

    .error-group-table .error-group-row:hover {
        background: var(--os-panel-2);
    }

    .error-group-table td {
        display: grid;
        grid-template-columns: minmax(80px, 0.34fr) minmax(0, 1fr);
        gap: 0.6rem;
        align-items: start;
        padding: 0.52rem 0.65rem !important;
        border-bottom: 1px solid var(--os-border) !important;
        white-space: normal !important;
    }

    .error-group-table td::before {
        content: attr(data-label);
        color: var(--os-muted-2);
        font-size: 0.64rem;
        font-weight: 650;
        letter-spacing: 0.01em;
        text-transform: none;
    }

    .error-group-table td:last-child {
        border-bottom: 0 !important;
    }

    .error-group-message__title {
        -webkit-line-clamp: 3;
    }

    .error-group-open {
        width: 100%;
    }

    .error-detail__header {
        display: grid;
    }

    .error-detail__actions {
        justify-content: flex-start;
    }

    .error-detail__kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .error-detail__main {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .error-detail__side {
        grid-row: auto;
        order: -1;
    }

    .error-detail-overlay > div {
        padding: 0.75rem !important;
    }

    .error-detail__summary,
    .error-detail__side {
        padding: 0.65rem;
    }

    .error-event-list {
        max-height: 340px;
        border-right: 0;
        border-bottom: 1px solid var(--os-border);
    }

    .error-event-inspector {
        max-height: none;
    }
}

@media (max-width: 480px) {
    .error-analytics-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .error-analytics-filter--secondary {
        grid-template-columns: 1fr;
    }

    .error-analytics-filter--secondary > * {
        grid-column: 1;
    }

    .error-analytics-toolbar__button {
        flex: 1 1 auto;
    }

    .error-analytics-kpi__value {
        font-size: 1.1rem;
    }

    .error-event-environment {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .error-analytics-state__spinner {
        animation-duration: 1.5s;
    }
}

/* ===== Project budget admin module ===== */
.project-budget-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-budget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 14px;
}

.project-budget-head-copy {
    min-width: 0;
}

.project-budget-head-copy h3 {
    margin: 0.25rem 0 0.25rem;
    color: var(--os-text-strong);
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: 0;
}

.project-budget-head-copy p {
    margin: 0;
    max-width: 760px;
    color: var(--os-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.project-budget-sync {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-height: 36px;
    padding: 0 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--os-muted);
    font-size: 0.75rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0.01em;
}

.project-budget-sync.is-syncing {
    color: var(--os-accent);
    border-color: rgba(var(--os-accent-rgb), 0.2);
    background: rgba(var(--os-accent-rgb), 0.08);
}

.project-budget-sync.is-success {
    color: #31d294;
    border-color: rgba(49, 210, 148, 0.22);
    background: rgba(49, 210, 148, 0.08);
}

.project-budget-sync.is-error {
    color: #ff6d8e;
    border-color: rgba(var(--os-danger-rgb), 0.28);
    background: rgba(var(--os-danger-rgb), 0.08);
}

.project-budget-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.project-budget-kpi {
    position: relative;
    min-width: 0;
    min-height: 112px;
    overflow: hidden;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.project-budget-kpi > span {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--os-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
}

.project-budget-kpi > strong {
    display: block;
    max-width: calc(100% - 50px);
    color: var(--os-text-strong);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.project-budget-kpi > strong.is-negative {
    color: #ff6d8e;
}

.project-budget-kpi > small {
    display: block;
    max-width: calc(100% - 50px);
    margin-top: 0.45rem;
    color: var(--os-muted);
    font-size: 0.76rem;
    font-weight: 650;
    line-height: 1.35;
}

.project-budget-kpi > small.is-danger {
    color: #ff8ba6;
}

.project-budget-kpi > i {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 1rem;
}

.project-budget-kpi.is-company > i {
    color: #7ab8d1;
    background: rgba(122, 184, 209, 0.12);
}

.project-budget-kpi.is-expense > i {
    color: #ff7a9b;
    background: rgba(var(--os-danger-rgb), 0.12);
}

.project-budget-kpi.is-status > i {
    color: #31d294;
    background: rgba(49, 210, 148, 0.12);
}

.project-budget-kpi.is-forecast > i {
    color: #f5b544;
    background: rgba(245, 181, 68, 0.12);
}

.project-budget-kpi .is-success,
.project-budget-kpi .is-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1rem;
}

.project-budget-kpi .is-success { color: #31d294; }
.project-budget-kpi .is-danger { color: #ff6d8e; }

.project-budget-grid {
    display: grid;
    grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.4fr);
    gap: 1rem;
    align-items: start;
}

.project-budget-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.project-budget-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(17, 20, 30, 0.72);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.project-budget-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.project-budget-panel-head h4 {
    margin: 0;
    color: var(--os-text-strong);
    font-size: 0.98rem;
    font-weight: 650;
}

.project-budget-panel-head p {
    margin: 0.25rem 0 0;
    color: var(--os-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.project-budget-panel-head > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 0.65rem;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--os-text-strong);
    font-size: 0.78rem;
    font-weight: 700;
}

.project-budget-history-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.project-budget-history-tools > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 34px;
    padding: 0 0.65rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--os-text-strong);
    font-size: 0.78rem;
    font-weight: 700;
}

.project-budget-history-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    height: 34px;
    padding: 0 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--os-muted);
}

.project-budget-history-sort i {
    color: #7ab8d1;
    font-size: 0.78rem;
}

.project-budget-history-sort select {
    min-width: 122px;
    border: 0;
    background: transparent;
    color: var(--os-text-strong);
    font-size: 0.76rem;
    font-weight: 650;
    outline: none;
    cursor: pointer;
}

.project-budget-history-sort select option {
    background: var(--os-sidebar);
    color: var(--os-text-strong);
}

.project-budget-analytics-panel {
    overflow: hidden;
}

.project-budget-analytics-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.project-budget-analytics-metric {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 0.75rem;
    row-gap: 0.15rem;
    min-width: 0;
    min-height: 98px;
    padding: 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.project-budget-analytics-metric:last-child {
    border-right: 0;
}

.project-budget-analytics-metric > i {
    grid-row: 1 / span 3;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(122, 184, 209, 0.12);
    color: #7ab8d1;
}

.project-budget-analytics-metric > span {
    min-width: 0;
    color: var(--os-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.project-budget-analytics-metric > strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--os-text-strong);
    font-size: 1.15rem;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.project-budget-analytics-metric > em {
    min-width: 0;
    color: var(--os-muted);
    font-size: 0.75rem;
    font-style: normal;
    line-height: 1.35;
}

.project-budget-analytics-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 120px;
    color: var(--os-muted);
    font-size: 0.86rem;
    font-weight: 650;
}

.project-budget-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-budget-chart-block {
    min-width: 0;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.project-budget-chart-block:nth-child(2n) {
    border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.project-budget-chart-block.is-wide {
    grid-column: 1 / -1;
}

.project-budget-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    margin-bottom: 0.75rem;
}

.project-budget-chart-head h5 {
    margin: 0;
    color: var(--os-text-strong);
    font-size: 0.9rem;
    font-weight: 650;
}

.project-budget-chart-head p {
    margin: 0;
    max-width: 300px;
    color: var(--os-muted);
    font-size: 0.72rem;
    line-height: 1.4;
    text-align: right;
}

.project-budget-chart-canvas {
    position: relative;
    height: 250px;
    min-width: 0;
}

.project-budget-chart-block.is-wide .project-budget-chart-canvas {
    height: 280px;
}

.project-budget-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
}

.project-budget-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    min-height: 38px;
    padding: 0 0.65rem;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--os-muted);
    font-size: 0.78rem;
    font-weight: 650;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.project-budget-tabs button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-budget-tabs button:hover,
.project-budget-tabs button:focus-visible {
    color: var(--os-text-strong);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.project-budget-tabs button.is-active {
    color: var(--os-bg-2);
    background: var(--os-accent);
    border-color: var(--os-accent);
}

.project-budget-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
}

.project-budget-form.hidden,
.project-budget-split.hidden,
.project-budget-hint.hidden,
.project-budget-debt-block.hidden,
.project-budget-empty.hidden,
.project-budget-transaction-list.hidden,
.project-budget-loading.hidden,
.project-budget-chart-grid.hidden,
.project-budget-analytics-empty.hidden,
#project-budget-funding-person-wrapper.hidden,
#project-budget-correction-person-wrapper.hidden {
    display: none;
}

.project-budget-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.project-budget-form label > span,
.project-budget-split > span,
.project-budget-subhead {
    color: var(--os-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
}

.project-budget-form input,
.project-budget-form select {
    width: 100%;
    min-height: 42px;
    padding: 0 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(5, 8, 14, 0.72);
    color: var(--os-text-strong);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.project-budget-form input[type="number"] {
    min-height: 54px;
    font-size: 1.45rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.project-budget-form input:focus,
.project-budget-form select:focus {
    border-color: var(--os-accent);
    background: rgba(8, 13, 22, 0.9);
    box-shadow: 0 0 0 3px rgba(var(--os-accent-rgb), 0.11);
}

.project-budget-form em {
    color: var(--os-muted);
    font-size: 0.78rem;
    font-style: normal;
    line-height: 1.45;
}

.project-budget-split {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-top: 0.3rem;
}

.project-budget-split > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.project-budget-split label {
    display: inline-flex;
    cursor: pointer;
}

.project-budget-split input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.project-budget-split label span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 34px;
    padding: 0 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--os-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.project-budget-split input:checked + span {
    color: var(--os-bg-2);
    border-color: var(--os-accent);
    background: var(--os-accent);
}

.project-budget-hint {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.75rem;
    border: 1px solid rgba(122, 184, 209, 0.22);
    border-radius: 10px;
    background: rgba(122, 184, 209, 0.08);
    color: #b9dced;
    font-size: 0.82rem;
    line-height: 1.45;
}

.project-budget-hint strong {
    color: var(--os-text-strong);
    font-weight: 700;
    white-space: nowrap;
}

.project-budget-transfer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 0.6rem;
    align-items: end;
}

.project-budget-transfer-row > i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 42px;
    color: var(--os-muted);
}

.project-budget-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 44px;
    margin-top: 0.25rem;
    border-radius: 10px;
    background: var(--os-accent);
    color: var(--os-bg-2);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.project-budget-primary-action:hover,
.project-budget-primary-action:focus-visible {
    filter: brightness(1.08);
    outline: none;
}

.project-budget-primary-action:active {
    transform: translateY(1px);
}

.project-budget-primary-action.is-transfer {
    background: #31d294;
}

.project-budget-primary-action.is-funding {
    background: #f5b544;
}

.project-budget-primary-action.is-correction {
    background: #b58cff;
}

.project-budget-primary-action.is-busy {
    opacity: 0.72;
    cursor: wait;
}

.project-budget-subhead {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    margin: 1rem 0 0.55rem;
}

.project-budget-subhead:first-child {
    margin-top: 0;
}

.project-budget-balance-list,
.project-budget-settlement-list,
.project-budget-debt-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.project-budget-settlement-list {
    padding-bottom: 1rem;
}

.project-budget-balance,
.project-budget-company-debt,
.project-budget-settlement,
.project-budget-settled {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    min-height: 46px;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.project-budget-balance span,
.project-budget-company-debt span,
.project-budget-settlement span {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    color: var(--os-text-strong);
    font-size: 0.9rem;
    font-weight: 600;
}

.project-budget-balance span b,
.project-budget-company-debt span b,
.project-budget-settlement span b {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--os-text-strong);
    font-size: 0.72rem;
}

.project-budget-balance strong,
.project-budget-company-debt strong,
.project-budget-settlement strong {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    color: var(--os-text-strong);
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.project-budget-balance.is-positive {
    border-color: rgba(49, 210, 148, 0.22);
    background: rgba(49, 210, 148, 0.08);
}

.project-budget-balance.is-positive strong {
    color: #31d294;
}

.project-budget-balance.is-negative {
    border-color: rgba(var(--os-danger-rgb), 0.22);
    background: rgba(var(--os-danger-rgb), 0.08);
}

.project-budget-balance.is-negative strong {
    color: #ff6d8e;
}

.project-budget-company-debt {
    border-color: rgba(245, 181, 68, 0.24);
    background: rgba(245, 181, 68, 0.08);
}

.project-budget-company-debt strong {
    color: #f5b544;
}

.project-budget-settlement span {
    align-items: center;
}

.project-budget-settlement span b {
    margin-right: -0.85rem;
    border: 2px solid var(--os-sidebar);
}

.project-budget-settlement span b.from {
    background: rgba(var(--os-danger-rgb), 0.22);
    color: #ff9bb3;
}

.project-budget-settlement span b.to {
    background: rgba(49, 210, 148, 0.22);
    color: #8df0c8;
}

.project-budget-settlement span em {
    margin-left: 0.9rem;
    color: #dbe5ef;
    font-size: 0.84rem;
    font-style: normal;
    font-weight: 650;
}

.project-budget-settled {
    justify-content: center;
    color: #31d294;
    border-color: rgba(49, 210, 148, 0.2);
    background: rgba(49, 210, 148, 0.08);
    font-size: 0.86rem;
    font-weight: 650;
}

.project-budget-history-panel {
    display: flex;
    flex-direction: column;
    min-height: 640px;
}

.project-budget-loading,
.project-budget-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 220px;
    padding: 2rem;
    color: var(--os-muted);
    text-align: center;
}

.project-budget-empty i {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.22);
    font-size: 1.8rem;
}

.project-budget-empty strong {
    color: var(--os-text-strong);
    font-size: 1rem;
}

.project-budget-empty span {
    font-size: 0.85rem;
}

.project-budget-transaction-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
    padding: 0.4rem;
}

.project-budget-type-divider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 34px;
    padding: 0.7rem 0.75rem 0.35rem;
    color: var(--os-muted);
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.01em;
    text-transform: none;
}

.project-budget-type-divider span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-budget-type-divider em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 0.45rem;
    border: 1px solid rgba(122, 184, 209, 0.18);
    border-radius: 999px;
    background: rgba(122, 184, 209, 0.08);
    color: #b9dced;
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.project-budget-transaction {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    min-height: 66px;
    padding: 0.75rem;
    border-radius: 12px;
    transition: background 0.18s ease;
}

.project-budget-transaction + .project-budget-transaction {
    border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.project-budget-transaction:hover {
    background: rgba(255, 255, 255, 0.04);
}

.project-budget-transaction-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--os-muted);
}

.project-budget-transaction-icon.is-company {
    color: #7ab8d1;
    background: rgba(122, 184, 209, 0.12);
}

.project-budget-transaction-icon.is-transfer {
    color: #31d294;
    background: rgba(49, 210, 148, 0.12);
}

.project-budget-transaction-icon.is-funding {
    color: #b58cff;
    background: rgba(181, 140, 255, 0.12);
}

.project-budget-transaction-icon.is-investment {
    color: #f5b544;
    background: rgba(245, 181, 68, 0.12);
}

.project-budget-transaction-icon.is-correction {
    color: #c7a8ff;
    background: rgba(181, 140, 255, 0.12);
}

.project-budget-transaction-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.project-budget-transaction-copy strong {
    min-width: 0;
    overflow: hidden;
    color: var(--os-text-strong);
    font-size: 0.92rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-budget-transaction-copy em {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    overflow: hidden;
    color: var(--os-muted);
    font-size: 0.76rem;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-budget-transaction-amount {
    justify-self: end;
    color: var(--os-text-strong);
    font-size: 0.9rem;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.project-budget-transaction-amount.is-out {
    color: #ff7a9b;
}

.project-budget-transaction-amount.is-in {
    color: #b58cff;
}

.project-budget-transaction-amount.is-transfer {
    color: #31d294;
}

.project-budget-transaction-amount.is-correction {
    color: #c7a8ff;
}

@media (max-width: 1180px) {
    .project-budget-summary,
    .project-budget-analytics-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-budget-analytics-metric:nth-child(2n) {
        border-right: 0;
    }

    .project-budget-analytics-metric:nth-child(n + 3) {
        border-top: 1px solid rgba(255, 255, 255, 0.07);
    }

    .project-budget-grid {
        grid-template-columns: 1fr;
    }

    .project-budget-history-panel {
        min-height: 520px;
    }
}

@media (max-width: 760px) {
    .project-budget-head {
        align-items: stretch;
        flex-direction: column;
    }

    .project-budget-summary {
        grid-template-columns: 1fr;
    }

    .project-budget-analytics-strip,
    .project-budget-chart-grid {
        grid-template-columns: 1fr;
    }

    .project-budget-analytics-metric {
        border-right: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.07);
    }

    .project-budget-analytics-metric:first-child {
        border-top: 0;
    }

    .project-budget-chart-block,
    .project-budget-chart-block:nth-child(2n) {
        border-left: 0;
    }

    .project-budget-chart-head {
        flex-direction: column;
    }

    .project-budget-chart-head p {
        max-width: none;
        text-align: left;
    }

    .project-budget-chart-canvas,
    .project-budget-chart-block.is-wide .project-budget-chart-canvas {
        height: 240px;
    }

    .project-budget-history-panel .project-budget-panel-head {
        flex-direction: column;
    }

    .project-budget-history-tools {
        width: 100%;
        justify-content: space-between;
    }

    .project-budget-history-sort {
        flex: 1 1 auto;
    }

    .project-budget-history-sort select {
        width: 100%;
        min-width: 0;
    }

    .project-budget-tabs {
        grid-template-columns: 1fr;
    }

    .project-budget-transfer-row {
        grid-template-columns: 1fr;
    }

    .project-budget-transfer-row > i {
        width: 100%;
        height: 22px;
        transform: rotate(90deg);
    }

    .project-budget-transaction {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 0.6rem;
    }

    .project-budget-transaction-icon {
        width: 38px;
        height: 38px;
    }

    .project-budget-transaction-amount {
        grid-column: 2 / 3;
        justify-self: start;
    }

}

/* ============================================================
   ANALYTICS WORKSPACE DESIGN SYSTEM (an-*)
   Shared visual language for: LBVR analytics, Launcher analytics,
   Downloads, Game launches & matches, Project errors.
   Built on the --os-* token set; chart series palette validated
   for CVD-safety against the panel surface (var(--os-panel)).
   ============================================================ */

:root {
    /* Categorical chart series — fixed order, never cycled */
    --an-s1: #3987e5;
    --an-s2: #199e70;
    --an-s3: #c98500;
    --an-s4: #008300;
    --an-s5: #9085e9;
    --an-s6: #e66767;
    --an-s7: #d55181;
    --an-s8: #d95926;
    /* Status — reserved, never used as "just another series" */
    --an-good: #10b981;
    --an-good-soft: rgba(16, 185, 129, 0.06);
    --an-good-border: rgba(16, 185, 129, 0.22);
    --an-warn: #f59e0b;
    --an-warn-soft: rgba(245, 158, 11, 0.06);
    --an-warn-border: rgba(245, 158, 11, 0.22);
    --an-danger: #f2708a;
    --an-danger-soft: rgba(242, 112, 138, 0.07);
    --an-danger-border: rgba(242, 112, 138, 0.24);
    --an-info: #06b6d4;
    --an-info-soft: rgba(6, 182, 212, 0.06);
    --an-info-border: rgba(6, 182, 212, 0.22);
    --an-violet: #a78bfa;
    --an-violet-soft: rgba(167, 139, 250, 0.06);
    --an-violet-border: rgba(167, 139, 250, 0.22);
    /* Ink scale for data UI — follows the v3 readability scale */
    --an-ink: var(--os-text);
    --an-ink-2: var(--os-muted);
    --an-ink-3: var(--os-muted-2);
    --an-hairline: var(--os-hairline);
}

/* ---------- Layout shells ---------- */

.an-shell {
    display: grid;
    gap: 0.9rem;
    min-width: 0;
}

.an-grid {
    display: grid;
    gap: 0.9rem;
    min-width: 0;
}

.an-grid > * { min-width: 0; }

.an-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.an-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.an-grid--split { grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); }
.an-grid--explorer { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); align-items: start; }

/* ---------- Section header ---------- */

.an-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    min-width: 0;
}

.an-head__copy {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.an-head__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--os-accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.an-head__kicker i { font-size: 0.72rem; }

.an-head__title {
    margin: 0;
    color: var(--an-ink);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.an-head__sub {
    margin: 0;
    max-width: 72ch;
    color: var(--an-ink-2);
    font-size: 0.8rem;
    line-height: 1.5;
}

.an-head__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Meta chips row (freshness, counts, source state) */
.an-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    color: var(--an-ink-3);
    font-size: 0.75rem;
}

.an-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.an-meta i { font-size: 0.72rem; opacity: 0.85; }
.an-meta b, .an-meta strong { color: var(--an-ink-2); font-weight: 600; }

/* ---------- Buttons ---------- */

.an-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 36px;
    padding: 0.42rem 0.85rem;
    border: 1px solid var(--os-border-strong);
    border-radius: var(--os-radius-sm);
    background: var(--os-panel-2);
    color: var(--an-ink-2);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.an-btn:hover {
    border-color: var(--os-accent-border);
    color: var(--an-ink);
}

.an-btn:focus-visible {
    outline: none;
    border-color: var(--os-accent);
    box-shadow: 0 0 0 3px var(--os-accent-soft);
}

.an-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.an-btn--primary {
    border-color: var(--os-accent-border);
    background: var(--os-accent-soft);
    color: var(--os-accent-hover);
}

.an-btn--primary:hover {
    border-color: var(--os-accent);
    background: rgba(122, 184, 209, 0.2);
    color: var(--os-text-strong);
}

.an-btn--ghost {
    border-color: transparent;
    background: transparent;
}

.an-btn--sm {
    min-height: 30px;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
}

.an-btn i { font-size: 0.75rem; }

/* ---------- Toolbar & filters ---------- */

.an-toolbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    background: var(--os-panel);
    min-width: 0;
}

.an-toolbar__spacer { flex: 1 1 auto; }

.an-field {
    display: grid;
    gap: 0.32rem;
    min-width: 0;
}

.an-field > span {
    color: var(--an-ink-3);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-transform: none;
}

.an-select,
.an-input {
    min-height: 36px;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--os-border-strong);
    border-radius: var(--os-radius-sm);
    background: var(--os-panel-2);
    color: var(--an-ink);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.an-select { padding-right: 1.7rem; }

.an-select:focus-visible,
.an-input:focus-visible,
.an-search input:focus-visible {
    border-color: var(--os-accent);
    box-shadow: 0 0 0 3px var(--os-accent-soft);
}

.an-search {
    position: relative;
    min-width: 0;
}

.an-search > i {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    color: var(--an-ink-3);
    font-size: 0.72rem;
    pointer-events: none;
}

.an-search input {
    width: 100%;
    min-height: 36px;
    padding: 0.4rem 0.75rem 0.4rem 2.1rem;
    border: 1px solid var(--os-border-strong);
    border-radius: var(--os-radius-sm);
    background: var(--os-panel-2);
    color: var(--an-ink);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.an-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 36px;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--os-border-strong);
    border-radius: var(--os-radius-sm);
    background: var(--os-panel-2);
    color: var(--an-ink-2);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
}

.an-check input {
    accent-color: var(--os-accent);
    width: 14px;
    height: 14px;
}

/* Segmented control (period switcher) */
.an-seg {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius-sm);
    background: var(--os-panel-2);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.an-seg::-webkit-scrollbar { display: none; }

.an-seg__btn {
    min-height: 30px;
    padding: 0.28rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--an-ink-3);
    font-size: 0.74rem;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.an-seg__btn:hover { color: var(--an-ink); }

.an-seg__btn:focus-visible {
    outline: none;
    border-color: var(--os-accent);
}

.an-seg__btn.is-active {
    border-color: var(--os-accent-border);
    background: var(--os-accent-soft);
    color: var(--os-accent-hover);
}

.an-daterange {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 36px;
    padding: 3px 3px 3px 0.6rem;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius-sm);
    background: var(--os-panel-2);
    color: var(--an-ink-3);
}

.an-daterange.is-active {
    border-color: var(--os-accent-border);
}

.an-daterange input[type="date"] {
    min-height: 28px;
    border: 0;
    background: transparent;
    color: var(--an-ink-2);
    font-size: 0.74rem;
    outline: none;
    color-scheme: dark;
    width: 118px;
}

.an-daterange__apply {
    min-height: 28px;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--os-accent-border);
    border-radius: 6px;
    background: var(--os-accent-soft);
    color: var(--os-accent-hover);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.an-daterange__apply:hover { color: var(--os-text-strong); border-color: var(--os-accent); }

/* ---------- KPI cards ---------- */

.an-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 0.6rem;
    min-width: 0;
}

.an-kpi {
    position: relative;
    display: grid;
    align-content: start;
    gap: 0.35rem;
    min-width: 0;
    min-height: 86px;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    background: var(--os-panel);
    transition: border-color 0.15s ease;
}

.an-kpi:hover { border-color: var(--os-border-strong); }

.an-kpi__label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--an-ink-3);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.an-kpi__label i {
    flex: 0 0 auto;
    width: 14px;
    text-align: center;
    font-size: 0.72rem;
    color: var(--os-accent);
}

.an-kpi__value {
    overflow: hidden;
    color: var(--an-ink);
    font-size: 1.55rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.an-kpi__value small {
    color: var(--an-ink-3);
    font-size: 0.85rem;
    font-weight: 600;
}

.an-kpi__meta {
    color: var(--an-ink-3);
    font-size: 0.72rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.an-kpi__meta.is-up { color: var(--an-good); }
.an-kpi__meta.is-down { color: var(--an-danger); }

.an-kpi--accent i { color: var(--os-accent); }
.an-kpi--good i { color: var(--an-good); }
.an-kpi--warn i { color: var(--an-warn); }
.an-kpi--danger i { color: var(--an-danger); }
.an-kpi--info i { color: var(--an-info); }
.an-kpi--violet i { color: var(--an-violet); }

.an-kpi--alert {
    border-color: var(--an-warn-border);
    background: linear-gradient(180deg, rgba(245, 181, 68, 0.05), transparent 55%), var(--os-panel);
}

.an-kpi--live::after {
    content: '';
    position: absolute;
    top: 0.8rem;
    right: 0.85rem;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--an-good);
    box-shadow: 0 0 0 4px var(--an-good-soft);
}

/* ---------- Panels ---------- */

.an-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    background: var(--os-panel);
    overflow: hidden;
}

.an-panel__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    padding: 0.8rem 0.95rem 0.65rem;
}

.an-panel__head--rule {
    border-bottom: 1px solid var(--os-border);
    padding-bottom: 0.75rem;
}

.an-panel__title {
    margin: 0;
    color: var(--an-ink);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.3;
    min-width: 0;
}

.an-panel__title small {
    display: block;
    margin-top: 0.15rem;
    color: var(--an-ink-3);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.4;
}

.an-panel__aside {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--an-ink-3);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.an-panel__body {
    padding: 0 0.95rem 0.9rem;
    min-width: 0;
}

.an-panel__body--flush { padding: 0; }

.an-panel--warn { border-color: var(--an-warn-border); }
.an-panel--danger { border-color: var(--an-danger-border); }

.an-chart {
    position: relative;
    height: 240px;
    min-width: 0;
}

.an-chart--sm { height: 190px; }
.an-chart--lg { height: 300px; }

/* ---------- Tables ---------- */

.an-scroll-x {
    overflow-x: auto;
    min-width: 0;
    scrollbar-width: thin;
}

.an-scroll-y {
    overflow-y: auto;
    scrollbar-width: thin;
}

.an-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    padding: 0;
    font-size: 0.8rem;
}

.an-table thead tr th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.55rem 0.85rem;
    border: 0;
    border-bottom: 1px solid var(--os-border);
    background: var(--os-panel);
    color: var(--an-ink-3);
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    text-align: left;
    white-space: nowrap;
}

.an-table tbody tr {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    transition: background 0.12s ease;
}

.an-table tbody tr + tr td { border-top: 1px solid var(--an-hairline); }

.an-table tbody td {
    padding: 0.6rem 0.85rem;
    color: var(--an-ink-2);
    vertical-align: middle;
    line-height: 1.4;
}

.an-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.an-table .is-num {
    text-align: right;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
    color: var(--an-ink-2);
    white-space: nowrap;
}

.an-table .is-num strong,
.an-table strong { color: var(--an-ink); font-weight: 650; }

.an-table--rows tbody tr { cursor: pointer; }

.an-table tbody tr.is-selected {
    background: var(--os-accent-soft);
    box-shadow: inset 2px 0 0 var(--os-accent);
}

.an-table .an-cell-main {
    display: block;
    color: var(--an-ink);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.an-table .an-cell-sub {
    display: block;
    margin-top: 0.12rem;
    color: var(--an-ink-3);
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.an-table .an-cell-mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
}

/* ---------- Horizontal "top list" bars ---------- */

.an-bars {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.an-bars__row {
    display: grid;
    grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1.4fr) auto;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    color: inherit;
    font: inherit;
}

.an-bars__row[onclick],
button.an-bars__row { cursor: pointer; border-radius: 6px; }

button.an-bars__row:hover .an-bars__label,
button.an-bars__row:focus-visible .an-bars__label { color: var(--an-ink); }

button.an-bars__row:focus-visible { outline: 1px solid var(--os-accent-border); outline-offset: 2px; }

.an-bars__label {
    color: var(--an-ink-2);
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.an-bars__track {
    position: relative;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.an-bars__fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--w, 0%);
    min-width: 2px;
    border-radius: 4px;
    background: var(--an-s1);
}

.an-bars__val {
    color: var(--an-ink);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.an-bars__val small { color: var(--an-ink-3); font-size: 0.71rem; }

/* ---------- Badges & status ---------- */

.an-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    min-height: 22px;
    padding: 0.14rem 0.5rem;
    border: 1px solid var(--os-border-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--an-ink-2);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    line-height: 1.2;
    white-space: nowrap;
}

.an-badge::before {
    content: '';
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.9;
}

.an-badge--plain::before { display: none; }

.an-badge--good { color: var(--an-good); border-color: var(--an-good-border); background: var(--an-good-soft); }
.an-badge--warn { color: var(--an-warn); border-color: var(--an-warn-border); background: var(--an-warn-soft); }
.an-badge--danger { color: var(--an-danger); border-color: var(--an-danger-border); background: var(--an-danger-soft); }
.an-badge--info { color: var(--an-info); border-color: var(--an-info-border); background: var(--an-info-soft); }
.an-badge--violet { color: var(--an-violet); border-color: var(--an-violet-border); background: var(--an-violet-soft); }
.an-badge--accent { color: var(--os-accent-hover); border-color: var(--os-accent-border); background: var(--os-accent-soft); }
.an-badge--neutral { color: var(--an-ink-3); }

/* ---------- Alerts & feed ---------- */

.an-alert {
    display: flex;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius-sm);
    background: var(--os-panel-2);
}

.an-alert > i {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--an-ink-3);
}

.an-alert--warn { border-color: var(--an-warn-border); }
.an-alert--warn > i { color: var(--an-warn); }
.an-alert--danger { border-color: var(--an-danger-border); }
.an-alert--danger > i { color: var(--an-danger); }

.an-alert__title {
    color: var(--an-ink);
    font-size: 0.79rem;
    font-weight: 650;
    line-height: 1.35;
}

.an-alert__text {
    margin-top: 0.1rem;
    color: var(--an-ink-3);
    font-size: 0.73rem;
    line-height: 1.4;
}

.an-feed {
    display: grid;
    gap: 2px;
}

.an-feed__row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    font-size: 0.74rem;
}

.an-feed__row:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }

.an-feed__time {
    color: var(--an-ink-3);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    white-space: nowrap;
}

.an-feed__name {
    color: var(--an-ink);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.an-feed__src {
    color: var(--an-ink-3);
    font-size: 0.72rem;
    white-space: nowrap;
}

/* ---------- View tabs (LBVR) ---------- */

.an-tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius-sm);
    background: var(--os-panel);
    overflow-x: auto;
    scrollbar-width: none;
}

.an-tabs::-webkit-scrollbar { display: none; }

.an-tabs__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 34px;
    padding: 0.35rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--an-ink-3);
    font-size: 0.76rem;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.an-tabs__btn i { font-size: 0.72rem; opacity: 0.85; }

.an-tabs__btn:hover { color: var(--an-ink); background: rgba(255, 255, 255, 0.04); }

.an-tabs__btn:focus-visible { outline: none; border-color: var(--os-accent); }

.an-tabs__btn.is-active {
    border-color: var(--os-accent-border);
    background: var(--os-accent-soft);
    color: var(--os-accent-hover);
}

.an-tabs__btn.is-active i { opacity: 1; }

/* ---------- Key/value blocks ---------- */

.an-kv {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius-sm);
    background: var(--os-border);
    overflow: hidden;
}

.an-kv > div {
    min-width: 0;
    padding: 0.55rem 0.65rem;
    background: var(--os-panel-2);
}

.an-kv span {
    display: block;
    color: var(--an-ink-3);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-transform: none;
}

.an-kv strong {
    display: block;
    margin-top: 0.2rem;
    overflow: hidden;
    color: var(--an-ink);
    font-size: 0.78rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.an-kv strong.an-cell-mono { font-size: 0.72rem; }

.an-json {
    max-height: 420px;
    overflow: auto;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius-sm);
    background: #0c0e13;
    color: #ccd3e0;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    scrollbar-width: thin;
}

/* ---------- Expandable hierarchy rows ---------- */

.an-expand { border-bottom: 1px solid var(--an-hairline); }
.an-expand:last-child { border-bottom: 0; }

.an-expand > summary {
    list-style: none;
    padding: 0.7rem 0.95rem;
    cursor: pointer;
    transition: background 0.12s ease;
}

.an-expand > summary::-webkit-details-marker { display: none; }

.an-expand > summary:hover { background: rgba(255, 255, 255, 0.025); }

.an-expand > summary:focus-visible {
    outline: none;
    box-shadow: inset 2px 0 0 var(--os-accent);
    background: rgba(255, 255, 255, 0.025);
}

.an-expand[open] > summary {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--an-hairline);
}

.an-expand__chevron {
    color: var(--an-ink-3);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.an-expand[open] > summary .an-expand__chevron { transform: rotate(180deg); }

.an-expand__children {
    padding: 0.75rem 0.95rem;
    background: rgba(0, 0, 0, 0.16);
}

/* Строка иерархии «запуск арены» */
.an-launch-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(130px, 1fr) 110px 76px 76px 22px;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
}

.an-launch-row .an-cell-main,
.an-launch-row .an-cell-sub {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.an-launch-row .an-cell-main {
    color: var(--an-ink);
    font-weight: 600;
}

.an-launch-row .an-cell-sub {
    margin-top: 0.12rem;
    color: var(--an-ink-3);
    font-size: 0.72rem;
}

.an-launch-count {
    text-align: center;
}

.an-launch-count strong {
    display: block;
    color: var(--an-ink);
    font-size: 0.92rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.an-launch-count span {
    display: block;
    margin-top: 0.05rem;
    color: var(--an-ink-3);
    font-size: 0.68rem;
    letter-spacing: 0.01em;
    text-transform: none;
}

.an-user-group > .an-expand__children {
    padding: 0;
}

.an-user-group > summary {
    background: rgba(var(--os-accent-rgb), 0.025);
}

.an-user-group[open] > summary {
    background: rgba(var(--os-accent-rgb), 0.05);
}

.an-user-launches {
    background: rgba(0, 0, 0, 0.2);
}

.an-user-launches__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.95rem;
    border-bottom: 1px solid var(--an-hairline);
    color: var(--an-ink-3);
    font-size: 0.72rem;
}

.an-user-launches__meta strong {
    color: var(--an-ink);
    font-variant-numeric: tabular-nums;
}

.an-user-launches > .an-expand > summary {
    padding-left: 1.35rem;
}

@media (max-width: 900px) {
    .an-launch-row {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 0.45rem;
    }
    .an-launch-row > :nth-child(1) { grid-column: 1 / -1; }
    .an-launch-row .an-launch-count { text-align: left; }
    .an-launch-row .an-expand__chevron { justify-self: end; }
    .an-user-launches__meta {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ---------- States ---------- */

.an-empty {
    display: grid;
    place-items: center;
    gap: 0.55rem;
    padding: 2.2rem 1rem;
    color: var(--an-ink-3);
    font-size: 0.78rem;
    text-align: center;
}

.an-empty i {
    font-size: 1.35rem;
    opacity: 0.45;
}

.an-empty--dashed {
    border: 1px dashed var(--os-border-strong);
    border-radius: var(--os-radius-sm);
}

.an-state {
    display: grid;
    place-items: center;
    gap: 0.6rem;
    min-height: 170px;
    padding: 1.8rem;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    background: var(--os-panel);
    color: var(--an-ink-2);
    text-align: center;
}

.an-state h3 {
    margin: 0;
    color: var(--an-ink);
    font-size: 0.92rem;
    font-weight: 700;
}

.an-state p {
    margin: 0;
    max-width: 52ch;
    color: var(--an-ink-3);
    font-size: 0.76rem;
    line-height: 1.5;
}

.an-state--error { border-color: var(--an-danger-border); }
.an-state--error > i { color: var(--an-danger); font-size: 1.3rem; }

.an-spinner {
    width: 26px;
    height: 26px;
    border: 2px solid var(--os-border-strong);
    border-top-color: var(--os-accent);
    border-radius: 999px;
    animation: an-spin 0.7s linear infinite;
}

@keyframes an-spin { to { transform: rotate(360deg); } }

.an-skeleton {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    background: var(--os-panel);
    min-height: 86px;
}

.an-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.045) 50%, transparent 70%);
    animation: an-shimmer 1.4s ease-in-out infinite;
}

@keyframes an-shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* ---------- Pagination ---------- */

.an-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.6rem 0.95rem;
    border-top: 1px solid var(--os-border);
}

.an-pager__info {
    color: var(--an-ink-3);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    margin-right: auto;
}

/* ---------- Legend chips (для HTML-легенд рядом с графиками) ---------- */

.an-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    color: var(--an-ink-3);
    font-size: 0.72rem;
}

.an-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.an-legend i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex: 0 0 auto;
}

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
    .an-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .an-grid--2,
    .an-grid--split,
    .an-grid--explorer { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .an-grid--3 { grid-template-columns: 1fr; }
    .an-head { align-items: flex-start; }
    .an-head__actions { width: 100%; justify-content: flex-start; }
    .an-toolbar { align-items: stretch; }
    .an-toolbar > .an-field,
    .an-toolbar > .an-search { flex: 1 1 46%; }
    .an-seg { width: 100%; }
    .an-seg__btn { flex: 1 1 auto; text-align: center; }
    .an-daterange { width: 100%; flex-wrap: wrap; }
    .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .an-kpi__value { font-size: 1.3rem; }
    .an-bars__row { grid-template-columns: minmax(70px, 0.8fr) minmax(0, 1fr) auto; gap: 0.5rem; }
    .an-chart { height: 210px; }
    .an-chart--lg { height: 240px; }
}

@media (max-width: 480px) {
    .an-kpis { grid-template-columns: 1fr 1fr; gap: 0.45rem; }
    .an-kpi { min-height: 74px; padding: 0.6rem 0.7rem; }
    .an-panel__head { padding: 0.7rem 0.75rem 0.55rem; }
    .an-panel__body { padding: 0 0.75rem 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .an-spinner { animation-duration: 1.6s; }
    .an-skeleton::after { animation: none; }
    .an-expand__chevron,
    .an-btn,
    .an-seg__btn,
    .an-tabs__btn { transition: none; }
}

/* ============================================================
   PROJECT ERRORS — retune to the analytics design system.
   Overrides for the error-analytics block: larger readable type,
   normal font weights instead of 850–900 black caps, unified
   panel titles. Loaded after the base block, so it wins.
   ============================================================ */

.error-analytics-toolbar__kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--os-accent);
}

.error-analytics-toolbar__heading h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.error-analytics-toolbar__heading p {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--an-ink-2);
}

.error-analytics-toolbar__button,
.error-analytics-toolbar__reset {
    font-size: 0.75rem;
    font-weight: 600;
}

.error-analytics-toolbar input[type="search"],
.error-analytics-toolbar input[type="date"],
.error-analytics-select,
.error-detail textarea {
    font-size: 0.8rem;
}

.error-analytics-filter__label {
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--an-ink-3);
}

.error-analytics-segment__button {
    font-size: 0.74rem;
    font-weight: 650;
}

.error-analytics-toolbar__meta {
    font-size: 0.75rem;
    color: var(--an-ink-3);
}

.error-analytics-health__item {
    font-size: 0.76rem;
}

.error-analytics-health__metrics {
    font-size: 0.7rem;
}

.error-analytics-kpi__label {
    font-size: 0.72rem;
    font-weight: 650;
}

.error-analytics-kpi__value {
    font-size: 1.55rem;
    font-weight: 700;
}

.error-analytics-kpi__meta {
    font-size: 0.72rem;
}

.error-analytics-timeline h3,
.error-analytics-breakdown h3,
.error-detail__workflow h3,
.error-event-inspector h3 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.error-analytics-timeline header span,
.error-analytics-breakdown header span,
.error-detail__workflow header span,
.error-event-list__header span,
.error-event-inspector__header span,
.error-event-environment-section header span,
.error-event-block header span {
    font-size: 0.71rem;
    font-weight: 650;
}

.error-analytics-timeline__label {
    font-size: 0.68rem;
    color: var(--an-ink-3);
}

.error-analytics-timeline__bars {
    border-bottom-color: var(--an-hairline);
}

.error-analytics-breakdown__item {
    font-size: 0.76rem;
}

.error-group-message__title {
    font-size: 0.84rem;
    font-weight: 650;
}

.error-group-message__frame {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.error-group-source small {
    font-size: 0.72rem;
}

.error-group-metric strong {
    font-size: 0.88rem;
}

.error-group-metric span,
.error-group-impact span,
.error-group-impact small,
.error-group-time span {
    font-size: 0.72rem;
}

.error-group-impact strong,
.error-group-time strong {
    font-size: 0.8rem;
}

.error-badge {
    font-size: 0.71rem;
    font-weight: 650;
    letter-spacing: 0.03em;
}

.error-analytics-state h3 {
    font-size: 0.95rem;
}

.error-analytics-state p {
    font-size: 0.78rem;
}

.error-analytics-state__action,
.error-detail-load-more {
    font-size: 0.76rem;
    font-weight: 650;
}

.error-detail__identity h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.error-detail__identity code,
.error-detail-fingerprint code {
    font-size: 0.72rem;
}

.error-detail-top-frame {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.error-detail__actions button,
.error-detail__workflow button,
.error-event-inspector button {
    font-size: 0.74rem;
    font-weight: 600;
}

.error-detail__kpis span {
    font-size: 0.71rem;
    font-weight: 650;
}

.error-detail__kpis strong {
    font-size: 0.95rem;
    font-weight: 700;
}

.error-event-list__header h3,
.error-event-inspector__header h3,
.error-event-environment-section h4,
.error-event-block h4 {
    font-size: 0.8rem;
    font-weight: 700;
}

.error-event-list__header > strong {
    font-size: 0.74rem;
}

.error-event-item strong {
    font-size: 0.78rem;
    font-weight: 600;
}

.error-event-item span:not(.error-badge) {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.error-event-list__footer,
.error-event-list__empty,
.error-event-inspector__empty {
    font-size: 0.74rem;
}

.error-event-environment span {
    font-size: 0.7rem;
    font-weight: 650;
}

.error-event-environment span code {
    font-size: 0.68rem;
}

.error-event-environment strong {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.error-event-environment__empty,
.error-event-stack__empty {
    font-size: 0.74rem;
}

.error-event-stack,
.error-event-context {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.error-detail-workflow__error {
    font-size: 0.74rem;
    color: var(--an-danger);
}

.error-detail__workflow header small {
    font-size: 0.72rem;
}

@media (max-width: 760px) {
    .error-group-table td::before {
        font-size: 0.7rem;
        font-weight: 650;
    }
}

/* ============================================================
   READABILITY LAYER — v3 (2026-07-11)
   Calm, low-fatigue reading for long admin sessions. Loaded
   last on purpose: wins over legacy layers above and over the
   Tailwind utilities injected by admin-panel.js.
   - Inter for UI text; JetBrains Mono only for ids/numbers
   - no shouting caps, wide tracking or 800-900 weights
   - tables read at 14px/1.55, micro text floored at ~11px
   - soft single focus ring, no neon glows
   ============================================================ */

/* ---- 1. Base type --------------------------------------------------- */

body.admin-os-body {
    font-family: var(--os-font-sans);
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.admin-os-body h1,
.admin-os-body h2,
.admin-os-body h3,
.admin-os-body h4 {
    font-family: var(--os-font-sans);
    letter-spacing: -0.01em;
}

.admin-os-body .font-mono,
.admin-os-body code,
.admin-os-body kbd {
    font-family: var(--os-font-mono);
}

/* Tabular figures wherever numbers align in columns */
#admin-data-table,
.admin-status-strip,
.stat-card,
.nav-category-count {
    font-variant-numeric: tabular-nums;
}

/* ---- 2. De-shout the utility markup --------------------------------- */

.admin-os-body .uppercase { text-transform: none; }
.admin-os-body [class*='tracking-'] { letter-spacing: 0.01em; }
.admin-os-body .tracking-tight { letter-spacing: -0.01em; }
.admin-os-body .font-black { font-weight: 700; }
.admin-os-body .font-extrabold { font-weight: 650; }
.admin-os-body .font-bold { font-weight: 600; }

/* Floor for micro text injected as text-[10px] */
.admin-os-body .text-\[10px\] { font-size: 0.71rem; }

/* Soften peak-white ink, remap legacy dim inks to the v3 scale */
.admin-os-body .text-white { color: var(--os-text-strong); }
.admin-os-body .text-text { color: var(--os-text); }
.admin-os-body .text-textDim { color: var(--os-muted); }
.admin-os-body .text-muted { color: var(--os-muted-2); }

/* Bridge Tailwind semantic utilities into the v3 palette */
.admin-os-body .text-danger { color: #f58ba0; }
.admin-os-body .bg-danger { background-color: var(--os-danger); }
.admin-os-body .border-danger { border-color: var(--os-danger); }
.admin-os-body .bg-bg { background-color: var(--os-bg); }
.admin-os-body .bg-bg\/70 { background-color: rgba(20, 23, 30, 0.74); }
.admin-os-body .bg-surface { background-color: var(--os-panel); }
.admin-os-body .bg-surfaceLight { background-color: var(--os-panel-3); }
.admin-os-body .border-white\/5,
.admin-os-body .border-white\/10 { border-color: var(--os-border); }
.admin-os-body .divide-white\/5 > :not([hidden]) ~ :not([hidden]),
.admin-os-body .divide-white\/10 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--os-hairline);
}

/* ---- 3. Data table: the main reading surface ------------------------ */

.admin-table-panel thead th {
    padding: 0.65rem 1rem;
    background: var(--os-panel-2);
    border-bottom: 1px solid var(--os-border);
    color: var(--os-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}

.admin-table-panel tbody td {
    padding: 0.7rem 1rem;
    color: var(--os-text);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.55;
}

.admin-table-panel tbody tr { transition: background 0.12s ease; }
.admin-table-panel tbody tr:hover { background: rgba(var(--os-accent-rgb), 0.05); }

/* ---- 4. Buttons ------------------------------------------------------ */

.admin-os-body .admin-primary-btn {
    background: var(--os-accent);
    border: 1px solid transparent;
    border-radius: var(--os-radius-sm);
    color: var(--os-accent-ink);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    padding: 0.55rem 1rem;
    min-height: 40px;
    box-shadow: none;
}

.admin-os-body .admin-primary-btn:hover {
    background: var(--os-accent-hover);
    color: var(--os-accent-ink);
    box-shadow: none;
}

.admin-os-body .admin-action-btn,
.admin-os-body .admin-logout-btn {
    font-size: 0.8rem;
    font-weight: 550;
    letter-spacing: 0.01em;
    text-transform: none;
    padding: 0.55rem 0.9rem;
    color: var(--os-muted);
}

.admin-os-body .admin-action-btn:hover,
.admin-os-body .admin-logout-btn:hover { color: var(--os-text-strong); }

/* ---- 5. Forms --------------------------------------------------------- */

.admin-os-body .input-field {
    background: var(--os-panel-2);
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius-sm);
    box-shadow: none;
    backdrop-filter: none;
    color: var(--os-text);
    font-size: 0.9rem;
    line-height: 1.45;
    padding: 0.6rem 0.85rem;
}

.admin-os-body .input-field::placeholder { color: var(--os-muted-2); }

.admin-os-body .input-field:focus {
    background: var(--os-panel-2);
    border-color: var(--os-accent);
    box-shadow: 0 0 0 3px rgba(var(--os-accent-rgb), 0.16);
}

/* ---- 6. Cards ---------------------------------------------------------- */

.admin-os-body .stat-card {
    background: var(--os-panel);
    backdrop-filter: none;
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    box-shadow: none;
    padding: 1rem 1.1rem;
}

.admin-os-body .stat-card::before { display: none; }

.admin-os-body .stat-card:hover {
    transform: none;
    border-color: var(--os-border-strong) !important;
    box-shadow: none !important;
}

/* ---- 7. Shell: topbar, nav, scrollbar ---------------------------------- */

.admin-kicker {
    color: var(--os-muted-2);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
}

.nav-category-label,
.nav-legacy-toggle {
    color: var(--os-muted-2);
    font-weight: 600;
}

::-webkit-scrollbar-thumb {
    background: rgba(151, 168, 195, 0.28);
    border: 2px solid var(--os-bg);
}

::-webkit-scrollbar-thumb:hover { background: rgba(151, 168, 195, 0.45); }

/* ---- 8. Focus & motion -------------------------------------------------- */

.admin-os-body :is(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid rgba(var(--os-accent-rgb), 0.55);
    outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
    .admin-os-body *,
    .admin-os-body *::before,
    .admin-os-body *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
