/**
 * EnterpriseCMS admin shell
 * Dashboard-like layout inspired by the reference image.
 */

:root {
    --shell-bg: #f3f6fa;
    --surface: #ffffff;
    --surface-soft: #fafbff;
    --surface-muted: #f6f7fb;
    --line: #e7eaf3;
    --line-strong: #d8dfec;
    --text: #1f2937;
    --text-soft: #6b7280;
    --text-faint: #9aa4b2;
    --nav-bg: #172033;
    --nav-hover: #253047;
    --nav-active: #ffffff;
    --brand: #2563eb;
    --brand-strong: #1d4ed8;
    --brand-soft: #edf2ff;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 8px 18px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 16px 38px rgba(15, 23, 42, 0.08);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --sidebar-w: 86px;
    --sidebar-expanded: 176px;
    --topbar-h: 74px;
    --font: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(37, 99, 235, 0.08), transparent 28%),
        var(--shell-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after { scroll-behavior:auto!important; transition-duration:.01ms!important; animation-duration:.01ms!important; animation-iteration-count:1!important; }
}

body.admin-shell {
    display: flex;
    overflow: hidden;
}

.mobile-menu-toggle {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 1200;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    color: var(--text);
    display: none;
    align-items: center;
    justify-content: center;
}

.sidebar-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 1090;
}

.sidebar-mask.is-visible {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    width: var(--sidebar-expanded);
    height: 100vh;
    background:
        linear-gradient(180deg, #1b263a 0%, #111827 100%);
    color: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #2563eb;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0;
}

.sidebar-brand-copy {
    min-width: 0;
}

.sidebar-brand-copy strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.sidebar-brand-copy span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.56);
}

.sidebar-announce,
.sidebar-footer {
    margin: 18px 16px 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-announce-label,
.sidebar-footer-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.56);
}

.sidebar-announce-value,
.sidebar-footer-value {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.5;
    word-break: break-all;
}

.sidebar-nav {
    flex: 1;
    padding: 18px 10px 20px;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.nav-link,
.nav-sublink {
    width: 100%;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover,
.nav-sublink:hover {
    background: var(--nav-hover);
    color: #fff;
}

.nav-link.is-active,
.nav-sublink.is-active {
    background: var(--nav-active);
    color: var(--brand-strong);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.nav-link.is-active::before,
.nav-sublink.is-active::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 11px;
    bottom: 11px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--brand), #8aa2ff);
}

.nav-icon {
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    font-size: 16px;
}

.nav-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}

.nav-group {
    margin-top: 8px;
}

.nav-group-toggle {
    position: relative;
}

.nav-arrow {
    font-size: 16px;
    transition: transform 0.18s ease;
}

.nav-group.is-open .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    padding: 8px 0 0 12px;
}

.nav-group.is-open .nav-submenu {
    display: block;
}

.nav-sublink {
    min-height: 40px;
    padding-left: 18px;
    font-size: 13px;
}

.nav-sublink i {
    width: 16px;
    text-align: center;
    color: inherit;
}

.shell-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 24px 0 20px;
    flex-shrink: 0;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-chip {
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    color: var(--text-soft);
}

