/* Layout Structure */
* {
    box-sizing: border-box;
    outline: none;
}

html {
    height: 100%;
    background: var(--operator-surface, var(--bg-void));
}

body {
    margin: 0;
    font-family: var(--font-main);
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.08), transparent 30%),
        linear-gradient(180deg, var(--bg-void), var(--bg-depth));
    color: var(--text-main);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-shell {
    display: flex;
    width: var(--ui-scale-width, 100vw);
    height: var(--ui-scale-height, 100vh);
    min-height: 100vh;
    min-height: var(--ui-scale-height, 100vh);
    zoom: var(--ui-scale, 1);
}

@supports not (zoom: 1) {
    .app-shell {
        transform: scale(var(--ui-scale, 1));
        transform-origin: top left;
    }
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w, 280px);
    background: #0b0d14;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 20px 14px 24px;
    z-index: 20;
    box-sizing: border-box;
}

.brand {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 10px 18px;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-logo-img {
    width: 100px;
    height: 26px;
    display: block;
    background-image: var(--logo-url);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.brand-text-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 2px;
}

.brand-text {
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 15px;
}

.brand-subtext {
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 40px;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-group-label {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim, #71717a);
    font-weight: 700;
    padding: 16px 12px 6px;
    user-select: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 2px;
}

.nav-link:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.nav-link.active {
    background: var(--primary-muted);
    color: var(--text-main);
    border-left-color: var(--primary);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.7;
}

.nav-link:hover .nav-icon {
    opacity: 1;
}

.nav-link.active .nav-icon {
    stroke: var(--primary);
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: var(--radius-full, 9999px);
    background: var(--bg-hover, rgba(0, 0, 0, 0.06));
    color: var(--text-dim);
}

.nav-badge.pro {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary, #2563eb);
}

.nav-badge.ent {
    background: rgba(147, 51, 234, 0.12);
    color: #9333ea;
}

.sidebar-user-chip {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 10px;
    border-top: 1px solid var(--border-subtle);
    background: var(--sidebar-user-bg);
    backdrop-filter: blur(8px);
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--account-avatar-bg);
    color: var(--account-avatar-fg);
    box-shadow: var(--account-avatar-ring);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
}

.sidebar-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}

