:root {
            --nx-body: #eef2f7;
            --nx-body-alt: #f8fafc;
            --nx-surface: #ffffff;
            --nx-surface-soft: #f8fafc;
            --nx-surface-elevated: #f1f5f9;
            --nx-ink: #0f172a;
            --nx-ink-soft: #334155;
            --nx-muted: #64748b;
            --nx-border: rgba(15, 23, 42, 0.06);
            --nx-header: rgba(255, 255, 255, 0.82);
            --nx-header-deep: rgba(248, 250, 252, 0.96);
            --nx-sidebar: #0f172a;
            --nx-sidebar-alt: #111827;
            --nx-sidebar-line: rgba(255, 255, 255, 0.06);
            --nx-toolbar-panel: #16265a;
            --nx-toolbar-panel-line: rgba(191, 219, 254, 0.16);
            --nx-accent: #3b82f6;
            --nx-accent-soft: rgba(59, 130, 246, 0.16);
            --nx-accent-lilac: #8b5cf6;
            --nx-danger: #fb7185;
            --nx-warning: #f59e0b;
            --nx-success: #34d399;
            --nx-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }

        html {
            background: #2f3439;
            font-size: 15px;
        }

        body {
            margin: 0;
            min-height: 100vh;
            font-family: "Manrope", sans-serif;
            color: var(--nx-ink);
            background: var(--nexus-page-background);
            overscroll-behavior-y: none;
        }

        select,
        option,
        optgroup {
            color-scheme: light;
        }

        select option {
            color: #0f172a !important;
            background: #ffffff !important;
        }

        select optgroup {
            color: #0f172a !important;
            background: #eef4fb !important;
        }

        input::placeholder,
        textarea::placeholder {
            color: #8aa0bc;
            opacity: 1;
        }

        i.bi {
            font-size: 0.85em;
        }

        .app-shell {
            min-height: 100vh;
        }

        .desktop-topbar,
        .mobile-topbar {
            background:
                linear-gradient(180deg, #1F3A5A 0%, #1F3A5A 100%);
            color: var(--nx-ink);
            backdrop-filter: blur(18px);
        }

        .desktop-topbar {
            min-height: 64px;
            border-bottom: 1px solid var(--nx-border);
            display: flex;
        }

        .desktop-topbar-main {
            min-width: 0;
            flex: 1 1 auto;
        }

        .mobile-topbar {
            display: none;
        }

        .brand-title-desktop {
            font-size: 0.92rem;
            font-weight: 800;
            letter-spacing: -0.04em;
            margin: 0;
            color: #ffffff;
        }

        .header-icon-btn {
            width: 30px;
            height: 30px;
            border: 0;
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.12);
            color: #ffffff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.68rem;
            position: relative;
            text-decoration: none;
            transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
            box-shadow: none;
        }

        .header-icon-btn.menu-toggle-btn {
            border: 0;
        }

        .desktop-topbar .menu-toggle-btn {
            width: 26px;
            height: 26px;
            background: rgba(255, 255, 255, 0.08);
            color: rgba(255, 255, 255, 0.92);
            font-size: 0.6rem;
        }

        .desktop-topbar .menu-toggle-btn:hover {
            background: rgba(255, 255, 255, 0.12);
        }

        .header-icon-btn + .header-icon-btn {
            margin-left: 0.35rem;
        }

        .header-icon-btn:hover {
            background: rgba(255, 255, 255, 0.16);
            color: #ffffff;
            transform: translateY(-1px);
        }

        .header-icon-badge {
            position: absolute;
            top: 6px;
            right: 6px;
            min-width: 15px;
            height: 15px;
            padding: 0 0.2rem;
            border-radius: 999px;
            background: linear-gradient(180deg, #ffb458 0%, #ff8d5d 100%);
            color: #fff;
            font-size: 0.55rem;
            font-weight: 800;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .top-mural {
            min-width: 0;
            flex: 1 1 320px;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            min-height: 34px;
            padding: 0.4rem 0.7rem;
            border: 0;
            border-radius: 6px;
            background: rgba(255,255,255,.12);
            box-shadow: none;
        }

        .top-mural-icon {
            flex: 0 0 auto;
            font-size: 0.72rem;
            color: #ffffff;
        }

        .top-mural-text {
            min-width: 0;
            flex: 1 1 auto;
            color: #ffffff;
            font-size: 0.74rem;
            font-weight: 700;
            line-height: 1.35;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .top-mural-empty {
            color: #ffffff;
            font-weight: 600;
        }

        .top-mural-edit {
            flex: 0 0 auto;
            color: #475569;
            text-decoration: none;
            width: 24px;
            height: 24px;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: rgba(15, 23, 42, 0.04);
            border: 1px solid rgba(15, 23, 42, 0.06);
        }

        .top-mural-edit:hover {
            color: var(--nx-ink);
            background: rgba(15, 23, 42, 0.08);
        }

        .topbar-search {
            width: min(100%, 190px);
            position: relative;
        }

        .topbar-search i {
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            color: #94a3b8;
            font-size: 0.78rem;
        }

        .topbar-search input {
            width: 100%;
            min-height: 34px;
            border-radius: 6px;
            border: 0;
            background: #ffffff;
            color: var(--nx-ink);
            padding: 0.52rem 0.75rem 0.52rem 2.1rem;
            box-shadow: none;
        }

        .topbar-search input::placeholder {
            color: #94a3b8;
        }

        .topbar-search input:focus {
            outline: none;
            border-color: rgba(91, 140, 255, 0.45);
            box-shadow: 0 0 0 0.18rem rgba(91, 140, 255, 0.1);
        }

        .admin-shell {
            display: grid;
            grid-template-columns: 252px minmax(0, 1fr);
            min-height: calc(100vh - 64px);
            transition: grid-template-columns 0.22s ease;
        }

        .sidebar-col {
            min-width: 0;
            overflow: hidden;
            transition: width 0.22s ease, opacity 0.18s ease;
        }

        .sidebar {
            background:
                radial-gradient(circle at top left, rgba(59, 130, 246, 0.10), transparent 22%),
                linear-gradient(180deg, var(--nx-sidebar) 0%, var(--nx-sidebar-alt) 100%);
            color: #fff;
            border-right: 1px solid var(--nx-border);
            height: 100%;
        }

        .sidebar-inner {
            padding: 1.15rem 0;
        }

        .sidebar-user {
            padding: 0 1rem 1.15rem;
            border-bottom: 1px solid var(--nx-sidebar-line);
        }

        .sidebar-user-head {
            display: flex;
            align-items: center;
            gap: 0.65rem;
        }

        .sidebar-user-details {
            min-width: 0;
            flex: 1 1 auto;
        }

        .sidebar-user-avatar {
            width: 34px;
            height: 34px;
            border-radius: 8px;
            overflow: hidden;
            flex: 0 0 auto;
            background: rgba(255, 255, 255, 0.12);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #ffffff;
        }

        .sidebar-user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .sidebar-user-name-row {
            display: flex;
            min-width: 0;
            align-items: center;
            gap: 0.45rem;
        }

        .sidebar-user-name {
            min-width: 0;
            flex: 1 1 auto;
            overflow: hidden;
            font-size: 0.86rem;
            font-weight: 800;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .sidebar-user-status {
            color: #a9bcda;
            font-size: 0.66rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.35rem;
            margin-top: 0.25rem;
        }

        .sidebar-profile-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            flex: 0 0 auto;
            color: #a9bcda;
            text-decoration: none;
            font-size: 0.72rem;
        }

        .sidebar-profile-link:hover {
            color: #ffffff;
        }

        .sidebar-user-status::before {
            content: "";
            width: 10px;
            height: 10px;
            border-radius: 999px;
            background: #4cc36b;
            display: inline-block;
        }

        .side-nav {
            display: grid;
            gap: 0.25rem;
            margin-top: 0.9rem;
            padding: 0 0.65rem;
        }

        .nav-pill {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            width: 100%;
            color: #b5c1d4;
            text-decoration: none;
            font-size: 0.74rem;
            font-weight: 700;
            padding: 0.52rem 0.65rem;
            border: 1px solid transparent;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.01);
            transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
        }

        .nav-pill:hover,
        .nav-pill.active {
            background: rgba(255, 255, 255, 0.04);
            border-color: var(--nx-border);
            color: #fff;
            transform: translateY(-1px);
        }

        .nav-pill.active {
            background: rgba(91, 140, 255, 0.10);
            box-shadow: none;
        }

        .nav-pill i {
            width: 18px;
            text-align: center;
            font-size: 0.74rem;
        }

        .nav-toggle {
            justify-content: space-between;
        }

        .nav-toggle-label {
            display: inline-flex;
            align-items: center;
            gap: 0.7rem;
            min-width: 0;
        }

        .nav-toggle-caret {
            width: 18px;
            height: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.6rem;
            color: #8fa6cb;
            transition: transform 0.2s ease, color 0.18s ease;
        }

        .nav-toggle[aria-expanded="true"] .nav-toggle-caret {
            transform: rotate(180deg);
        }

        .nav-toggle:hover .nav-toggle-caret,
        .nav-toggle.active .nav-toggle-caret {
            color: #ffffff;
        }

        .nav-group {
            display: grid;
        }

        .nav-children {
            display: grid;
            gap: 0.15rem;
            padding: 0.18rem 0 0.12rem 0;
        }

        .nav-child {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            min-height: 34px;
            padding: 0.44rem 0.65rem 0.44rem 1.25rem;
            color: rgba(214, 224, 247, 0.84);
            text-decoration: none;
            font-size: 0.68rem;
            font-weight: 600;
            border-radius: 9px;
            border: 1px solid transparent;
            background: rgba(9, 14, 33, 0.48);
            box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
            transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
        }

        .nav-child:hover {
            color: #fff;
            border-color: rgba(129, 149, 236, 0.24);
            background: linear-gradient(135deg, rgba(70, 90, 170, 0.22) 0%, rgba(102, 84, 192, 0.20) 100%);
            box-shadow: inset 0 0 0 1px rgba(173,188,255,.10), 0 10px 18px rgba(13,19,46,.22);
        }

        .nav-child.active {
            color: #f7f9ff;
            border-color: rgba(147, 131, 255, 0.42);
            background: linear-gradient(135deg, rgba(77, 95, 224, 0.45) 0%, rgba(130, 98, 255, 0.42) 100%);
            box-shadow: inset 0 0 0 1px rgba(196,183,255,.20), 0 14px 24px rgba(74,77,190,.28);
        }

        .sidebar-footer {
            padding: 0.8rem 1rem 1rem;
            margin-top: 0.45rem;
        }

        .sidebar-footer .button.secondary {
            width: 100%;
            justify-content: center;
        }

        .mobile-sidebar-panel,
        .mobile-sidebar-backdrop {
            display: none;
        }

        .main-content {
            padding: 1.25rem;
            min-width: 0;
            background: transparent;
            transition: transform 0.28s ease, filter 0.28s ease;
        }

        .app-shell.sidebar-collapsed .admin-shell {
            grid-template-columns: 0 minmax(0, 1fr);
        }

        .app-shell.sidebar-collapsed .sidebar-col {
            width: 0;
            opacity: 0;
        }

        .page-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 0.7rem;
            padding: 0.46rem 0.7rem;
            border: 1px solid var(--nx-toolbar-panel-line);
            border-radius: 6px;
            background: linear-gradient(180deg, var(--nx-toolbar-panel) 0%, var(--nx-toolbar-panel) 100%);
            box-shadow: 0 10px 28px rgba(8, 15, 36, 0.2);
        }

        .page-title-block {
            display: grid;
            gap: 0.08rem;
            align-content: center;
        }

        .welcome-kicker {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            width: fit-content;
            padding: 0.14rem 0.32rem;
            border-radius: 4px;
            border: 1px solid rgba(191, 219, 254, 0.14);
            background: rgba(255, 255, 255, 0.08);
            color: #dbeafe;
            font-size: 0.46rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }

        .welcome-kicker.welcome-kicker-theme {
            border-color: rgba(255, 255, 255, 0.18);
            background: rgba(255, 255, 255, 0.12);
            color: #ffffff;
        }

        .page-title-block h1 {
            font-size: clamp(0.9rem, 1.35vw, 1.1rem);
            font-weight: 800;
            margin: 0;
            letter-spacing: -0.055em;
            color: #ffffff;
            line-height: 1.08;
            text-align: left;
        }

        .topbar-meta {
            margin-top: 0.02rem;
            color: rgba(226, 232, 240, 0.82);
            font-size: 0.6rem;
            font-weight: 500;
            line-height: 1.25;
            text-align: left;
        }

        .page-toolbar .action-row {
            gap: 0.5rem;
            align-items: center;
        }

        .page-toolbar .button,
        .page-toolbar .btn-nexus {
            min-height: 34px;
            padding: 0.42rem 0.78rem;
            font-size: 0.68rem;
            border-radius: 4px;
            line-height: 1;
            text-align: center;
            white-space: nowrap;
        }

        .page-toolbar .button i,
        .page-toolbar .btn-nexus i {
            width: 12px;
            text-align: center;
            flex: 0 0 12px;
        }

        .page-toolbar .button.secondary,
        .page-toolbar .btn-outline-nexus {
            border-color: rgba(191, 219, 254, 0.16);
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.96) 100%);
            color: #0f172a;
        }

        .page-toolbar .button:hover,
        .page-toolbar .btn-nexus:hover {
            color: #ffffff;
        }

        .page-toolbar .button.secondary:hover,
        .page-toolbar .btn-outline-nexus:hover {
            color: #0f172a;
        }

        .page-panel,
        .panel,
        .card {
            background:
                linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
            border: 1px solid rgba(15, 23, 42, 0.06);
            border-radius: 16px;
            box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
            color: var(--nx-ink);
        }

        .page-panel,
        .panel {
            padding: 1rem;
        }

        .helper,
        .metric-note {
            color: #64748b;
            font-size: 0.82rem;
            line-height: 1.55;
        }

        .display-title {
            font-size: clamp(1.45rem, 2.8vw, 2rem);
            font-weight: 800;
            letter-spacing: -0.03em;
            margin: 0;
            color: #0f172a;
        }

        .eyebrow {
            margin: 0 0 0.35rem;
            color: #5b8cff;
            font-size: 0.66rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }

        .badge-soft {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.28rem 0.5rem;
            border-radius: 6px;
            background: rgba(59, 130, 246, 0.10);
            color: #3b82f6;
            font-size: 0.64rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .button,
        .btn-nexus {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.45rem;
            min-height: 34px;
            padding: 0.5rem 0.8rem;
            border-radius: 6px;
            border: 1px solid transparent;
            background: linear-gradient(135deg, #5b8cff 0%, #8c7bff 100%);
            color: #fff;
            text-decoration: none;
            font-size: 0.72rem;
            font-weight: 700;
            box-shadow: 0 8px 22px rgba(91, 140, 255, 0.18);
            transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
        }

        .button.secondary,
        .btn-outline-nexus {
            border-color: var(--nx-border);
            background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
            color: var(--nx-ink);
            box-shadow: none;
        }

        .button:hover,
        .button.secondary:hover,
        .btn-nexus:hover,
        .btn-outline-nexus:hover {
            color: inherit;
            transform: translateY(-1px);
            filter: brightness(1.04);
        }

        .flash {
            border-radius: 0.3rem;
            padding: 0.8rem 0.95rem;
            font-size: 0.86rem;
            font-weight: 600;
            margin-bottom: 1rem;
        }

        .flash.success {
            background: rgba(52, 211, 153, 0.12);
            border: 1px solid rgba(52, 211, 153, 0.18);
            color: #047857;
        }

        .flash.error {
            background: rgba(251, 113, 133, 0.12);
            border: 1px solid rgba(251, 113, 133, 0.18);
            color: #be123c;
        }

        .flash.warning {
            background: rgba(245, 158, 11, 0.12);
            border: 1px solid rgba(245, 158, 11, 0.18);
            color: #b45309;
        }

        .field {
            display: grid;
            gap: 0.45rem;
        }

        .field span {
            font-size: 0.72rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #90a4c6;
        }

        .field input,
        .field select,
        .field textarea {
            width: 100%;
            min-height: 40px;
            border: 1px solid var(--nx-border);
            border-radius: 14px;
            background: #ffffff;
            color: var(--nx-ink);
            padding: 0.75rem 0.8rem;
        }

        .field textarea {
            min-height: 140px;
            resize: vertical;
        }

        .field input:focus,
        .field select:focus,
        .field textarea:focus {
            outline: none;
            border-color: rgba(91, 140, 255, 0.6);
            box-shadow: 0 0 0 0.18rem rgba(91, 140, 255, 0.12);
        }

        .list-stack,
        .page-section,
        .detail-shell {
            display: grid;
            gap: 1rem;
        }

        .entity-row {
            display: grid;
            gap: 0.85rem;
        }

        .entity-meta,
        .info-grid,
        .metric-grid,
        .action-card-grid,
        .mini-stat-grid {
            display: grid;
            gap: 0.85rem;
        }

        .entity-meta {
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        }

        .info-grid,
        .metric-grid {
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        }

        .action-card-grid {
            grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        }

        .mini-stat-grid {
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        }

        .detail-stat,
        .mini-stat-card,
        .action-card {
            background: var(--nx-surface);
            border: 1px solid var(--nx-border);
            border-radius: 18px;
            padding: 0.85rem;
            box-shadow: var(--nx-shadow);
        }

        .detail-stat-label,
        .mini-stat-card small {
            display: block;
            font-size: 0.7rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #90a4c6;
        }

        .detail-stat-value,
        .mini-stat-card strong {
            display: block;
            margin-top: 0.45rem;
            font-size: 1.2rem;
            font-weight: 800;
            color: var(--nx-ink);
        }

        .mini-stat-card .mini-line {
            width: 52px;
            height: 3px;
            border-radius: 999px;
            margin-top: 0.7rem;
        }

        .mini-stat-blue .mini-line { background: #1fb6e2; }
        .mini-stat-orange .mini-line { background: #f39c12; }
        .mini-stat-green .mini-line { background: #0eb15d; }
        .mini-stat-yellow .mini-line { background: #d35400; }

        .surface-list > * + *,
        .separator-list > * + * {
            border-top: 1px solid #edf1f5;
            padding-top: 0.85rem;
            margin-top: 0.85rem;
        }

        .stack,
        .action-row {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
            align-items: center;
        }

        .stack {
            flex-direction: column;
            align-items: stretch;
        }

        /* Web unified look (non-Astro shell only) */
        .nx-web-shell .side-nav {
            gap: 0.3rem;
        }

        .nx-web-shell .nav-pill {
            font-size: 0.88rem;
            min-height: 40px;
            border-radius: 10px;
            padding: 0.52rem 0.7rem;
        }

        .nx-web-shell .nav-pill i {
            font-size: 0.88rem;
        }

        .nx-web-shell .nav-toggle-label span,
        .nx-web-shell .nav-pill > span {
            white-space: nowrap;
        }

        .nx-web-shell .nav-child {
            font-size: 0.8rem;
            min-height: 36px;
            border-radius: 9px;
        }

        .nx-web-shell .main-content {
            color: #0f172a;
            background:
                radial-gradient(circle at top left, rgba(59, 130, 246, 0.06), transparent 22%),
                radial-gradient(circle at top right, rgba(99, 102, 241, 0.06), transparent 20%),
                linear-gradient(180deg, #f3f6fb 0%, #f7f9fd 42%, #f9fbff 100%);
            border-left: 1px solid #dce5f1;
        }

        .nx-web-shell .page-toolbar {
            background: transparent;
            border: 0;
            box-shadow: none;
            padding: 0.15rem 0.08rem 0.3rem;
            margin-bottom: 0.85rem;
            gap: 0.65rem;
        }

        .nx-web-shell .welcome-kicker {
            border-color: rgba(59, 130, 246, 0.2);
            background: rgba(59, 130, 246, 0.08);
            color: #355c92;
            font-size: 0.58rem;
        }

        .nx-web-shell .welcome-kicker.welcome-kicker-theme {
            border-color: rgba(99, 102, 241, 0.22);
            background: rgba(99, 102, 241, 0.1);
            color: #4b50a7;
        }

        .nx-web-shell .page-title-block h1 {
            color: #0f2747;
            font-size: clamp(1.35rem, 2vw, 1.9rem);
            letter-spacing: -0.022em;
            line-height: 1.08;
        }

        .nx-web-shell .topbar-meta {
            color: #5f7595;
            font-size: 0.78rem;
            margin-top: 0.08rem;
        }

        .nx-web-shell .panel,
        .nx-web-shell .card,
        .nx-web-shell .page-panel,
        .nx-web-shell .detail-stat,
        .nx-web-shell .mini-stat-card,
        .nx-web-shell .action-card {
            background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
            border: 1px solid #dbe5f0;
            border-radius: 12px;
            box-shadow: 0 8px 18px rgba(15, 35, 60, 0.06);
        }

        .nx-web-shell .panel,
        .nx-web-shell .page-panel {
            padding: 0.9rem;
        }

        .nx-web-shell .field span,
        .nx-web-shell label {
            color: #5d7494;
            font-weight: 700;
        }

        .nx-web-shell .field input,
        .nx-web-shell .field select,
        .nx-web-shell .field textarea,
        .nx-web-shell .main-content input,
        .nx-web-shell .main-content select,
        .nx-web-shell .main-content textarea {
            border: 1px solid #d8e2ef;
            border-radius: 10px;
            background: #f8fbff;
            color: #243a5a;
            min-height: 40px;
        }

        .nx-web-shell .main-content input:focus,
        .nx-web-shell .main-content select:focus,
        .nx-web-shell .main-content textarea:focus {
            outline: none;
            border-color: rgba(83, 117, 224, 0.55);
            box-shadow: 0 0 0 0.16rem rgba(83, 117, 224, 0.12);
            background: #ffffff;
        }

        .nx-web-shell .button,
        .nx-web-shell .btn,
        .nx-web-shell .btn-nexus {
            min-height: 40px;
            border-radius: 9px;
            font-size: 0.82rem;
            font-weight: 700;
            background: linear-gradient(135deg, #6f5cff 0%, #5f72ff 100%);
            border-color: transparent;
            color: #ffffff;
            box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
        }

        .nx-web-shell .button.secondary,
        .nx-web-shell .btn-outline-nexus {
            border: 1px solid #d8e2ef;
            background: #ffffff;
            color: #1f3758;
            box-shadow: none;
        }

        .nx-web-shell .main-content table {
            border-collapse: separate;
            border-spacing: 0;
            width: 100%;
            background: #ffffff;
            border: 1px solid #dbe5f0;
            border-radius: 10px;
            overflow: hidden;
        }

        .nx-web-shell .main-content th {
            background: #f3f7fd;
            color: #2c4568;
            font-size: 0.78rem;
            font-weight: 700;
            border-bottom: 1px solid #dbe5f0;
        }

        .nx-web-shell .main-content td {
            color: #243a5a;
            border-bottom: 1px solid #e8eef7;
        }

        .nx-web-shell .main-content tr:last-child td {
            border-bottom: 0;
        }

        .auth-plain .main-content {
            padding: 0;
        }

        .auth-plain {
            background: linear-gradient(180deg, #101b31 0%, #0a1324 100%);
        }

        .auth-plain .app-shell,
        .auth-plain .admin-shell,
        .auth-plain .main-content {
            min-height: 100vh;
        }

        .auth-plain .admin-shell {
            display: block;
        }

        .auth-plain .main-content {
            width: 100%;
        }

        @media (max-width: 991.98px) {
            .admin-shell {
                grid-template-columns: 244px minmax(0, 1fr);
            }

            .main-content {
                padding: 0.8rem;
            }

            .page-toolbar {
                flex-direction: column;
                align-items: stretch;
            }

            .page-toolbar .action-row,
            .page-toolbar .d-flex.flex-wrap.gap-2 {
                display: none !important;
            }

            .topbar-search {
                display: none;
            }

            .panel,
            .card,
            .page-panel {
                border-radius: 0.3rem;
                padding: 0.85rem;
            }
        }

        @media (max-width: 575.98px) {
            .info-grid,
            .metric-grid,
            .action-card-grid,
            .mini-stat-grid {
                grid-template-columns: 1fr;
            }

            .button,
            .btn-nexus,
            .button.secondary,
            .btn-outline-nexus {
                width: 100%;
            }

            .header-icon-btn {
                width: 40px;
            }
        }

        @media (max-width: 767.98px) {
            :root {
                --nx-mobile-topbar-height: 60px;
            }

            .desktop-topbar {
                display: none;
            }

            .app-shell {
                padding-top: var(--nx-mobile-topbar-height);
            }

            .mobile-topbar {
                display: block;
                padding: 0;
                min-height: var(--nx-mobile-topbar-height);
                border-bottom: 1px solid rgba(255, 255, 255, 0.12);
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                z-index: 1045;
                transition: transform 0.28s ease;
            }

            .mobile-topbar-inner {
                display: grid;
                grid-template-columns: 44px minmax(0, 1fr);
                align-items: center;
                gap: 0.75rem;
                padding: 0.35rem 0.55rem;
            }

            .mobile-topbar .top-mural {
                min-width: 0;
                min-height: 38px;
                padding: 0.38rem 0.55rem;
                border-radius: 10px;
            }

            .mobile-topbar .top-mural-text {
                font-size: 0.68rem;
            }

            .mobile-topbar .top-mural-edit {
                width: 22px;
                height: 22px;
                color: #ffffff;
                background: rgba(255, 255, 255, 0.1);
                border-color: rgba(255, 255, 255, 0.08);
            }

            .mobile-topbar .top-mural-empty {
                color: rgba(255, 255, 255, 0.82);
            }

            .mobile-topbar-mural {
                min-width: 0;
                overflow: hidden;
            }

            .admin-shell {
                grid-template-columns: 1fr;
                min-height: calc(100vh - var(--nx-mobile-topbar-height));
                position: relative;
            }

            .sidebar-col {
                display: none;
            }

            .mobile-sidebar-panel {
                display: block;
                position: fixed;
                top: var(--nx-mobile-topbar-height);
                left: 0;
                bottom: 0;
                width: min(68vw, 272px);
                z-index: 1040;
                transform: translateX(-100%);
                transition: transform 0.28s ease;
                box-shadow: 20px 0 40px rgba(15, 23, 42, 0.24);
            }

            .mobile-sidebar-panel .sidebar {
                min-height: 100%;
            }

            .mobile-sidebar-panel .sidebar-inner {
                padding-top: 0;
            }

            .mobile-sidebar-panel .sidebar-user {
                padding-top: 1rem;
            }

            .mobile-sidebar-panel .sidebar-footer {
                margin-top: 0;
                padding-top: 0.2rem;
                padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
            }

            .mobile-sidebar-panel .sidebar-footer .button.secondary {
                background: #ffffff;
                color: #0f172a;
                border-color: rgba(255, 255, 255, 0.18);
            }

            .mobile-sidebar-panel .sidebar-footer .button.secondary:hover {
                color: #0f172a;
                background: #f8fafc;
            }

            .mobile-sidebar-head {
                display: none;
            }

            .mobile-sidebar-backdrop {
                display: block;
                position: fixed;
                inset: var(--nx-mobile-topbar-height) 0 0 0;
                background: rgba(6, 10, 24, 0.26);
                backdrop-filter: blur(3px);
                -webkit-backdrop-filter: blur(3px);
                opacity: 0;
                visibility: hidden;
                transition: opacity 0.28s ease, visibility 0.28s ease;
                z-index: 1035;
            }

            .app-shell.mobile-sidebar-open .mobile-sidebar-panel {
                transform: translateX(0);
            }

            .app-shell.mobile-sidebar-open .main-content {
                transform: translateX(min(63vw, 248px));
            }

            .app-shell.mobile-sidebar-open .main-content {
                filter: blur(4px) saturate(0.88) brightness(0.78);
            }

            .app-shell.mobile-sidebar-open .mobile-sidebar-backdrop {
                opacity: 1;
                visibility: visible;
            }

            /* Global mobile hardening for all content pages */
            .main-content {
                padding: 0.7rem;
                overflow-x: clip;
            }

            .page-toolbar h1 {
                font-size: clamp(1.1rem, 5.5vw, 1.45rem);
            }

            .panel,
            .card,
            .page-panel,
            .ui-page-header,
            .ui-info-card,
            .ui-action-card,
            .ui-metric-card {
                padding: 0.58rem !important;
                border-radius: 0.22rem !important;
            }

            .main-content table {
                display: block;
                width: 100%;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                white-space: nowrap;
            }

            .main-content img,
            .main-content video,
            .main-content canvas,
            .main-content svg {
                max-width: 100%;
                height: auto;
            }

            .main-content .stack,
            .main-content .action-row {
                gap: 0.38rem;
            }

            .main-content .button,
            .main-content .btn-nexus,
            .main-content .button.secondary,
            .main-content .btn-outline-nexus {
                width: 100%;
            }
        }

        /* Cross-module consistency layer */
        .main-content .panel,
        .main-content .card,
        .main-content .page-panel {
            border-width: 1px;
        }

        .main-content h1,
        .main-content h2,
        .main-content h3 {
            letter-spacing: -0.01em;
        }

        .main-content .button,
        .main-content .btn,
        .main-content .btn-nexus,
        .main-content .btn-outline-nexus {
            min-height: 40px;
        }

        .main-content input,
        .main-content select,
        .main-content textarea,
        .main-content button,
        .main-content .button,
        .main-content .btn {
            font-size: 0.95rem;
        }

        @media (max-width: 767.98px) {
            .main-content input,
            .main-content select,
            .main-content textarea,
            .main-content button,
            .main-content .button,
            .main-content .btn,
            .main-content a.button {
                min-height: 44px !important;
            }

            .main-content .panel,
            .main-content .card,
            .main-content .page-panel {
                box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08) !important;
            }

            .main-content .display-title,
            .main-content .ttl {
                font-size: clamp(1.1rem, 6vw, 1.35rem) !important;
                line-height: 1.15;
            }

            .main-content .helper,
            .main-content small,
            .main-content .meta,
            .main-content .sub {
                font-size: 0.78rem !important;
                line-height: 1.45;
            }

            /* Legacy page-kit normalization (customers/invoices/contracts/etc.) */
            .main-content .hero,
            .main-content .card,
            .main-content .tbl {
                padding: 0.62rem !important;
                border-radius: 0.2rem !important;
            }

            .main-content .grid,
            .main-content .hero-in,
            .main-content .plan-meta,
            .main-content .crm-form-grid {
                display: grid !important;
                grid-template-columns: 1fr !important;
                gap: 0.5rem !important;
            }

            .main-content .row,
            .main-content .head,
            .main-content .th,
            .main-content .act {
                flex-direction: column !important;
                align-items: stretch !important;
                gap: 0.45rem !important;
            }

            .main-content .tabs {
                overflow-x: auto;
                white-space: nowrap;
                flex-wrap: nowrap !important;
                -webkit-overflow-scrolling: touch;
            }

            .main-content .tabs a {
                min-height: 40px !important;
                padding: 0.45rem 0.62rem !important;
            }

            .main-content .wrap {
                overflow-x: auto !important;
                -webkit-overflow-scrolling: touch;
            }

            .main-content .wrap table {
                min-width: 640px !important;
            }

            .main-content .pill,
            .main-content .chip {
                min-height: 28px !important;
                font-size: 0.68rem !important;
            }
        }