.topbar-chip-brand {
    max-width: 620px;
    color: var(--brand-strong);
    background: linear-gradient(90deg, #eef3ff 0%, #fff9ea 100%);
    border-color: #dfe7ff;
}

.topbar-chip-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-action,
.topbar-user {
    height: 40px;
    border-radius: 999px;
    padding: 0 14px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.topbar-action:hover,
.topbar-user:hover {
    background: var(--surface-muted);
    border-color: var(--line);
    color: var(--text);
}

.topbar-action-primary {
    background: linear-gradient(135deg, var(--brand) 0%, #6a86ff 100%);
    color: #fff;
    border-color: transparent;
}

.topbar-action-primary:hover {
    background: linear-gradient(135deg, #3d63f3 0%, #5978ff 100%);
    color: #fff;
}

.topbar-action-toggle {
    border-color: var(--line);
    background: var(--surface-muted);
    color: var(--text);
}

.topbar-action-ghost {
    color: #8b95a7;
}

.topbar-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-style: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-user {
    background: var(--surface-muted);
    border-color: var(--line);
    padding-right: 12px;
}

.topbar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c73ff 0%, #85a3ff 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.topbar-user-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.topbar-user-copy strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.topbar-user-copy small {
    font-size: 11px;
    color: var(--text-faint);
}

.workspace {
    flex: 1;
    min-height: 0;
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255,255,255,.98) 0%, rgba(248,251,255,.98) 100%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.workspace-eyebrow {
    font-size: 12px;
    color: var(--brand-strong);
    font-weight: 700;
}

.workspace-header h1 {
    margin: 6px 0 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.workspace-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.workspace-meta-item {
    min-width: 170px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
}

.workspace-meta-item span {
    display: block;
    font-size: 12px;
    color: var(--text-faint);
}

.workspace-meta-item strong {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text);
    word-break: break-all;
}

.shell-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #fde68a;
    background: #fff8db;
    color: #9a6700;
}

.workspace-frame {
    flex: 1;
    min-height: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    outline: 1px solid rgba(255,255,255,.65);
    position: relative;
}

.workspace-frame::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -42px 0 0 -16px;
    border-radius: 999px;
    border: 3px solid rgba(76, 115, 255, 0.16);
    border-top-color: var(--brand-strong);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 2;
    transition: opacity .18s ease, visibility .18s ease;
    animation: shellSpin .8s linear infinite;
}

.workspace-frame::after {
    content: "正在打开页面...";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.78);
    color: var(--brand-strong);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
    backdrop-filter: blur(4px);
}

.workspace-frame.is-loading::before,
.workspace-frame.is-loading::after {
    opacity: 1;
    visibility: visible;
}

.main-iframe {
    width: 100%;
    height: 100%;
    min-height: 640px;
    border: none;
    background: #f5f6fb;
    animation: iframeReveal .24s ease both;
}

@keyframes iframeReveal {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shellSpin {
    to { transform: rotate(360deg); }
}

.profile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease;
    z-index: 1190;
}

.profile-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.profile-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: calc(100vw - 24px);
    height: 100vh;
    background: var(--surface);
    box-shadow: -24px 0 48px rgba(15, 23, 42, 0.14);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    z-index: 1200;
    display: flex;
    flex-direction: column;
}

.profile-panel.is-active {
    transform: translateX(0);
}

.profile-panel-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.profile-panel-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text);
}

.profile-panel-header p {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-soft);
}

.profile-panel-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.profile-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    background: #fbfcff;
}