.sidebar-user-role {
    color: var(--text-dim);
    font-size: 11px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Utility helpers */
.hidden {
    display: none;
}

.absolute {
    position: absolute;
}

.cursor-pointer {
    cursor: pointer;
}

.relative {
    position: relative;
}

.top-16 {
    top: 16px;
}

.right-16 {
    right: 16px;
}

.flex-row {
    display: flex;
    align-items: center;
}

.align-center {
    align-items: center;
}

.align-start {
    align-items: flex-start;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.gap-6 {
    gap: 6px;
}

.gap-4 {
    gap: 4px;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

.gap-24 {
    gap: 24px;
}

.gap-20 {
    gap: 20px;
}

.gap-24 {
    gap: 24px;
}

.gap-32 {
    gap: 32px;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.ml-auto {
    margin-left: auto;
}

.title-sm {
    font-size: 16px;
    font-weight: 600;
}

.status-online {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    display: inline-block;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-plan {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast, 0.15s ease), border-color var(--transition-fast, 0.15s ease);
}

.top-plan:hover {
    border-color: var(--text-muted);
}

.top-plan-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.top-plan-name {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
}

.top-plan-upgrade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    min-height: 30px;
    padding: 0 14px;
    border: 1px solid var(--operator-link, var(--primary, #f97316));
    border-radius: 999px;
    background: var(--operator-link, var(--primary, #f97316));
    color: #ffffff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background-color var(--transition-fast, 0.15s ease), border-color var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease), transform var(--transition-fast, 0.15s ease);
}

.top-plan-upgrade:hover {
    background: var(--operator-link-hover, var(--primary-hover, #ea580c));
    border-color: var(--operator-link-hover, var(--primary-hover, #ea580c));
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(249, 115, 22, 0.25);
}

.top-plan-upgrade:active {
    transform: translateY(0);
}

.top-plan-upgrade:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Navbar & Top-bar Tier Badges */
.nav-tier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-sm, 2px);
    cursor: pointer;
    transition: opacity var(--transition-fast, 0.15s ease), transform var(--transition-fast, 0.15s ease), background var(--transition-fast, 0.15s ease), border-color var(--transition-fast, 0.15s ease);
    user-select: none;
    vertical-align: middle;
}

.nav-tier-badge:hover {
    opacity: 0.88;
    transform: translateY(-0.5px);
}

.nav-tier-badge.tier-pro {
    background: rgba(249, 115, 22, 0.14) !important;
    color: #fb923c !important;
    border: 1px solid rgba(249, 115, 22, 0.4) !important;
}

.nav-tier-badge.tier-enterprise {
    background: rgba(168, 85, 247, 0.14) !important;
    color: #c084fc !important;
    border: 1px solid rgba(168, 85, 247, 0.42) !important;
}

.nav-tier-badge.tier-free,
.nav-tier-badge.tier-community {
    background: rgba(148, 163, 184, 0.10) !important;
    color: var(--text-dim, #94a3b8) !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
}

.view-placeholder {
    text-align: center;
    margin-top: 100px;
    color: var(--text-dim);
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.justify-start {
    justify-content: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.mb-12 {
    margin-bottom: 12px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-6 {
    margin-bottom: 6px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-4 {
    margin-bottom: 4px;
}

.mt-6 {
    margin-top: 6px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-4 {
    margin-top: 4px;
}

.mt-16 {
    margin-top: 16px;
}

.pt-32 {
    padding-top: 32px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-24 {
    margin-top: 24px;
}

.mt-12 {
    margin-top: 12px;
}

.ml-8 {
    margin-left: 8px;
}

.py-24 {
    padding-top: 24px;
    padding-bottom: 24px;
}

.p-10 {
    padding: 10px;
}

.p-12 {
    padding: 12px;
}

.p-14 {
    padding: 14px;
}

.p-8 {
    padding: 8px;
}

.p-0 {
    padding: 0;
}

.pt-0 {
    padding-top: 0;
}

.pb-16 {
    padding-bottom: 16px;
}

.pb-12 {
    padding-bottom: 12px;
}

.px-10 {
    padding-left: 10px;
    padding-right: 10px;
}

.p-16 {
    padding: 16px;
}

.p-20 {
    padding: 20px;
}

.p-24 {
    padding: 24px;
}

.p-32 {
    padding: 32px;
}

.p-40 {
    padding: 40px;
}

.p-60 {
    padding: 60px;
}

.opacity-30 {
    opacity: 0.3;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-80 {
    opacity: 0.8;
}

.px-16 {
    padding-left: 16px;
    padding-right: 16px;
}

.py-12 {
    padding-top: 12px;
    padding-bottom: 12px;
}

.pt-20 {
    padding-top: 20px;
}

.pt-12 {
    padding-top: 12px;
}

.pt-16 {
    padding-top: 16px;
}

.py-20 {
    padding-top: 20px;
    padding-bottom: 20px;
}

.sticky-20 {
    position: sticky;
    top: 20px;
}

.w-100 {
    width: 100%;
}

.w-80 {
    width: 80%;
}

.w-180 {
    width: 180px;
}

.w-200 {
    width: 200px;
}

.w-120 {
    width: 120px;
}

.w-600 {
    width: 600px;
}

.h-220 {
    height: 220px;
}

.w-64 {
    width: 64px;
}

.h-64 {
    height: 64px;
}

.w-160 {
    width: 160px;
}

.h-160 {
    height: 160px;
}

.w-32 {
    width: 32px;
}

.w-80 {
    width: 80px;
}

.w-100px {
    width: 100px;
}

.h-100px {
    height: 100px;
}

.w-36 {
    width: 36px;
}

.w-14 {
    width: 14px;
}

.h-100p {
    height: 100%;
}

.h-100 {
    height: 100%;
}

.h-32 {
    height: 32px;
}

.max-h-350 {
    max-height: 350px;
}

.h-8 {
    height: 8px;
}

.w-8 {
    width: 8px;
}

.h-6 {
    height: 6px;
}

.dot-success {
    background: var(--success);
}

.dot-danger {
    background: var(--danger);
}

.dot-muted {
    background: var(--text-muted);
}

.dot-primary {
    background: var(--primary);
}

.dot-6 {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot-critical {
    background: var(--danger);
}

.dot-high {
    background: var(--warning);
}

.dot-medium {
    background: var(--primary);
}

.dot-low {
    background: var(--success);
}

.dot-info {
    background: var(--text-muted);
}

.max-h-80vh {
    max-height: 80vh;
}

.overflow-y-auto {
    overflow-y: auto;
}

.overflow-x-auto {
    overflow-x: auto;
}

.pl-26 {
    padding-left: 26px;
}

.pl-32 {
    padding-left: 32px;
}

.h-80 {
    height: 80px;
}

.min-h-350 {
    min-height: 350px;
}

.min-h-200 {
    min-height: 200px;
}

.inline-flex {
    display: inline-flex;
}

.resize-vertical {
    resize: vertical;
}

.lh-14 {
    line-height: 1.4;
}

.lh-15 {
    line-height: 1.5;
}

.block {
    display: block;
}

.inline-flex {
    display: inline-flex;
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.cursor-pointer {
    cursor: pointer;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-5-fixed {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.nowrap {
    white-space: nowrap;
}

.break-all {
    word-break: break-all;
}

.scroll-y {
    overflow-y: auto;
}

.max-h-300 {
    max-height: 300px;
}

.max-h-400 {
    max-height: 400px;
}

.max-h-520 {
    max-height: 520px;
}

.min-h-320 {
    min-height: 320px;
}

.min-h-350 {
    min-height: 350px;
}

.m-0 {
    margin: 0;
}

.mb-10 {
    margin-bottom: 10px;
}

.top-2 {
    position: relative;
    top: 2px;
}

.scale-80 {
    transform: scale(0.8);
}

.font-500 {
    font-weight: 500;
}

.font-600 {
    font-weight: 600;
}

.font-700 {
    font-weight: 700;
}

.text-24 {
    font-size: 24px;
}

.text-18 {
    font-size: 18px;
}

.text-20 {
    font-size: 20px;
}

.text-14 {
    font-size: 14px;
}

.text-13 {
    font-size: 13px;
}

.text-12 {
    font-size: 12px;
}

.text-11 {
    font-size: 11px;
}

.text-10 {
    font-size: 10px;
}

.text-16 {
    font-size: 16px;
}

.text-32 {
    font-size: 32px;
}

.text-48 {
    font-size: 48px;
}

.rotate--90 {
    transform: rotate(-90deg);
}

.ls-1 {
    letter-spacing: 1px;
}

.ls-4 {
    letter-spacing: 4px;
}

.user-select-all {
    user-select: all;
}

.rounded-full {
    border-radius: 9999px;
}

.bg-success-soft {
    background: var(--status-success-bg);
}

.max-w-480 {
    max-width: 480px;
}

.min-h-100 {
    min-height: 100px;
}

.panel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

.status-dot-pulse {
    animation: pulse 2s infinite;
}

.section-header {
    margin-bottom: 24px;
}

.section-title {
    margin: 0 0 8px;
    font-size: 20px;
}

.section-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.loading-block {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.gap-12 {
    gap: 12px;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-2-wide {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.grid-3-16 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-3-wide {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.grid-1 {
    display: grid;
    grid-template-columns: 1fr;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
}

.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
}

.bordered {
    border: 1px solid var(--border);
}

.border {
    border: 1px solid var(--border);
}

.border-dashed {
    border: 1px dashed var(--border);
}

.rounded-8 {
    border-radius: var(--radius-lg);
}

.bg-depth {
    background: var(--bg-depth);
}

.bg-card {
    background: var(--bg-card);
}

.bg-primary-muted {
    background: var(--primary-muted);
}

.bg-success {
    background: var(--success);
}

.bg-danger {
    background: var(--danger);
}

.bg-primary {
    background: var(--primary);
}

.bg-muted {
    background: var(--text-muted);
}

.tile {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-depth);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.uppercase {
    text-transform: uppercase;
}

.tile-hover {
    transition: background 0.2s, border-color 0.2s;
}

.tile-hover:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
}

.border-top {
    border-top: 1px solid var(--border);
}

.border-bottom {
    border-bottom: 1px solid var(--border);
}

.border-success {
    border-color: var(--success);
}

.border-primary {
    border-color: var(--primary);
}

.border-accent-success {
    border-left: 3px solid var(--success);
}

.border-accent-muted {
    border-left: 3px solid var(--border);
}

.border-danger {
    border-color: var(--danger);
}

.block {
    display: block;
}

/* Sidebar Sections - Legacy (can be removed if not used) */
.nav-section {
    margin-bottom: 2px;
}

.nav-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
    font-size: 13px;
}

.nav-section-header:hover {
    background: var(--glass-highlight);
    color: var(--text-main);
}

.nav-section-header span {
    flex: 1;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--text-dim);
}

.nav-section-header:hover .nav-icon {
    color: var(--primary);
}

.nav-chevron {
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.nav-section.collapsed .nav-chevron {
    transform: rotate(-90deg);
}

.nav-section-content {
    overflow: hidden;
    max-height: 300px;
    transition: max-height 0.2s ease-out;
}

.nav-section.collapsed .nav-section-content {
    max-height: 0;
}

/* Navigation Items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
    font-size: 13px;
}

.nav-item.sub-item {
    padding: 6px 12px 6px 40px;
    font-size: 12px;
    font-weight: 400;
}

.sub-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--text-dim);
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.15s ease;
}

.nav-item.sub-item:hover .sub-dot {
    background: var(--primary);
    box-shadow: none;
}

.nav-item.top-level {
    margin-top: 2px;
}

.nav-item:hover {
    background: var(--glass-highlight);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-muted);
    color: var(--primary);
}

.nav-item.active .sub-dot {
    background: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-top: 8px;
    background: var(--overlay-backdrop);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--account-avatar-bg);
    color: var(--account-avatar-fg);
    box-shadow: var(--account-avatar-ring);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    font-size: 10px;
    color: var(--text-dim);
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.logout-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logout-btn:hover {
    background: var(--status-danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* Main Content */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, var(--primary-glow), transparent 40%);
}

.top-bar {
    height: var(--header-h);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--overlay-backdrop);
    backdrop-filter: var(--glass);
}

.view-container {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.view {
    min-height: 100%;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Authentication Layout (Full Screen) */
body.auth-layout .sidebar,
body.auth-layout .top-bar {
    display: none !important;
}

/* =============================================================================
   ADMIN UI SIMPLIFICATION
   Flat shell, attached surfaces, quieter interactions
   ============================================================================= */

.sidebar {
    background: var(--bg-panel);
    padding: 16px 10px;
}

.brand {
    margin-bottom: 18px;
}

.nav-group-label {
    padding: 14px 12px 6px;
    color: var(--text-dim);
    font-weight: 600;
}

.nav-link,
.nav-item {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.nav-link:hover,
.nav-item:hover {
    background: var(--bg-interactive);
    border-color: var(--border-subtle);
}

.nav-link.active,
.nav-item.active {
    background: color-mix(in srgb, var(--primary) 14%, var(--bg-interactive));
    border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
    color: var(--text-main);
}

.nav-link.active .nav-icon,
.nav-item.active .sub-dot {
    opacity: 1;
}

.sidebar-footer {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.user-badge {
    min-width: 0;
}

.user-avatar {
    background: var(--account-avatar-bg);
    color: var(--account-avatar-fg);
    box-shadow: var(--account-avatar-ring);
    border-radius: var(--radius-lg);
}

.logout-btn {
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.logout-btn:hover {
    background: var(--danger-muted);
}

.main {
    background: var(--bg-void);
}

.top-bar {
    padding: 0 24px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.top-account {
    position: relative;
    display: flex;
    align-items: center;
}

.top-account-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.top-account-trigger:hover,
.top-account-trigger[aria-expanded="true"] {
    background: var(--bg-interactive);
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

.top-account-trigger .user-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
    font-size: 12px;
}

.account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 248px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-menu);
    z-index: 1000;
}

.account-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px 11px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 5px;
}

.account-menu-head .user-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
}

.account-menu-head .user-details {
    min-width: 0;
}

.account-menu-head .user-name,
.account-menu-head .user-role {
    display: block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-theme {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 42px;
    padding: 7px 9px;
    margin-bottom: 5px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.account-menu-theme:hover,
.account-menu-theme:focus-within {
    background: var(--bg-interactive);
    color: var(--text-main);
}

.account-menu-theme svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-menu-theme-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.account-menu-theme-label {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.account-menu-theme-state {
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.account-theme-switch {
    position: relative;
    display: inline-flex;
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
}

.account-theme-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.account-theme-slider {
    position: absolute;
    inset: 0;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg-interactive);
    transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    pointer-events: none;
}

.account-theme-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.account-theme-switch input:checked+.account-theme-slider {
    border-color: var(--primary);
    background: var(--primary-muted);
}

.account-theme-switch input:checked+.account-theme-slider::before {
    transform: translateX(16px);
    background: var(--primary);
}

.account-theme-switch input:focus-visible+.account-theme-slider {
    box-shadow: var(--focus-ring);
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    height: 36px;
    padding: 0 9px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.account-menu-item svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-menu-item:hover {
    background: var(--bg-interactive);
    color: var(--text-main);
}

.account-menu-item.danger:hover {
    background: var(--danger-muted);
    color: var(--danger);
}

@media (max-width: 720px) {
    .account-menu {
        right: -8px;
    }

    .top-bar {
        padding: 0 16px;
    }

    .top-actions {
        gap: 8px;
    }

    .top-plan-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

.view-container {
    padding: 24px;
}

.panel-row {
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.section-header {
    margin-bottom: 20px;
}

.card-header {
    padding: 14px 16px;
}

.tile {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.tile-hover {
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.tile-hover:hover {
    background: var(--bg-card-hover);
    border-color: var(--border);
}

.status-dot,
.status-dot-pulse {
    box-shadow: none !important;
    animation: none !important;
}

body.auth-layout .main {
    background: var(--bg-void);
    /* Solid background or specific auth gradient */
    margin: 0;
    padding: 0;
    height: 100vh;
}

body.auth-layout .view-container {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--auth-radial);
}

/* =============================================================================
   DUAL THEME SHELL NORMALIZATION
   Keeps navigation, chrome, and reusable layout primitives token-driven.
   ============================================================================= */

body,
.main,
.app-shell {
    background: var(--surface-base);
    color: var(--text-main);
}

.sidebar,
.top-bar {
    background: var(--surface-panel);
    border-color: var(--divider-muted);
}

.nav-section-header:hover,
.nav-item:hover,
.nav-link:hover {
    background: var(--surface-interactive);
    color: var(--text-main);
}

.nav-item.active,
.nav-link.active,
.nav-section-header[aria-expanded="true"] {
    background: var(--surface-selected);
    border-color: var(--status-primary-border);
    color: var(--text-main);
}

.sidebar-footer,
.panel-row,
.tile,
.account-menu,
.top-account-trigger {
    background: var(--surface-card);
    border-color: var(--divider);
}

.account-menu {
    box-shadow: var(--shadow-popover);
}

.view-container {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 5%, transparent), transparent 34%),
        var(--surface-base);
}

.top-account-trigger:hover,
.account-menu-theme:hover,
.account-menu-theme:focus-within,
.account-menu-item:hover,
.tile-hover:hover {
    background: var(--surface-interactive);
    border-color: var(--divider);
}

.account-theme-slider {
    background: var(--surface-interactive);
    border-color: var(--input-border);
}

/* =============================================================================
   LIGHT THEME SHELL OVERRIDES
   Ensures clean white canvas in light mode edge-to-edge.
   ============================================================================= */

[data-theme="light"] body,
[data-theme="light"] .main,
[data-theme="light"] .app-shell,
[data-theme="light"] .view-container,
[data-theme="light"] #view-root,
[data-theme="light"] .view {
    background: var(--operator-surface, #ffffff) !important;
}

/* Sidebar — subtle warm grey, separated from white content area */
[data-theme="light"] .sidebar {
    background: #f8f9fa;
    border-right: 1px solid #eaecf0;
}

/* Top bar — white with clean border, no glass/tint */
[data-theme="light"] .top-bar {
    background: #ffffff;
    border-bottom: 1px solid #eaecf0;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
    backdrop-filter: none;
}

/* Nav hover — neutral grey, not primary-tinted */
[data-theme="light"] .nav-section-header:hover,
[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-link:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Nav active — blue text on light blue bg */
[data-theme="light"] .nav-item.active,
[data-theme="light"] .nav-link.active,
[data-theme="light"] .nav-section-header[aria-expanded="true"] {
    background: var(--control-accent-soft);
    border-color: var(--control-accent-soft);
    color: var(--control-accent);
}

/* Account trigger & menu */
[data-theme="light"] .top-account-trigger,
[data-theme="light"] .account-menu {
    background: #ffffff;
    border-color: #eaecf0;
}

[data-theme="light"] .top-account-trigger:hover,
[data-theme="light"] .account-menu-theme:hover,
[data-theme="light"] .account-menu-theme:focus-within,
[data-theme="light"] .account-menu-item:hover {
    background: #f3f4f6;
}

/* Theme toggle slider */
[data-theme="light"] .account-theme-slider {
    background: #e9eaec;
    border-color: #d0d5dd;
}

/* =============================================================================
   OPERATOR WORKSPACE SHELL
   Cloudflare-inspired single workspace with line divisions.
   ============================================================================= */

:root {
    --operator-shell-bg: #f3f4f6;
    --operator-surface: #ffffff;
    --operator-line: #d9dde3;
    --operator-line-soft: #eceff3;
    --operator-link: var(--primary);
    --operator-link-hover: var(--primary-hover);
    --operator-orange: var(--brand-orange);
}

body {
    background: var(--operator-shell-bg);
}

.app-shell {
    background: var(--operator-surface);
}

.sidebar {
    width: 254px;
    padding: 0;
    background: var(--operator-surface);
    border-right: 1px solid var(--operator-line);
}

.brand {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    margin: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--operator-line-soft);
}



.nav-menu {
    padding: 4px 8px 40px;
}

/* Search Box */
.sidebar-search-box {
    margin: 8px 10px 14px;
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-search-box .search-icon {
    position: absolute;
    left: 11px;
    width: 15px;
    height: 15px;
    color: var(--text-dim, #64748b);
    pointer-events: none;
    transition: color 0.15s ease;
}

.sidebar-search-box:focus-within .search-icon {
    color: var(--control-accent, #3b82f6);
}

.sidebar-search-input,
#sidebar-quick-search {
    width: 100%;
    height: 36px;
    padding: 0 30px 0 34px;
    background: color-mix(in srgb, var(--operator-surface-muted, #f8fafc) 50%, transparent);
    border: 1px solid var(--operator-line, rgba(255, 255, 255, 0.1));
    border-radius: 7px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-main, #e2e8f0);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.sidebar-search-input::placeholder,
#sidebar-quick-search::placeholder {
    color: var(--text-dim, #64748b);
    font-size: 13px;
}

.sidebar-search-input:hover,
#sidebar-quick-search:hover {
    border-color: var(--operator-line-strong, rgba(255, 255, 255, 0.18));
}

.sidebar-search-input:focus,
#sidebar-quick-search:focus {
    border-color: var(--control-accent, #3b82f6);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--control-accent, #3b82f6) 20%, transparent);
    background: color-mix(in srgb, var(--operator-surface-muted, #f8fafc) 80%, transparent);
}

.sidebar-search-clear {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-dim, #64748b);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.sidebar-search-clear:hover {
    color: var(--text-main, #ffffff);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-search-clear svg {
    width: 13px;
    height: 13px;
}

.sidebar-search-clear.hidden {
    display: none !important;
}

/* Category Labels */
.nav-category-label,
.nav-group-label {
    padding: 20px 12px 8px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-dim, #71717a);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    user-select: none;
}

.nav-menu > .nav-category-label:first-child,
.nav-menu > .nav-group-label:first-child {
    padding-top: 6px;
}

/* Accordion Group Container */
.nav-domain-group {
    margin-bottom: 4px;
}

/* Accordion Header Button */
.nav-domain-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary, #cbd5e1);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease, color 0.12s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.nav-domain-header:hover {
    background: color-mix(in srgb, var(--operator-surface-muted, rgba(255, 255, 255, 0.07)) 80%, transparent);
    color: var(--text-main, #ffffff);
}

.nav-domain-header:focus-visible {
    outline: 2px solid var(--control-accent, #3b82f6);
    outline-offset: -2px;
}

.nav-domain-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nav-domain-title .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-domain-chevron {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--text-dim, #64748b);
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease;
}

.nav-domain-group.is-open>.nav-domain-header .nav-domain-chevron {
    transform: rotate(90deg);
    color: var(--text-secondary, #cbd5e1);
}

.nav-domain-group.has-active-child>.nav-domain-header {
    color: var(--text-main, #ffffff);
    font-weight: 600;
}

/* Vertical Tree Guide Line & Nested Sub-Links */
.nav-domain-children {
    display: none;
    position: relative;
    margin-left: 21px;
    padding-left: 16px;
    border-left: 1.5px solid var(--operator-line, rgba(255, 255, 255, 0.12));
}

.nav-domain-group.is-open>.nav-domain-children {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 5px;
    padding-bottom: 10px;
}

.nav-sub-link {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--text-dim, #94a3b8);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.nav-sub-link:hover {
    background: color-mix(in srgb, var(--operator-surface-muted, rgba(255, 255, 255, 0.07)) 80%, transparent);
    color: var(--text-main, #ffffff);
}

.nav-sub-link.active {
    background: color-mix(in srgb, var(--control-accent, #3b82f6) 16%, transparent) !important;
    color: var(--control-accent, #60a5fa) !important;
    font-weight: 600;
}

.nav-domain-group.hidden,
.nav-link.hidden,
.nav-sub-link.hidden,
.nav-category-label.hidden,
.nav-group-label.hidden,
.enterprise-nav-item.hidden {
    display: none !important;
}

.nav-link,
.nav-item {
    min-height: 38px;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    gap: 12px;
    margin-bottom: 4px;
}

.nav-link:hover,
.nav-item:hover {
    background: color-mix(in srgb, var(--operator-surface-muted, rgba(255, 255, 255, 0.07)) 80%, transparent);
    color: var(--text-main);
}

.nav-link.active,
.nav-item.active {
    background: color-mix(in srgb, var(--control-accent, #3b82f6) 16%, transparent);
    color: var(--control-accent, #60a5fa);
    font-weight: 600;
    border: 0;
}

.nav-link.active .nav-icon {
    color: var(--control-accent, #60a5fa);
    stroke: var(--control-accent, #60a5fa);
}

[data-theme="light"] .sidebar-search-box .search-icon {
    color: #94a3b8;
}

[data-theme="light"] .sidebar-search-box:focus-within .search-icon {
    color: #2563eb;
}

[data-theme="light"] .sidebar-search-input,
[data-theme="light"] #sidebar-quick-search {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .sidebar-search-input:hover,
[data-theme="light"] #sidebar-quick-search:hover {
    border-color: #cbd5e1;
}

[data-theme="light"] .sidebar-search-input:focus,
[data-theme="light"] #sidebar-quick-search:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15), 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .sidebar-search-input::placeholder,
[data-theme="light"] #sidebar-quick-search::placeholder {
    color: #94a3b8;
}

[data-theme="light"] .sidebar-search-clear {
    color: #94a3b8;
}

[data-theme="light"] .sidebar-search-clear:hover {
    color: #0f172a;
    background: #e2e8f0;
}

[data-theme="light"] .nav-category-label,
[data-theme="light"] .nav-group-label {
    color: #64748b;
}

[data-theme="light"] .nav-domain-header {
    color: #334155;
}

[data-theme="light"] .nav-domain-header:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="light"] .nav-domain-children {
    border-left-color: #e2e8f0;
}

[data-theme="light"] .nav-sub-link {
    color: #475569;
}

[data-theme="light"] .nav-sub-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="light"] .nav-sub-link.active {
    background: rgba(37, 99, 235, 0.09) !important;
    color: #2563eb !important;
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="light"] .nav-link.active,
[data-theme="light"] .nav-item.active {
    background: rgba(37, 99, 235, 0.09);
    color: #2563eb;
}

[data-theme="light"] .nav-link.active .nav-icon {
    color: #2563eb;
    stroke: #2563eb;
}

.sidebar-user-chip {
    margin: auto 0 0;
    padding: 12px 16px;
    border-top: 1px solid var(--operator-line-soft);
    background: var(--operator-surface);
}

.main {
    background: var(--operator-surface);
}

.top-bar {
    height: 66px;
    padding: 0 24px 0 32px;
    background: var(--operator-surface);
    border-bottom: 1px solid var(--operator-line);
    box-shadow: none;
}

.top-bar .title-sm {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 650;
}

.top-plan,
.top-account-trigger {
    background: var(--operator-surface);
    border-color: var(--operator-line);
    box-shadow: none;
}

.top-plan {
    border-radius: 999px;
    cursor: pointer;
}

.top-plan-name {
    color: var(--text-main);
}

.top-plan-upgrade {
    background: var(--operator-link, var(--primary, #f97316));
    border-color: var(--operator-link, var(--primary, #f97316));
    border-radius: 999px;
    color: #ffffff;
}

.top-plan-upgrade:hover {
    background: var(--operator-link-hover, var(--primary-hover, #ea580c));
    border-color: var(--operator-link-hover, var(--primary-hover, #ea580c));
}

.view-container,
#view-root {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    background: var(--operator-surface, #ffffff);
    display: flex;
    flex-direction: column;
}

.view {
    min-height: 100%;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--operator-surface, #ffffff);
}

.view.view-operator {
    min-height: 100%;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--operator-surface, #ffffff);
}

.view > div,
.view-operator > div,
#dashboard-content,
#waf-config-content,
#traffic-config-content,
#antibots-config-content,
#apisecurity-config-content,
#httpsecurity-config-content,
#access-config-content,
#routes-container,
#proxy-settings-container,
#settings-container,
#users-container,
#profile-container,
#audit-logs-container,
#ssl-container,
#challenge-config-content,
#captcha-config-content,
#modules-dashboard {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    width: 100%;
    background: var(--operator-surface, #ffffff);
}

.view:not(.view-operator) {
    padding: 24px;
}

[data-theme="dark"] {
    --operator-shell-bg: #0f1115;
    --operator-surface: #11141a;
    --operator-line: rgba(248, 250, 252, 0.13);
    --operator-line-soft: rgba(248, 250, 252, 0.08);
    --operator-link: var(--control-accent);
    --operator-link-hover: var(--control-accent);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-link.active,
[data-theme="dark"] .nav-item.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .top-bar {
        padding: 0 16px;
    }

    .view:not(.view-operator) {
        padding: 16px;
    }
}

/* =============================================================================
   ENTERPRISE SETTINGS WORKBENCH
   Two-column category rail with zero horizontal tabs
   ============================================================================= */

.settings-workbench-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.settings-category-rail {
    background: var(--operator-surface, #ffffff);
    border: 1px solid var(--operator-line, #d9dde3);
    border-radius: var(--radius-sm, 2px);
    overflow: hidden;
    position: sticky;
    top: 24px;
}

.settings-rail-header {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #718096);
    background: color-mix(in srgb, var(--operator-surface-muted, #f7f8fa) 60%, transparent);
    border-bottom: 1px solid var(--operator-line-soft, #eceff3);
}

.settings-rail-nav {
    display: flex;
    flex-direction: column;
    padding: 6px;
    gap: 2px;
}

.settings-rail-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-sm, 2px);
    background: transparent;
    color: var(--text-main, #2d3748);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
}

.settings-rail-btn:hover {
    background: var(--operator-surface-muted, #f7f8fa);
    color: var(--text-main, #1a202c);
}

.settings-rail-btn.is-active {
    background: color-mix(in srgb, var(--control-accent, #3182ce) 12%, transparent);
    color: var(--control-accent, #2b6cb0);
    font-weight: 600;
}

[data-theme="dark"] .settings-category-rail {
    background: var(--operator-surface, #11141a);
    border-color: var(--operator-line, rgba(248, 250, 252, 0.13));
}

[data-theme="dark"] .settings-rail-header {
    background: color-mix(in srgb, var(--operator-surface, #11141a) 96%, var(--bg-primary));
    border-bottom-color: var(--operator-line-soft, rgba(248, 250, 252, 0.08));
    color: var(--text-muted, #a0aec0);
}

[data-theme="dark"] .settings-rail-btn {
    color: var(--text-main, #e2e8f0);
}

[data-theme="dark"] .settings-rail-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

[data-theme="dark"] .settings-rail-btn.is-active {
    background: color-mix(in srgb, var(--control-accent, #63b3ed) 18%, transparent);
    color: var(--control-accent, #90cdf4);
}

.settings-rail-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.settings-rail-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.settings-rail-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.settings-rail-title {
    font-size: 13px;
    font-weight: 600;
}

.settings-rail-desc {
    font-size: 11px;
    color: var(--text-muted, #718096);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .settings-rail-desc {
    color: var(--text-muted, #a0aec0);
}

.settings-panel-stage {
    min-width: 0;
}

@media (max-width: 1024px) {
    .settings-workbench-layout {
        grid-template-columns: 1fr;
    }

    .settings-category-rail {
        position: static;
    }
}