.profile-panel-loading {
    min-height: 180px;
    border-radius: 18px;
    border: 1px dashed var(--line-strong);
    background: #fff;
    color: var(--text-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

body.sidebar-collapsed .sidebar {
    width: 86px;
}

body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .sidebar-announce,
body.sidebar-collapsed .sidebar-footer {
    margin-left: 10px;
    margin-right: 10px;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
}

body.sidebar-collapsed .sidebar-brand-copy,
body.sidebar-collapsed .sidebar-announce,
body.sidebar-collapsed .sidebar-footer,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-arrow,
body.sidebar-collapsed .topbar-chip-brand {
    display: none;
}

body.sidebar-collapsed .sidebar-nav {
    padding-left: 8px;
    padding-right: 8px;
}

body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-sublink {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .nav-group {
    margin-top: 6px;
}

body.sidebar-collapsed .nav-submenu,
body.sidebar-collapsed .nav-group.is-open .nav-submenu {
    display: none;
}

body.sidebar-collapsed .nav-icon {
    width: 20px;
}

@media (max-width: 1400px) {
    .workspace-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .workspace-meta {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 1200px) {
    .mobile-menu-toggle {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        width: var(--sidebar-expanded);
    }

    .sidebar.is-mobile-open {
        transform: translateX(0);
    }

    .shell-main {
        width: 100%;
    }

    .topbar {
        padding-left: 72px;
    }
}

@media (max-width: 960px) {
    .topbar {
        height: auto;
        padding-top: 16px;
        padding-bottom: 16px;
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-left,
    .topbar-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .topbar-chip-brand {
        max-width: none;
        width: 100%;
    }

    .workspace {
        padding: 12px;
    }

    .workspace-header {
        padding: 16px;
    }

    .workspace-header h1 {
        font-size: 20px;
    }

    .workspace-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .workspace-meta-item {
        width: 100%;
        min-width: 0;
    }

    .profile-panel {
        width: 100%;
        max-width: 100%;
    }
}

/* Final readability and navigation polish */
body.admin-shell {
    font-size: 14px;
    background: #f5f7fa !important;
}
.sidebar {
    background: #172033 !important;
    border-right: 1px solid #263249 !important;
    box-shadow: none !important;
}
.sidebar-brand {
    min-height: 64px !important;
    padding: 12px 14px !important;
}
.sidebar-brand-mark {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    background: #2563eb !important;
    box-shadow: none !important;
}
.sidebar-brand-copy strong { font-size: 15px !important; }
.sidebar-brand-copy span { font-size: 12px !important; }
.sidebar-nav { padding: 10px 8px 14px !important; }
.nav-link,
.nav-sublink {
    border-radius: 8px !important;
    transition: background-color .14s ease, color .14s ease !important;
}
.nav-link {
    min-height: 42px !important;
    padding: 0 10px !important;
}
.nav-sublink {
    min-height: 38px !important;
    padding-left: 12px !important;
    font-size: 13px !important;
}
.nav-icon {
    display: inline-flex !important;
    width: 28px !important;
    height: 28px !important;
    flex: 0 0 28px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    background: rgba(255,255,255,.05) !important;
    color: rgba(255,255,255,.72) !important;
    font-size: 14px !important;
}
.nav-text {
    font-size: 14px !important;
    font-weight: 650 !important;
}
.nav-link:hover,
.nav-sublink:hover {
    background: #222d42 !important;
    color: #fff !important;
}
.nav-link.is-active,
.nav-sublink.is-active {
    background: #26344d !important;
    color: #fff !important;
    box-shadow: none !important;
}
.nav-link.is-active .nav-icon {
    background: #2563eb !important;
    color: #fff !important;
}
.nav-link.is-active::before,
.nav-sublink.is-active::before {
    left: 0 !important;
    top: 8px !important;
    bottom: 8px !important;
    width: 3px !important;
    border-radius: 0 3px 3px 0 !important;
    background: #60a5fa !important;
}
.sidebar-footer {
    border-radius: 8px !important;
    background: rgba(255,255,255,.04) !important;
    box-shadow: none !important;
}
.topbar {
    height: 64px !important;
    padding: 0 16px !important;
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    backdrop-filter: none !important;
}
.topbar-action,
.topbar-user,
.topbar-chip {
    height: 38px !important;
    padding: 0 12px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    box-shadow: none !important;
}
.topbar-chip-brand {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #64748b !important;
}
.topbar-action-primary,
.topbar-action-primary:hover {
    background: #2563eb !important;
    color: #fff !important;
    box-shadow: 0 3px 8px rgba(37,99,235,.18) !important;
}
.workspace {
    padding: 10px !important;
    gap: 8px !important;
}
.workspace-frame {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    outline: 0 !important;
}
.profile-panel {
    width: 420px !important;
    background: #fff !important;
    box-shadow: -12px 0 36px rgba(15,23,42,.12) !important;
}
.profile-panel-header {
    padding: 18px !important;
    background: #172033 !important;
}
.profile-panel-body { padding: 16px !important; background: #f8fafc !important; }
body.sidebar-collapsed .sidebar { width: 68px !important; }
body.sidebar-collapsed .nav-icon { margin: 0 auto !important; }
@media (max-width: 960px) {
    .workspace { padding: 8px !important; }
    .topbar { padding-left: 64px !important; }
}

/* 2026 flat enterprise shell v0 */
:root {
    --shell-bg: #f5f7fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #f1f5f9;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --text: #172033;
    --text-soft: #64748b;
    --text-faint: #94a3b8;
    --nav-bg: #172033;
    --nav-hover: #222d42;
    --brand: #2563eb;
    --brand-strong: #1d4ed8;
    --brand-soft: #eff6ff;
    --shadow-sm: none;
    --shadow-md: none;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 10px;
    --sidebar-expanded: 208px;
    --topbar-h: 60px;
}
body {
    background: var(--shell-bg) !important;
}
.sidebar {
    width: var(--sidebar-expanded);
    background: var(--nav-bg) !important;
    border-right: 1px solid #263249;
}
.sidebar-brand {
    min-height: 60px;
    padding: 10px 14px;
    gap: 10px;
    border-bottom-color: rgba(255,255,255,.08);
}
.sidebar-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 7px !important;
    background: var(--brand) !important;
    box-shadow: none !important;
    font-size: 13px;
}
.sidebar-brand-copy strong { font-size: 14px; }
.sidebar-brand-copy span { margin-top: 2px; font-size: 11px; }
.sidebar-nav { padding: 10px 8px 14px; }
.nav-group { margin-top: 3px; }
.nav-link,
.nav-sublink {
    min-height: 38px;
    gap: 10px;
    padding: 0 11px;
    border-radius: 6px !important;
    color: rgba(255,255,255,.68);
    transition: background-color .14s ease, color .14s ease;
}
.nav-link:hover,
.nav-sublink:hover {
    background: var(--nav-hover) !important;
}
.nav-link.is-active,
.nav-sublink.is-active {
    background: #26344d !important;
    color: #fff !important;
    box-shadow: none !important;
}
.nav-link.is-active::before,
.nav-sublink.is-active::before {
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    border-radius: 0;
    background: #60a5fa;
}
.nav-text { font-size: 13px; font-weight: 600; }
.nav-submenu { padding: 3px 0 3px 10px; }
.nav-sublink { min-height: 34px; font-size: 12px; }
.sidebar-footer {
    margin: 8px;
    padding: 10px 11px;
    border-radius: 6px !important;
    background: rgba(255,255,255,.04) !important;
    box-shadow: none !important;
}
.sidebar-footer-value { margin-top: 3px; font-size: 11px; font-weight: 600; }
.topbar {
    height: var(--topbar-h);
    padding: 0 16px;
    gap: 12px;
    background: #fff !important;
    border-bottom: 1px solid var(--line) !important;
    backdrop-filter: none !important;
}
.topbar-left,
.topbar-right { gap: 6px; }
.topbar-chip,
.topbar-action,
.topbar-user {
    height: 34px;
    padding: 0 10px;
    border-radius: 6px !important;
    box-shadow: none !important;
}
.topbar-chip-brand {
    max-width: 460px;
    background: var(--surface-soft) !important;
    color: var(--text-soft) !important;
    border-color: var(--line) !important;
}
.topbar-action-primary,
.topbar-action-primary:hover {
    background: var(--brand) !important;
    color: #fff !important;
    box-shadow: none !important;
}
.topbar-action-toggle,
.topbar-user {
    background: #fff !important;
    border-color: var(--line) !important;
}
.topbar-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 5px;
}
.workspace {
    padding: 10px !important;
    gap: 8px !important;
}
.workspace-frame {
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    outline: 0 !important;
    box-shadow: none !important;
}
.main-iframe { background: var(--shell-bg); animation: none; }
.shell-alert { padding: 10px 12px; border-radius: 6px; }
body.sidebar-collapsed .sidebar { width: 64px; }
body.sidebar-collapsed .sidebar-brand { padding-left: 8px; padding-right: 8px; }
body.sidebar-collapsed .sidebar-nav { padding-left: 6px; padding-right: 6px; }
.profile-panel {
    width: 420px !important;
    background: #fff !important;
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 36px rgba(15,23,42,.12) !important;
}
.profile-panel-header {
    padding: 18px !important;
    background: #172033 !important;
}
.profile-panel-close { border-radius: 6px !important; }
.profile-panel-body { padding: 16px !important; background: #f8fafc !important; }
.profile-panel-body form > div:first-child,
.profile-panel-loading {
    border-radius: 8px !important;
    box-shadow: none !important;
}
@media (max-width: 960px) {
    .workspace { padding: 8px !important; }
    .topbar { padding-left: 64px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Final visible shell theme. Loaded with filemtime cache busting from admin/index.php. */
:root {
    --sidebar-expanded: 206px;
}

body.admin-shell {
    background:
        radial-gradient(circle at 10% 6%, rgba(37, 99, 235, 0.16), transparent 28%),
        radial-gradient(circle at 90% 0%, rgba(14, 165, 233, 0.14), transparent 26%),
        linear-gradient(180deg, #edf2f7 0%, #e7edf5 100%);
}

.sidebar {
    background:
        radial-gradient(circle at 24% 0%, rgba(59, 130, 246, .28), transparent 32%),
        linear-gradient(180deg, #0f172a 0%, #111827 100%) !important;
    box-shadow: 18px 0 44px rgba(15, 23, 42, .16);
}

.sidebar-brand-mark {
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%) !important;
    box-shadow: 0 16px 32px rgba(37, 99, 235, .28);
}

.sidebar-announce,
.sidebar-footer {
    background: rgba(255, 255, 255, .08) !important;
    border-color: rgba(255, 255, 255, .10) !important;
}

.nav-link,
.nav-sublink {
    border-radius: 14px !important;
}

.nav-link:hover,
.nav-sublink:hover {
    background: rgba(255, 255, 255, .09) !important;
}

.nav-link.is-active,
.nav-sublink.is-active {
    background: linear-gradient(135deg, #ffffff 0%, #eaf2ff 100%) !important;
    color: #0f172a !important;
    box-shadow: 0 14px 26px rgba(15, 23, 42, .16) !important;
}

.topbar {
    background: rgba(255, 255, 255, .78) !important;
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, .86);
}

.workspace-header {
    background:
        radial-gradient(circle at 88% 8%, rgba(56, 189, 248, .24), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%) !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08) !important;
}

.workspace-frame {
    border-radius: 24px !important;
    border-color: rgba(203, 213, 225, .9) !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .12) !important;
}

.workspace {
    padding: 20px 22px 22px !important;
    gap: 18px !important;
}

.workspace-meta-item {
    background: #fff !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.topbar-action,
.topbar-user,
.topbar-chip {
    border-radius: 16px !important;
}

.topbar-action-primary {
    background: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%) !important;
    color: #fff !important;
    box-shadow: 0 14px 28px rgba(37, 99, 235, .22);
}

.profile-overlay {
    backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, .32) !important;
}

.profile-panel {
    width: 460px !important;
    background:
        radial-gradient(circle at 84% 0%, rgba(56, 189, 248, .18), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 100%) !important;
    border-left: 1px solid rgba(226, 232, 240, .9);
    box-shadow: -30px 0 70px rgba(15, 23, 42, .18) !important;
}

.profile-panel-header {
    padding: 24px !important;
    background:
        radial-gradient(circle at 94% 0%, rgba(255,255,255,.18), transparent 34%),
        linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    border-bottom: none !important;
    color: #fff;
}

.profile-panel-header h3,
.profile-panel-header p {
    color: #fff !important;
}

.profile-panel-header p {
    opacity: .76;
}

.profile-panel-close {
    width: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
}

.profile-panel-body {
    padding: 22px !important;
    background:
        radial-gradient(circle at 12% 0%, rgba(37, 99, 235, .08), transparent 28%),
        #f8fafc !important;
}

.profile-panel-body form {
    display: block;
}

.profile-panel-body form > div:first-child {
    margin-bottom: 18px !important;
    padding: 20px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 24px !important;
    background: #fff !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .07);
}

.profile-panel-body .panel-form-row {
    gap: 12px !important;
}

.profile-panel-body .panel-form-group label,
.profile-panel-body .panel-password-title {
    color: #475569 !important;
    font-weight: 800 !important;
}

.profile-panel-loading {
    min-height: 220px !important;
    border-radius: 24px !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .12), transparent 34%),
        #fff !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .07);
}

@media (max-width: 960px) {
    .workspace {
        padding: 12px !important;
    }
    .profile-panel {
        width: 100% !important;
    }
    .profile-panel-body .panel-form-row {
        grid-template-columns: 1fr !important;
    }
}
