* { box-sizing: border-box; margin:0; }

:root {
    --body-bg: #f3f6fb; --panel-bg: #ffffff; --sidebar-bg: #0f172a; --sidebar-text: #ffffff;
    --text-primary: #1f2937; --text-muted: #64748b; --card-text: #475569; --border-color: #e2e8f0;
    --accent: #2563eb; --accent-soft: #dbeafe; --hero-start: #2563eb; --hero-end: #4f46e5;
    --glass: rgba(255,255,255,.72); --shadow-sm: 0 2px 8px rgba(15,23,42,.06);
    --shadow-md: 0 8px 24px rgba(15,23,42,.08); --shadow-lg: 0 18px 50px rgba(15,23,42,.12);
    --radius: 16px; --radius-sm: 12px; --radius-xs: 8px;
}

body { font-family:"Inter","SF Pro Display","Microsoft YaHei",system-ui,sans-serif; background:var(--body-bg); color:var(--text-primary); transition:background .3s,color .3s; line-height:1.6; }

/* ── 登录页 ── */
.login-body { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,var(--hero-start),var(--hero-end)); }
.login-shell { width:100%; max-width:400px; padding:24px; }
.login-panel { background:var(--panel-bg); border-radius:24px; padding:36px; box-shadow:var(--shadow-lg); backdrop-filter:blur(20px); }
.brand-block { margin-bottom:28px; text-align:center; }
.brand-title { font-size:26px; font-weight:800; letter-spacing:0; }
.brand-subtitle { margin-top:6px; color:var(--text-muted); font-size:13px; }
.login-form { display:grid; gap:16px; }
.field-block { display:grid; gap:6px; font-size:13px; font-weight:500; }
.field-block input,.field-block select,.field-block textarea { border:1.5px solid var(--border-color); border-radius:var(--radius-sm); padding:11px 14px; font-size:14px; background:var(--panel-bg); color:var(--text-primary); width:100%; transition:border .2s,box-shadow .2s; outline:none; }
.field-block input:focus,.field-block select:focus,.field-block textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.12); }
.primary-btn { border:0; border-radius:var(--radius-sm); padding:12px 20px; font-size:14px; font-weight:600; cursor:pointer; background:var(--accent); color:#fff; transition:transform .1s,box-shadow .2s; letter-spacing:0; }
.primary-btn:hover { transform:translateY(-1px); box-shadow:0 4px 14px rgba(37,99,235,.3); }
.primary-btn:active { transform:translateY(0); }
.ghost-btn { width:100%; background:rgba(255,255,255,.1); color:var(--sidebar-text); border:1px solid rgba(255,255,255,.15); border-radius:var(--radius-sm); padding:10px; cursor:pointer; font-size:13px; transition:background .15s; }
.ghost-btn:hover { background:rgba(255,255,255,.18); }
.form-message { min-height:18px; color:#ef4444; font-size:12px; }

/* ── 主布局 ── */
.dashboard-body { min-height:100vh; }
.dashboard-layout { min-height:100vh; display:grid; grid-template-columns:220px 1fr; }

/* ── 侧边栏 ── */
.sidebar { background:var(--sidebar-bg); color:var(--sidebar-text); padding:20px 14px; display:flex; flex-direction:column; justify-content:space-between; position:sticky; top:0; height:100vh; overflow-y:auto; }
.sidebar-title { font-size:17px; font-weight:800; letter-spacing:0; padding:0 6px; }
.sidebar-subtitle { margin-top:4px; color:rgba(255,255,255,.45); font-size:11px; padding:0 6px; }
.menu-list { display:grid; gap:3px; margin:18px 0; }
.menu-list a { text-decoration:none; color:rgba(255,255,255,.7); background:transparent; padding:10px 12px; border-radius:var(--radius-sm); display:flex; align-items:center; gap:10px; font-size:13px; font-weight:500; transition:all .15s; }
.menu-list a:hover { background:rgba(255,255,255,.08); color:#fff; }
.menu-list a.active { background:var(--accent); color:#fff; font-weight:600; box-shadow:0 4px 12px rgba(37,99,235,.3); }
.menu-icon { font-size:16px; width:22px; text-align:center; }

/* ── 主内容区 ── */
.dashboard-main { padding:24px 28px; overflow-y:auto; }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:22px; }
.page-title { font-size:24px; font-weight:800; letter-spacing:0; }
.page-subtitle { margin-top:4px; color:var(--text-muted); font-size:13px; }
.topbar-actions { display:flex; align-items:center; gap:12px; }
.theme-switcher { display:grid; gap:4px; font-size:11px; color:var(--text-muted); font-weight:500; }
.theme-switcher select { min-width:120px; border:1.5px solid var(--border-color); border-radius:var(--radius-sm); padding:7px 10px; background:var(--panel-bg); color:var(--text-primary); font-size:12px; }

/* ── Hero ── */
.hero-panel { background:linear-gradient(135deg,var(--hero-start),var(--hero-end)); color:#fff; border-radius:20px; padding:28px; margin-bottom:22px; display:flex; justify-content:space-between; gap:18px; align-items:center; box-shadow:0 8px 32px rgba(37,99,235,.2); }
.hero-title { font-size:26px; font-weight:800; letter-spacing:0; }
.hero-desc { margin-top:8px; max-width:580px; line-height:1.7; color:rgba(255,255,255,.8); font-size:14px; }
.hero-tags { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.hero-tags span { padding:7px 14px; border-radius:999px; background:rgba(255,255,255,.15); backdrop-filter:blur(8px); font-size:12px; font-weight:500; }

/* ── 模块入口卡片 ── */
.module-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-bottom:22px; }
.module-entry { background:var(--panel-bg); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow-sm); text-decoration:none; color:var(--text-primary); transition:transform .15s,box-shadow .15s; display:grid; gap:10px; border:1px solid var(--border-color); }
.module-entry:hover { transform:translateY(-3px); box-shadow:var(--shadow-md); border-color:var(--accent); }
.module-entry-head { display:flex; align-items:center; justify-content:space-between; }
.module-entry-icon { font-size:28px; }
.module-entry-name { font-size:15px; font-weight:700; }
.module-entry-desc { font-size:12px; color:var(--text-muted); line-height:1.6; }

/* ── 状态标签 ── */
.status-badge { font-size:11px; border-radius:999px; padding:4px 10px; font-weight:600; letter-spacing:0; }
.badge-online { color:#16a34a; background:#dcfce7; }
.badge-offline { color:#dc2626; background:#fee2e2; }
.badge-standby,.badge-partial { color:#d97706; background:#fef3c7; }
.badge-pending { color:#6b7280; background:#f3f4f6; }
.badge-ready { color:#16a34a; background:#dcfce7; }
.badge-running { color:#2563eb; background:#dbeafe; }
.badge-paused { color:#9333ea; background:#f3e8ff; }

/* ── 详细页面板 ── */
.detail-panel { background:var(--panel-bg); border-radius:20px; padding:22px; box-shadow:var(--shadow-sm); margin-bottom:18px; border:1px solid var(--border-color); }
.detail-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.detail-title { font-size:20px; font-weight:700; letter-spacing:0; }
.detail-subtitle { margin-top:3px; color:var(--text-muted); font-size:12px; }
.detail-status { padding:12px; border-radius:var(--radius-sm); background:rgba(15,23,42,.03); font-size:13px; margin-bottom:14px; line-height:1.8; }
.ghost-inline-btn { border:1.5px solid var(--border-color); background:var(--panel-bg); color:var(--text-primary); border-radius:var(--radius-sm); padding:8px 14px; cursor:pointer; font-size:12px; font-weight:500; transition:all .15s; }
.ghost-inline-btn:hover { border-color:var(--accent); color:var(--accent); }

/* ── 查询面板 ── */
.query-row { display:grid; grid-template-columns:200px 1fr auto; gap:12px; align-items:end; }
.result-box { margin-top:14px; min-height:100px; max-height:400px; overflow:auto; border-radius:var(--radius-sm); padding:14px; background:rgba(15,23,42,.03); color:var(--text-primary); font-size:13px; line-height:1.7; white-space:pre-wrap; word-break:break-word; border:1px solid var(--border-color); font-family:"JetBrains Mono","Fira Code",monospace; }

/* ── 模型卡 ── */
.model-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:16px; }
.model-card { background:var(--glass); border:1.5px solid var(--border-color); border-radius:18px; padding:18px; display:grid; gap:12px; transition:border-color .15s; }
.model-card:hover { border-color:var(--accent); }
.model-card-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.model-title { font-size:16px; font-weight:700; }
.model-meta { margin-top:3px; color:var(--text-muted); font-size:12px; }
.model-body { display:grid; gap:6px; color:var(--card-text); font-size:13px; line-height:1.7; }
.model-action { width:100%; }
.prompt-field { display:grid; gap:6px; font-size:12px; color:var(--text-muted); font-weight:500; }
.prompt-field textarea { width:100%; border:1.5px solid var(--border-color); border-radius:var(--radius-sm); padding:10px; resize:vertical; background:var(--panel-bg); color:var(--text-primary); font-family:inherit; }
.health-text { font-weight:600; }
.health-online { color:#16a34a; }
.health-offline,.health-missing { color:#dc2626; }

/* ── 库存卡片 ── */
.inventory-card { background:rgba(15,23,42,.02); border:1px solid var(--border-color); border-radius:var(--radius-sm); padding:12px; margin:6px 0; }
.inventory-card-list { display:grid; gap:8px; margin:8px 0; }
.inventory-card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:4px 14px; }
.match-result-panel { display:grid; gap:8px; margin:8px 0; }
.match-muted { color:var(--text-muted); font-size:12px; line-height:1.6; }
.tag-ai-pending { background:#dbeafe; color:#2563eb; }
.tag-ai-failed { background:#fee2e2; color:#dc2626; }
.tag-filtered { background:#e5e7eb; color:#475569; }
.ai-analysis-card { background:rgba(37,99,235,.04); border:1px solid var(--border-color); border-radius:var(--radius-sm); padding:12px; margin:6px 0; }
.ai-analysis-head { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:8px; font-size:13px; font-weight:800; color:var(--text-primary); }
.ai-line { font-size:13px; color:var(--text-primary); line-height:1.7; word-break:break-word; }
.ai-line.muted { color:var(--text-muted); }
.ai-line-label { display:inline-block; min-width:56px; margin-right:8px; color:var(--text-muted); font-weight:700; }
.quote-draft-note { display:flex; justify-content:space-between; gap:12px; align-items:center; border:1px dashed var(--border-color); border-radius:var(--radius-xs); padding:8px 10px; color:var(--text-muted); font-size:12px; font-weight:700; }
.process-result { display:grid; gap:8px; font-family:"Microsoft YaHei",system-ui,sans-serif; white-space:normal; }
.process-result-line { font-size:13px; color:var(--text-primary); }
.manual-correction-panel { position:fixed; right:18px; bottom:18px; z-index:80; width:min(390px,calc(100vw - 32px)); max-height:calc(100vh - 36px); overflow:auto; display:grid; gap:10px; background:var(--panel-bg); border:1px solid var(--border-color); border-radius:var(--radius-sm); padding:14px; box-shadow:var(--shadow-lg); }
.manual-correction-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.manual-correction-title { font-size:15px; font-weight:900; color:var(--text-primary); }
.manual-correction-subtitle { margin-top:2px; font-size:12px; color:var(--text-muted); line-height:1.5; }
.manual-correction-selected { border:1px solid var(--border-color); background:rgba(15,23,42,.03); border-radius:var(--radius-xs); padding:9px 10px; font-size:12px; color:var(--text-muted); line-height:1.6; word-break:break-word; }
.manual-correction-field { display:grid; gap:5px; font-size:12px; color:var(--text-muted); font-weight:700; }
.manual-correction-field input,.manual-correction-field select,.manual-correction-field textarea { width:100%; border:1px solid var(--border-color); border-radius:var(--radius-xs); padding:8px 10px; background:var(--panel-bg); color:var(--text-primary); font:inherit; font-size:13px; outline:none; }
.manual-correction-field textarea { resize:vertical; min-height:70px; }
.manual-correction-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.manual-correction-submit { width:100%; padding:9px 12px; }
.manual-correction-notice { min-height:18px; font-size:12px; color:var(--text-muted); line-height:1.5; }
.card-field { display:flex; gap:8px; padding:3px 0; font-size:13px; border-bottom:1px solid rgba(0,0,0,.04); }
.card-field:last-child { border-bottom:none; }
.card-label { color:var(--text-muted); min-width:56px; font-weight:600; font-size:12px; }
.card-value { color:var(--text-primary); }
.card-value.muted { color:var(--text-muted); }

/* ── 10 皮肤 ── */
.theme-default { --body-bg:#f3f6fb; --panel-bg:#fff; --sidebar-bg:#0f172a; --sidebar-text:#fff; --text-primary:#1f2937; --text-muted:#64748b; --card-text:#475569; --border-color:#e2e8f0; --accent:#2563eb; --accent-soft:#dbeafe; --hero-start:#2563eb; --hero-end:#4f46e5; }
.theme-dark { --body-bg:#0a0a0f; --panel-bg:#161622; --sidebar-bg:#08080e; --sidebar-text:#e5e7eb; --text-primary:#f1f5f9; --text-muted:#94a3b8; --card-text:#cbd5e1; --border-color:#1e293b; --accent:#38bdf8; --accent-soft:rgba(56,189,248,.1); --hero-start:#0c1222; --hero-end:#1e40af; --glass:rgba(22,22,34,.8); }
.theme-emerald { --body-bg:#ecfdf5; --panel-bg:#fff; --sidebar-bg:#064e3b; --sidebar-text:#ecfdf5; --text-primary:#14532d; --text-muted:#4b5563; --card-text:#374151; --border-color:#a7f3d0; --accent:#059669; --accent-soft:#d1fae5; --hero-start:#059669; --hero-end:#10b981; }
.theme-sunset { --body-bg:#fffbf5; --panel-bg:#fff; --sidebar-bg:#7c2d12; --sidebar-text:#ffedd5; --text-primary:#431407; --text-muted:#9a3412; --card-text:#7c2d12; --border-color:#fed7aa; --accent:#ea580c; --accent-soft:#ffedd5; --hero-start:#ea580c; --hero-end:#f97316; }
.theme-violet { --body-bg:#faf5ff; --panel-bg:#fff; --sidebar-bg:#3b0764; --sidebar-text:#f3e8ff; --text-primary:#1e1b4b; --text-muted:#7c3aed; --card-text:#4338ca; --border-color:#c4b5fd; --accent:#7c3aed; --accent-soft:#ede9fe; --hero-start:#7c3aed; --hero-end:#8b5cf6; }
.theme-slate { --body-bg:#f8fafc; --panel-bg:#fff; --sidebar-bg:#1e293b; --sidebar-text:#e2e8f0; --text-primary:#0f172a; --text-muted:#475569; --card-text:#334155; --border-color:#cbd5e1; --accent:#475569; --accent-soft:#e2e8f0; --hero-start:#334155; --hero-end:#475569; }
.theme-rose { --body-bg:#fff1f2; --panel-bg:#fff; --sidebar-bg:#881337; --sidebar-text:#ffe4e6; --text-primary:#4c0519; --text-muted:#be123c; --card-text:#881337; --border-color:#fecdd3; --accent:#e11d48; --accent-soft:#ffe4e6; --hero-start:#e11d48; --hero-end:#fb7185; }
.theme-ocean { --body-bg:#ecfeff; --panel-bg:#fff; --sidebar-bg:#155e75; --sidebar-text:#cffafe; --text-primary:#164e63; --text-muted:#0e7490; --card-text:#155e75; --border-color:#a5f3fc; --accent:#0891b2; --accent-soft:#cffafe; --hero-start:#0891b2; --hero-end:#06b6d4; }
.theme-gold { --body-bg:#fffbeb; --panel-bg:#fff; --sidebar-bg:#78350f; --sidebar-text:#fef3c7; --text-primary:#451a03; --text-muted:#b45309; --card-text:#78350f; --border-color:#fcd34d; --accent:#d97706; --accent-soft:#fef3c7; --hero-start:#d97706; --hero-end:#f59e0b; }
.theme-forest { --body-bg:#f0fdf4; --panel-bg:#fff; --sidebar-bg:#14532d; --sidebar-text:#dcfce7; --text-primary:#052e16; --text-muted:#15803d; --card-text:#166534; --border-color:#86efac; --accent:#16a34a; --accent-soft:#dcfce7; --hero-start:#15803d; --hero-end:#22c55e; }

/* ── 10 排版 ── */
/* L1 经典：左侧栏220+右内容 */
.layout-classic .dashboard-layout { grid-template-columns:220px 1fr; }
.layout-classic .sidebar { border-radius:0; }

/* L2 窄栏：左侧栏180+右内容，侧栏紧凑 */
.layout-narrow .dashboard-layout { grid-template-columns:180px 1fr; }
.layout-narrow .sidebar { padding:16px 10px; }
.layout-narrow .sidebar-title { font-size:15px; }
.layout-narrow .menu-list a { padding:8px 10px; font-size:12px; }

/* L3 宽栏：左侧栏260+右内容，侧栏宽敞 */
.layout-wide .dashboard-layout { grid-template-columns:260px 1fr; }
.layout-wide .sidebar { padding:24px 18px; }
.layout-wide .sidebar-title { font-size:19px; }

/* L4 圆润：大圆角+柔和阴影 */
.layout-rounded .detail-panel { border-radius:28px; }
.layout-rounded .hero-panel { border-radius:28px; }
.layout-rounded .module-entry { border-radius:24px; }
.layout-rounded .sidebar { border-radius:0 24px 24px 0; }
.layout-rounded .login-panel { border-radius:32px; }

/* L5 方正：直角+实线边框 */
.layout-sharp .detail-panel { border-radius:4px; }
.layout-sharp .hero-panel { border-radius:4px; }
.layout-sharp .module-entry { border-radius:4px; }
.layout-sharp .primary-btn { border-radius:4px; }
.layout-sharp .ghost-inline-btn { border-radius:4px; }
.layout-sharp .sidebar { border-radius:0; }
.layout-sharp .field-block input,.layout-sharp .field-block select { border-radius:4px; }

/* L6 卡片间距大 */
.layout-spacious .dashboard-main { padding:32px 36px; }
.layout-spacious .detail-panel { padding:28px; margin-bottom:24px; }
.layout-spacious .module-grid { gap:20px; }

/* L7 紧凑排版 */
.layout-compact .dashboard-main { padding:16px 20px; }
.layout-compact .detail-panel { padding:16px; margin-bottom:12px; border-radius:12px; }
.layout-compact .detail-title { font-size:17px; }
.layout-compact .hero-panel { padding:20px; border-radius:14px; }

/* L8 无边框：去掉面板边框，纯阴影 */
.layout-borderless .detail-panel { border:none; box-shadow:var(--shadow-md); }
.layout-borderless .module-entry { border:none; box-shadow:var(--shadow-sm); }
.layout-borderless .result-box { border:none; }

/* L9 双栏内容 */
.layout-twocol .dashboard-main { column-count:2; column-gap:20px; }
.layout-twocol .detail-panel { break-inside:avoid; }
.layout-twocol .hero-panel { column-span:all; }

/* L10 顶栏模式：侧边栏变成顶栏 */
.layout-topbar .dashboard-layout { grid-template-columns:1fr; grid-template-rows:auto 1fr; }
.layout-topbar .sidebar { position:static; height:auto; flex-direction:row; align-items:center; padding:12px 20px; gap:16px; }
.layout-topbar .sidebar-title { font-size:16px; }
.layout-topbar .sidebar-subtitle { display:none; }
.layout-topbar .menu-list { display:flex; gap:6px; margin:0; }
.layout-topbar .menu-list a { padding:8px 14px; font-size:13px; white-space:nowrap; }
.layout-topbar .ghost-btn { padding:8px 14px; width:auto; }

/* ── 响应式 ── */
@media(max-width:768px){
    .dashboard-layout{grid-template-columns:1fr}
    .sidebar{position:fixed;left:-220px;z-index:100;transition:left .3s}
    .sidebar.open{left:0}
    .query-row{grid-template-columns:1fr}
    .hero-panel{flex-direction:column}
    .manual-correction-panel{left:12px;right:12px;bottom:12px;width:auto}
    .manual-correction-grid{grid-template-columns:1fr}
}

/* ===== CRM Design System v2: 10 layouts x 10 skins ===== */
body.dashboard-body {
    --surface: #fbfcff;
    --surface-2: #ffffff;
    --surface-3: #f4f7fb;
    --surface-ink: #101828;
    --muted-ink: #667085;
    --line: rgba(16, 24, 40, .12);
    --line-strong: rgba(16, 24, 40, .22);
    --accent-ink: #ffffff;
    --nav-bg: #101828;
    --nav-fg: #f8fafc;
    --nav-muted: rgba(248, 250, 252, .58);
    --panel-pad: 24px;
    --panel-gap: 18px;
    --nav-width: 244px;
    --content-max: 1540px;
    --radius-panel: 18px;
    --radius-control: 12px;
    --radius-inner: 8px;
    --shadow-panel: 0 18px 44px rgba(16, 24, 40, .08);
    --shadow-soft: 0 1px 0 rgba(16, 24, 40, .04), 0 16px 44px rgba(16, 24, 40, .07);
    --texture-a: rgba(16, 24, 40, .035);
    --texture-b: rgba(255, 255, 255, .72);
    background:
        linear-gradient(180deg, var(--surface), var(--surface-3)),
        repeating-linear-gradient(90deg, transparent 0 24px, var(--texture-a) 24px 25px);
    color: var(--surface-ink);
    font-family: "Aptos", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

body.dashboard-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .36;
    background-image:
        linear-gradient(var(--texture-a) 1px, transparent 1px),
        linear-gradient(90deg, var(--texture-a) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.75), transparent 88%);
}

body.theme-default {
    --body-bg: #eef3fb; --panel-bg: #ffffff; --text-primary: #122033; --text-muted: #667085; --border-color: rgba(18,32,51,.13);
    --accent: #2f66d0; --accent-soft: #e6efff; --sidebar-bg: #132238; --sidebar-text: #f8fafc;
    --hero-start: #2f66d0; --hero-end: #416f91; --surface: #f7faff; --surface-2: #ffffff; --surface-3: #edf2f8;
    --surface-ink: #122033; --muted-ink: #667085; --line: rgba(18,32,51,.13); --line-strong: rgba(18,32,51,.24);
    --nav-bg: #132238; --nav-fg: #f8fafc; --nav-muted: rgba(248,250,252,.62); --texture-a: rgba(47,102,208,.045);
}
body.theme-dark {
    --body-bg: #101114; --panel-bg: #17191f; --text-primary: #f2f4f7; --text-muted: #a5adba; --border-color: rgba(242,244,247,.12);
    --accent: #7fb2c8; --accent-soft: rgba(127,178,200,.16); --sidebar-bg: #0f1117; --sidebar-text: #f2f4f7;
    --hero-start: #1b2029; --hero-end: #273241; --surface: #101114; --surface-2: #17191f; --surface-3: #13161d;
    --surface-ink: #f2f4f7; --muted-ink: #a5adba; --line: rgba(242,244,247,.12); --line-strong: rgba(242,244,247,.2);
    --nav-bg: #0f1117; --nav-fg: #f2f4f7; --nav-muted: rgba(242,244,247,.58); --texture-a: rgba(255,255,255,.045);
    --shadow-panel: 0 22px 50px rgba(0,0,0,.28);
}
body.theme-emerald {
    --body-bg: #edf8f3; --panel-bg: #ffffff; --text-primary: #113d33; --text-muted: #58726a; --border-color: rgba(17,61,51,.14);
    --accent: #218064; --accent-soft: #dff3eb; --sidebar-bg: #113d33; --sidebar-text: #f4fffb;
    --hero-start: #218064; --hero-end: #4f8f76; --surface: #f5fbf8; --surface-2: #ffffff; --surface-3: #eaf4ef;
    --surface-ink: #113d33; --muted-ink: #58726a; --line: rgba(17,61,51,.14); --line-strong: rgba(17,61,51,.24);
    --nav-bg: #113d33; --nav-fg: #f4fffb; --nav-muted: rgba(244,255,251,.64); --texture-a: rgba(33,128,100,.052);
}
body.theme-sunset {
    --body-bg: #fbf3ea; --panel-bg: #fffdf9; --text-primary: #432818; --text-muted: #80624c; --border-color: rgba(67,40,24,.15);
    --accent: #b86735; --accent-soft: #f4e4d6; --sidebar-bg: #432818; --sidebar-text: #fff7ed;
    --hero-start: #b86735; --hero-end: #8d5a43; --surface: #fff8f1; --surface-2: #fffdf9; --surface-3: #f3e7da;
    --surface-ink: #432818; --muted-ink: #80624c; --line: rgba(67,40,24,.15); --line-strong: rgba(67,40,24,.25);
    --nav-bg: #432818; --nav-fg: #fff7ed; --nav-muted: rgba(255,247,237,.66); --texture-a: rgba(184,103,53,.056);
}
body.theme-violet {
    --body-bg: #f4f1f8; --panel-bg: #fff; --text-primary: #2d2840; --text-muted: #6f6684; --border-color: rgba(45,40,64,.14);
    --accent: #675a9b; --accent-soft: #ebe6f5; --sidebar-bg: #28243a; --sidebar-text: #f8f5ff;
    --hero-start: #675a9b; --hero-end: #5a677f; --surface: #faf8fd; --surface-2: #ffffff; --surface-3: #eeeaf4;
    --surface-ink: #2d2840; --muted-ink: #6f6684; --line: rgba(45,40,64,.14); --line-strong: rgba(45,40,64,.25);
    --nav-bg: #28243a; --nav-fg: #f8f5ff; --nav-muted: rgba(248,245,255,.62); --texture-a: rgba(103,90,155,.045);
}
body.theme-slate {
    --body-bg: #f3f4f5; --panel-bg: #ffffff; --text-primary: #1f242b; --text-muted: #68717d; --border-color: rgba(31,36,43,.14);
    --accent: #596574; --accent-soft: #e8ebef; --sidebar-bg: #20262e; --sidebar-text: #f8fafc;
    --hero-start: #4b5663; --hero-end: #737c88; --surface: #f8f9fa; --surface-2: #ffffff; --surface-3: #eceff2;
    --surface-ink: #1f242b; --muted-ink: #68717d; --line: rgba(31,36,43,.14); --line-strong: rgba(31,36,43,.24);
    --nav-bg: #20262e; --nav-fg: #f8fafc; --nav-muted: rgba(248,250,252,.6); --texture-a: rgba(31,36,43,.042);
}
body.theme-rose {
    --body-bg: #fbf1f4; --panel-bg: #fff; --text-primary: #48202c; --text-muted: #865b68; --border-color: rgba(72,32,44,.14);
    --accent: #a94f67; --accent-soft: #f3e0e6; --sidebar-bg: #48202c; --sidebar-text: #fff5f8;
    --hero-start: #a94f67; --hero-end: #8d6470; --surface: #fff8fa; --surface-2: #ffffff; --surface-3: #f3e6eb;
    --surface-ink: #48202c; --muted-ink: #865b68; --line: rgba(72,32,44,.14); --line-strong: rgba(72,32,44,.24);
    --nav-bg: #48202c; --nav-fg: #fff5f8; --nav-muted: rgba(255,245,248,.62); --texture-a: rgba(169,79,103,.05);
}
body.theme-ocean {
    --body-bg: #edf7f8; --panel-bg: #ffffff; --text-primary: #153e46; --text-muted: #55747b; --border-color: rgba(21,62,70,.14);
    --accent: #247f90; --accent-soft: #dff1f4; --sidebar-bg: #153e46; --sidebar-text: #f1fdff;
    --hero-start: #247f90; --hero-end: #4e7e8b; --surface: #f6fbfc; --surface-2: #ffffff; --surface-3: #e6f1f3;
    --surface-ink: #153e46; --muted-ink: #55747b; --line: rgba(21,62,70,.14); --line-strong: rgba(21,62,70,.24);
    --nav-bg: #153e46; --nav-fg: #f1fdff; --nav-muted: rgba(241,253,255,.64); --texture-a: rgba(36,127,144,.048);
}
body.theme-gold {
    --body-bg: #fbf6e9; --panel-bg: #fffefa; --text-primary: #3f321c; --text-muted: #7b6d54; --border-color: rgba(63,50,28,.15);
    --accent: #997a2f; --accent-soft: #f0e7cc; --sidebar-bg: #3f321c; --sidebar-text: #fff9e8;
    --hero-start: #997a2f; --hero-end: #826c45; --surface: #fffaf0; --surface-2: #fffefa; --surface-3: #f0e8d4;
    --surface-ink: #3f321c; --muted-ink: #7b6d54; --line: rgba(63,50,28,.15); --line-strong: rgba(63,50,28,.25);
    --nav-bg: #3f321c; --nav-fg: #fff9e8; --nav-muted: rgba(255,249,232,.64); --texture-a: rgba(153,122,47,.052);
}
body.theme-forest {
    --body-bg: #eef4ed; --panel-bg: #fff; --text-primary: #203322; --text-muted: #637365; --border-color: rgba(32,51,34,.15);
    --accent: #5d7746; --accent-soft: #e4ecd9; --sidebar-bg: #203322; --sidebar-text: #f7fff4;
    --hero-start: #5d7746; --hero-end: #445f48; --surface: #f8fbf5; --surface-2: #ffffff; --surface-3: #e8efe3;
    --surface-ink: #203322; --muted-ink: #637365; --line: rgba(32,51,34,.15); --line-strong: rgba(32,51,34,.25);
    --nav-bg: #203322; --nav-fg: #f7fff4; --nav-muted: rgba(247,255,244,.64); --texture-a: rgba(93,119,70,.05);
}

body.dashboard-body .dashboard-layout {
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
}

body.dashboard-body .sidebar {
    background:
        linear-gradient(180deg, rgba(255,255,255,.08), transparent 22%),
        var(--nav-bg);
    color: var(--nav-fg);
    padding: 18px 14px;
    border-right: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand {
    position: relative;
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding-right: 0;
}

.sidebar-collapse-btn {
    position: absolute;
    top: 10px;
    right: 0;
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    color: var(--nav-fg);
    font: inherit;
    font-size: 22px;
    font-weight: 750;
    line-height: 1;
    cursor: pointer;
    transition: transform .16s cubic-bezier(.2,.8,.2,1), background .16s, border-color .16s;
}

.sidebar-collapse-btn:hover {
    border-color: rgba(255,255,255,.28);
    background: rgba(255,255,255,.13);
    transform: translateY(-1px);
}

.sidebar-collapse-btn .collapse-closed {
    display: none;
}

.sidebar-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;
    background: rgba(255,255,255,.08);
    color: var(--nav-fg);
    font-size: 13px;
    font-weight: 800;
}

body.dashboard-body .sidebar-title {
    padding: 0;
    color: var(--nav-fg);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
}

body.dashboard-body .sidebar-subtitle {
    padding: 0;
    color: var(--nav-muted);
    font-size: 11px;
    letter-spacing: 0;
}

body.dashboard-body .menu-list {
    gap: 6px;
    margin: 26px 0;
}

body.dashboard-body .menu-list a {
    position: relative;
    min-height: 42px;
    padding: 10px 11px;
    border-radius: var(--radius-control);
    color: var(--nav-muted);
    font-weight: 650;
    transition: transform .18s cubic-bezier(.2,.8,.2,1), background .18s, color .18s;
}

body.dashboard-body .menu-list a:hover {
    transform: translateX(2px);
    background: rgba(255,255,255,.08);
    color: var(--nav-fg);
}

body.dashboard-body .menu-list a.active {
    background: rgba(255,255,255,.14);
    color: var(--nav-fg);
    box-shadow: inset 3px 0 0 var(--accent);
}

body.dashboard-body .menu-icon {
    width: 28px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(255,255,255,.08);
    color: var(--nav-fg);
    font-size: 11px;
    font-weight: 800;
}

body.dashboard-body .dashboard-main {
    width: min(100%, var(--content-max));
    margin: 0 auto;
    padding: 28px 32px 48px;
    overflow-y: visible;
}

body.sidebar-collapsed:not(.layout-topbar) {
    --nav-width: 88px;
}

body.sidebar-collapsed:not(.layout-topbar) .sidebar {
    padding-left: 12px;
    padding-right: 12px;
}

body.sidebar-collapsed:not(.layout-topbar) .sidebar-brand {
    grid-template-columns: 1fr;
    justify-items: center;
    padding-right: 0;
}

body.sidebar-collapsed:not(.layout-topbar) .sidebar-brand > div:not(.sidebar-mark) {
    display: none;
}

body.sidebar-collapsed:not(.layout-topbar) .sidebar-collapse-btn {
    position: static;
    width: 48px;
    min-width: 48px;
    font-size: 22px;
}

body.sidebar-collapsed:not(.layout-topbar) .sidebar-collapse-btn .collapse-open {
    display: none;
}

body.sidebar-collapsed:not(.layout-topbar) .sidebar-collapse-btn .collapse-closed {
    display: inline;
}

body.sidebar-collapsed:not(.layout-topbar) .menu-list a {
    justify-content: center;
    font-size: 0;
    padding: 10px;
}

body.sidebar-collapsed:not(.layout-topbar) .menu-icon {
    margin: 0;
}

body.sidebar-collapsed:not(.layout-topbar) .ghost-btn {
    font-size: 0;
    min-height: 42px;
}

body.sidebar-collapsed:not(.layout-topbar) .ghost-btn::after {
    content: "退出";
    font-size: 12px;
}

body.dashboard-expanded:not(.layout-topbar) .dashboard-layout {
    grid-template-columns: 0 minmax(0, 1fr);
}

body.dashboard-expanded:not(.layout-topbar) .sidebar {
    transform: translateX(-100%);
    pointer-events: none;
}

body.dashboard-expanded .dashboard-main {
    width: 100%;
    max-width: none;
    padding-left: 28px;
    padding-right: 28px;
}

body.dashboard-body .topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: -8px -8px 22px;
    padding: 12px 8px;
    backdrop-filter: blur(18px);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
}

body.dashboard-body .page-title {
    color: var(--surface-ink);
    font-size: 25px;
    letter-spacing: 0;
}

body.dashboard-body .hero-title,
body.dashboard-body .brand-title,
body.dashboard-body .primary-btn,
body.dashboard-body .status-badge {
    letter-spacing: 0;
}

body.dashboard-body .page-subtitle {
    color: var(--muted-ink);
}

body.dashboard-body .topbar-actions {
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface-2) 84%, transparent);
    box-shadow: 0 10px 28px rgba(16,24,40,.06);
}

body.dashboard-body .theme-switcher {
    color: var(--muted-ink);
}

body.dashboard-body .theme-switcher select,
body.dashboard-body .field-block input,
body.dashboard-body .field-block select,
body.dashboard-body .field-block textarea {
    border-color: var(--line);
    border-radius: var(--radius-control);
    background: var(--surface-2);
    color: var(--surface-ink);
}

body.dashboard-body .theme-switcher select:focus,
body.dashboard-body .field-block input:focus,
body.dashboard-body .field-block select:focus,
body.dashboard-body .field-block textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

body.dashboard-body .hero-panel,
body.dashboard-body .detail-panel,
body.dashboard-body .module-entry {
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-panel);
}

body.dashboard-body .hero-panel {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 96%, #ffffff), color-mix(in srgb, var(--nav-bg) 82%, #ffffff));
    padding: 32px;
}

body.dashboard-body .detail-panel,
body.dashboard-body .module-entry {
    background: color-mix(in srgb, var(--surface-2) 94%, transparent);
}

body.dashboard-body .detail-title {
    color: var(--surface-ink);
    letter-spacing: 0;
}

body.dashboard-body .detail-subtitle,
body.dashboard-body .module-entry-desc,
body.dashboard-body .card-label {
    color: var(--muted-ink);
}

body.dashboard-body .primary-btn,
body.dashboard-body .ghost-inline-btn,
body.dashboard-body .ghost-btn {
    transition: transform .16s cubic-bezier(.2,.8,.2,1), border-color .16s, background .16s, color .16s, box-shadow .16s;
}

body.dashboard-body .primary-btn {
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: var(--radius-control);
    box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 22%, transparent);
}

body.dashboard-body .primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px color-mix(in srgb, var(--accent) 26%, transparent);
}

body.dashboard-body .primary-btn:active,
body.dashboard-body .ghost-inline-btn:active,
body.dashboard-body .module-entry:active {
    transform: translateY(1px);
}

body.dashboard-body .ghost-inline-btn {
    border-color: var(--line);
    background: color-mix(in srgb, var(--surface-2) 86%, transparent);
    color: var(--surface-ink);
}

body.dashboard-body .ghost-inline-btn:hover,
body.dashboard-body .ghost-inline-btn.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

body.dashboard-body .module-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--panel-gap);
}

body.dashboard-body .module-entry {
    min-height: 180px;
    padding: 22px;
}

body.dashboard-body .module-entry:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    box-shadow: 0 22px 48px color-mix(in srgb, var(--accent) 12%, rgba(16,24,40,.08));
}

body.dashboard-body .module-entry-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

body.dashboard-body .result-box {
    border-color: var(--line);
    background: color-mix(in srgb, var(--surface-3) 82%, var(--surface-2));
    color: var(--surface-ink);
    font-family: "Cascadia Code", "JetBrains Mono", "Microsoft YaHei", monospace;
}

.service-strip {
    display: grid;
    gap: 12px;
}

.query-stage {
    display: flex;
    flex-direction: column;
    min-height: 72dvh;
    padding: 30px;
    overflow: auto;
}

.query-stage.resizable-panel {
    min-height: 72dvh;
    resize: none;
}

.query-stage-head {
    align-items: end;
}

.query-kicker {
    margin-bottom: 5px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.query-stage-meter {
    min-width: 116px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--surface-3);
    color: var(--muted-ink);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.query-console {
    grid-template-columns: minmax(210px, 270px) minmax(280px, 1fr) 126px;
    gap: 14px;
    align-items: end;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius-panel) + 4px);
    background: color-mix(in srgb, var(--surface-3) 62%, var(--surface-2));
}

.brand-strip {
    padding: 4px 2px 14px;
}

.query-result-page {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius-panel) + 6px);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 96%, transparent), color-mix(in srgb, var(--surface-3) 86%, transparent));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.52);
    overflow: hidden;
}

.query-result-page.is-running {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}

.query-result-page.is-error {
    border-color: rgba(220, 38, 38, .34);
}

.query-result-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-2) 72%, var(--accent-soft));
}

.query-result-title {
    font-size: 22px;
    font-weight: 850;
}

.query-result-summary {
    max-width: 520px;
    color: var(--muted-ink);
    font-size: 13px;
    text-align: right;
}

.result-box-large {
    min-height: min(46dvh, 420px);
    max-height: none;
    margin-top: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-family: "Aptos", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
    overflow: auto;
}

.query-empty-state {
    display: grid;
    place-items: center;
    min-height: 34dvh;
    text-align: center;
    color: var(--muted-ink);
}

.empty-title {
    color: var(--surface-ink);
    font-size: 18px;
    font-weight: 800;
}

.empty-desc {
    margin-top: 6px;
    max-width: 520px;
}

.query-loading {
    display: grid;
    gap: 14px;
    padding: 24px;
}

.loading-line,
.loading-grid span {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent-soft) 66%, var(--surface-2));
}

.loading-line {
    width: 48%;
    height: 18px;
}

.loading-line.wide {
    width: 68%;
    height: 24px;
}

.loading-line::after,
.loading-grid span::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.62), transparent);
    animation: crm-shimmer 1.2s infinite;
}

.loading-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.loading-grid span {
    height: 104px;
}

.loading-copy {
    color: var(--muted-ink);
    font-size: 13px;
}

@keyframes crm-shimmer {
    to { transform: translateX(100%); }
}

.result-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
    color: var(--muted-ink);
    font-size: 12px;
}

.result-meta-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--surface-2);
    font-weight: 700;
}

.result-count {
    margin-bottom: 12px;
    color: var(--muted-ink);
    font-size: 13px;
}

.gjp-table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-2);
}

.gjp-data-table {
    width: 100%;
    min-width: 880px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.gjp-data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--accent) 92%, var(--nav-bg));
    color: var(--accent-ink);
    font-weight: 750;
    text-align: left;
    white-space: nowrap;
}

.gjp-data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--surface-ink);
    white-space: nowrap;
}

.gjp-data-table tr.is-alt td {
    background: color-mix(in srgb, var(--surface-3) 54%, transparent);
}

.gjp-data-table tbody tr:hover td {
    background: var(--accent-soft);
}

.result-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.result-field {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
}

.result-field span {
    color: var(--muted-ink);
    font-size: 12px;
    font-weight: 700;
}

.result-field strong {
    color: var(--surface-ink);
    font-size: 14px;
}

.api-map-panel {
    background: color-mix(in srgb, var(--surface-2) 90%, var(--surface-3));
}

.api-chip-grid .api-chip {
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    color: var(--surface-ink);
    font-weight: 650;
}

.smart-entry-panel {
    min-height: 270px;
}

.resizable-panel {
    position: relative;
    box-sizing: border-box;
    min-width: min(340px, 100%);
    max-width: 100%;
}

.resizable-panel.is-resizing {
    user-select: none;
    outline: none;
}

.panel-resize-handle {
    position: absolute;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    background: transparent;
    border-radius: 999px;
    transition: none;
    box-shadow: none;
}

.panel-resize-handle:hover {
    background: transparent;
    opacity: 0;
}

.panel-resize-top,
.panel-resize-bottom {
    left: 22px;
    right: 22px;
    height: 8px;
    cursor: ns-resize;
}

.panel-resize-top {
    top: -4px;
}

.panel-resize-bottom {
    bottom: -4px;
}

.panel-resize-left,
.panel-resize-right {
    top: 22px;
    bottom: 22px;
    width: 8px;
    cursor: ew-resize;
}

.panel-resize-left {
    left: -4px;
}

.panel-resize-right {
    right: -4px;
}

body.crm-shell-custom-open .resizable-panel {
    overflow: visible !important;
}

body.crm-shell-custom-open .resizable-panel::before {
    pointer-events: none;
}

body.crm-shell-custom-open .panel-resize-handle,
.resizable-panel.is-resizing .panel-resize-handle {
    pointer-events: auto;
    opacity: .58;
    background: color-mix(in srgb, var(--accent) 54%, rgba(255,255,255,.86));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

body.crm-shell-custom-open .panel-resize-handle:hover,
.resizable-panel.is-resizing .panel-resize-handle {
    opacity: 1;
    background: var(--accent);
}

body.crm-shell-custom-open .panel-resize-top,
body.crm-shell-custom-open .panel-resize-bottom {
    height: 5px;
}

body.crm-shell-custom-open .panel-resize-left,
body.crm-shell-custom-open .panel-resize-right {
    width: 5px;
}

body.dashboard-home .dashboard-main {
    padding-top: 34px;
}

body.dashboard-home .home-hero-panel {
    align-items: stretch;
    min-height: 248px;
    margin-bottom: 22px;
}

body.dashboard-home .home-hero-panel > div:first-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 720px;
}

body.dashboard-home .hero-desc {
    max-width: 640px;
    color: color-mix(in srgb, #ffffff 82%, transparent);
}

body.dashboard-home .dashboard-hero-tools {
    align-self: flex-start;
    display: grid;
    gap: 12px;
    min-width: min(420px, 44vw);
}

body.dashboard-home .dashboard-hero-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(156px, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, #ffffff 24%, transparent);
    border-radius: 20px;
    background: color-mix(in srgb, #ffffff 14%, transparent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
    backdrop-filter: blur(18px);
}

body.dashboard-home .dashboard-hero-controls .theme-switcher {
    color: color-mix(in srgb, #ffffff 80%, transparent);
}

body.dashboard-home .dashboard-hero-controls .theme-switcher span {
    color: color-mix(in srgb, #ffffff 76%, transparent);
}

body.dashboard-home .dashboard-hero-controls .theme-switcher select {
    min-width: 0;
    width: 100%;
    border-color: color-mix(in srgb, #ffffff 28%, transparent);
    background: color-mix(in srgb, #ffffff 18%, transparent);
    color: #fff;
}

body.dashboard-home .dashboard-hero-controls .theme-switcher option {
    color: #0f172a;
}

body.dashboard-home .shell-action-btn {
    justify-self: end;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid color-mix(in srgb, #ffffff 26%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, #ffffff 16%, transparent);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
    transition: transform .18s cubic-bezier(.2,.8,.2,1), background .18s, border-color .18s;
}

body.dashboard-home .shell-action-btn:hover {
    border-color: color-mix(in srgb, #ffffff 42%, transparent);
    background: color-mix(in srgb, #ffffff 22%, transparent);
    transform: translateY(-1px);
}

body.dashboard-home .shell-action-btn:active {
    transform: translateY(1px);
}

body.dashboard-home .home-smart-panel {
    margin-bottom: 20px;
    min-height: 0;
    resize: none;
    overflow: visible;
}

body.dashboard-home .smart-panel-head {
    display: grid;
    grid-template-columns: minmax(220px, .9fr) minmax(360px, 1.1fr);
    gap: 18px;
    align-items: end;
    margin-bottom: 18px;
}

body.dashboard-home .search-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

body.dashboard-home .function-choice {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface-2) 90%, transparent);
    color: var(--surface-ink);
    cursor: pointer;
    text-align: left;
    transition: transform .18s cubic-bezier(.2,.8,.2,1), border-color .18s, background .18s, box-shadow .18s;
}

body.dashboard-home .function-choice:hover,
body.dashboard-home .function-choice.active {
    border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
    background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface-2));
    box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 14%, transparent);
    transform: translateY(-1px);
}

body.dashboard-home .function-choice:active {
    transform: translateY(1px);
}

body.dashboard-home .function-code {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--surface-3);
    color: var(--accent);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: .04em;
}

body.dashboard-home .function-choice b {
    display: block;
    font-size: 16px;
    line-height: 1.2;
}

body.dashboard-home .function-choice small {
    display: block;
    margin-top: 5px;
    color: var(--muted-ink);
    font-size: 12px;
    line-height: 1.3;
}

body.dashboard-home .smart-query-row {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 12px;
    align-items: stretch;
}

body.dashboard-home .smart-query-row textarea {
    width: 100%;
    min-height: 70px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px 18px;
    resize: vertical;
    background: var(--surface-2);
    color: var(--surface-ink);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}

body.dashboard-home .smart-query-row textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

body.dashboard-home .smart-query-row .primary-btn {
    min-height: 70px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 800;
}

body.dashboard-body .brand-logo-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    margin-top: 16px;
}

body.dashboard-body .brand-logo-label {
    color: var(--muted-ink);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

body.dashboard-body .brand-logo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.dashboard-body .brand-logo-btn {
    --brand-color: #173b78;
    position: relative;
    display: grid;
    place-items: center;
    min-width: 96px;
    height: 54px;
    border: 1px solid color-mix(in srgb, var(--brand-color) 28%, var(--line));
    border-radius: 14px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--brand-color) 8%, var(--surface-2)), var(--surface-2));
    color: var(--brand-color);
    cursor: pointer;
    overflow: hidden;
    transition: transform .18s cubic-bezier(.2,.8,.2,1), border-color .18s, box-shadow .18s, background .18s;
}

body.dashboard-body .brand-logo-btn::after {
    content: "";
    position: absolute;
    inset: auto 10px 8px 10px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    opacity: .24;
}

body.dashboard-body .brand-logo-btn:hover {
    border-color: color-mix(in srgb, var(--brand-color) 62%, var(--line));
    box-shadow: 0 12px 24px color-mix(in srgb, var(--brand-color) 16%, transparent);
    transform: translateY(-1px);
}

body.dashboard-body .brand-logo-btn.active {
    border-color: color-mix(in srgb, var(--brand-color) 76%, var(--line));
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--brand-color) 14%, var(--surface-2)), var(--surface-2));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-color) 18%, transparent);
}

body.dashboard-body .brand-logo-btn:active {
    transform: translateY(1px);
}

body.dashboard-body .brand-logo-img {
    display: block;
    max-width: 74px;
    max-height: 26px;
    object-fit: contain;
    filter: saturate(1.04) contrast(1.05);
}

body.dashboard-body .brand-logo-fallback {
    display: none;
    font-size: 18px;
    font-weight: 900;
    font-family: "Arial Black", "Aptos Display", "Segoe UI", sans-serif;
}

body.dashboard-body .brand-logo-img:not([src]),
body.dashboard-body .brand-logo-img[src=""] {
    display: none;
}

body.dashboard-body .brand-logo-img:not([src]) + .brand-logo-fallback,
body.dashboard-body .brand-logo-img[src=""] + .brand-logo-fallback {
    display: block;
}

body.dashboard-body .brand-logo-nsk { --brand-color: #174a8b; }
body.dashboard-body .brand-logo-fag { --brand-color: #0f6b46; }
body.dashboard-body .brand-logo-ina { --brand-color: #a45a12; }
body.dashboard-body .brand-logo-skf { --brand-color: #0d568f; }
body.dashboard-body .brand-logo-ntn { --brand-color: #5a46a3; }
body.dashboard-body .brand-logo-iko { --brand-color: #9b1f2e; }
body.dashboard-body .brand-logo-koyo { --brand-color: #2d5f64; }

@media (max-width: 980px) {
    body.dashboard-home .home-hero-panel,
    body.dashboard-home .smart-panel-head,
    body.dashboard-home .smart-query-row,
    body.dashboard-body .brand-logo-panel {
        grid-template-columns: 1fr;
    }

    body.dashboard-home .home-hero-panel {
        display: grid;
    }

    body.dashboard-home .dashboard-hero-tools,
    body.dashboard-home .dashboard-hero-controls {
        min-width: 0;
        width: 100%;
    }

    body.dashboard-home .dashboard-hero-controls,
    body.dashboard-home .search-mode-grid {
        grid-template-columns: 1fr;
    }

    body.dashboard-home .shell-action-btn {
        justify-self: stretch;
    }
}

.embedded-result-page {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: color-mix(in srgb, var(--surface-3) 66%, var(--surface-2));
}

body.layout-classic {
    --nav-width: 244px; --content-max: 1540px; --panel-pad: 24px; --panel-gap: 18px; --radius-panel: 18px; --radius-control: 12px;
}

body.layout-narrow {
    --nav-width: 92px; --content-max: 1580px; --panel-pad: 22px; --panel-gap: 16px; --radius-panel: 16px; --radius-control: 11px;
}

body.layout-narrow .sidebar {
    padding: 16px 10px;
}

body.layout-narrow .sidebar-brand {
    grid-template-columns: 1fr;
}

body.layout-narrow .sidebar-brand > div:not(.sidebar-mark),
body.layout-narrow .ghost-btn {
    display: none;
}

body.layout-narrow .sidebar-mark {
    width: 48px;
    margin: 0 auto;
}

body.layout-narrow .menu-list a {
    justify-content: center;
    font-size: 0;
    padding: 10px;
}

body.layout-narrow .menu-icon {
    font-size: 11px;
}

body.layout-wide {
    --nav-width: 304px; --content-max: 1760px; --panel-pad: 28px; --panel-gap: 20px; --radius-panel: 20px; --radius-control: 13px;
}

body.layout-wide .dashboard-main {
    padding-left: 40px;
    padding-right: 40px;
}

body.layout-rounded {
    --nav-width: 252px; --content-max: 1540px; --panel-pad: 26px; --panel-gap: 20px; --radius-panel: 30px; --radius-control: 999px;
}

body.layout-rounded .sidebar,
body.layout-rounded .query-console,
body.layout-rounded .query-result-page {
    border-radius: 28px;
}

body.layout-sharp {
    --nav-width: 236px; --content-max: 1500px; --panel-pad: 22px; --panel-gap: 14px; --radius-panel: 4px; --radius-control: 4px;
    --shadow-panel: 0 0 0 1px var(--line);
}

body.layout-sharp .sidebar-mark,
body.layout-sharp .menu-icon,
body.layout-sharp .gjp-table-wrap {
    border-radius: 3px;
}

body.layout-spacious {
    --nav-width: 268px; --content-max: 1680px; --panel-pad: 34px; --panel-gap: 26px; --radius-panel: 22px; --radius-control: 14px;
}

body.layout-spacious .dashboard-main {
    padding: 42px 46px 70px;
}

body.layout-spacious .detail-panel,
body.layout-spacious .module-entry {
    padding: 34px;
}

body.layout-compact {
    --nav-width: 220px; --content-max: 1460px; --panel-pad: 16px; --panel-gap: 10px; --radius-panel: 12px; --radius-control: 8px;
}

body.layout-compact .dashboard-main {
    padding: 18px 22px 34px;
}

body.layout-compact .detail-panel,
body.layout-compact .module-entry {
    padding: 16px;
}

body.layout-compact .query-stage {
    min-height: 64dvh;
}

body.layout-compact .gjp-data-table th,
body.layout-compact .gjp-data-table td {
    padding: 8px 10px;
}

body.layout-borderless {
    --nav-width: 244px; --content-max: 1600px; --panel-pad: 24px; --panel-gap: 18px; --radius-panel: 18px; --radius-control: 12px;
    --shadow-panel: none;
}

body.layout-borderless .detail-panel,
body.layout-borderless .module-entry,
body.layout-borderless .query-result-page,
body.layout-borderless .query-console {
    border-color: transparent;
    box-shadow: none;
}

body.layout-borderless .detail-panel {
    background: transparent;
}

body.layout-twocol {
    --nav-width: 244px; --content-max: 1660px; --panel-pad: 24px; --panel-gap: 18px; --radius-panel: 18px; --radius-control: 12px;
}

body.layout-twocol .dashboard-main {
    column-count: initial;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: var(--panel-gap);
}

body.layout-twocol .topbar,
body.layout-twocol .hero-panel,
body.layout-twocol .query-stage {
    grid-column: 1 / -1;
}

body.layout-twocol .detail-panel,
body.layout-twocol .hero-panel {
    break-inside: auto;
}

body.layout-topbar {
    --nav-width: 1fr; --content-max: 1680px; --panel-pad: 24px; --panel-gap: 18px; --radius-panel: 18px; --radius-control: 12px;
}

body.layout-topbar .dashboard-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
}

body.layout-topbar .sidebar {
    position: sticky;
    top: 0;
    z-index: 8;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 12px 22px;
}

body.layout-topbar .sidebar-brand {
    min-width: 220px;
}

body.layout-topbar .menu-list {
    display: flex;
    flex: 1;
    gap: 8px;
    margin: 0;
    overflow-x: auto;
}

body.layout-topbar .menu-list a {
    white-space: nowrap;
}

body.layout-topbar .ghost-btn {
    width: auto;
    min-width: 88px;
}

@media (max-width: 980px) {
    body.dashboard-body .dashboard-layout,
    body.layout-twocol .dashboard-main {
        display: block;
    }

    body.dashboard-body .dashboard-main {
        width: 100%;
        padding: 18px 14px 34px;
    }

    body.dashboard-body .sidebar {
        position: static;
        height: auto;
        border-radius: 0;
    }

    body.dashboard-body .topbar,
    body.dashboard-body .detail-header,
    .query-result-hero {
        display: grid;
        gap: 12px;
    }

    body.dashboard-body .topbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .query-console {
        grid-template-columns: 1fr;
    }

    .query-result-summary {
        text-align: left;
    }

    .loading-grid {
        grid-template-columns: 1fr;
    }

    body.layout-narrow .sidebar-brand > div:not(.sidebar-mark),
    body.layout-narrow .ghost-btn {
        display: block;
    }

    body.layout-narrow .sidebar-brand {
        grid-template-columns: 48px 1fr;
    }

    body.layout-narrow .menu-list a {
        justify-content: flex-start;
        font-size: 13px;
    }
}

/* 管家婆业务中台：把屏幕留给查询结果 */
body.gjp-page .topbar {
    position: relative !important;
    top: auto !important;
    z-index: auto !important;
    margin-bottom: 12px;
    background: transparent;
    backdrop-filter: none;
}

body.gjp-page .page-title {
    font-size: 23px;
}

body.gjp-page .page-subtitle {
    font-size: 12px;
}

body.gjp-page .service-strip-compact {
    padding: 10px 12px;
    margin-bottom: 12px;
}

body.gjp-page .service-strip-compact.resizable-panel {
    min-height: 0;
    resize: none;
    overflow: visible;
}

body.gjp-page .service-strip-head {
    display: grid;
    grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 0;
    align-items: center;
}

body.gjp-page .service-strip-compact .detail-title {
    font-size: 15px;
}

body.gjp-page .service-strip-compact .detail-subtitle {
    display: none;
    margin-top: 1px;
}

body.gjp-page .service-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

body.gjp-page .gjp-brand-panel {
    margin-top: 14px;
    margin-bottom: 16px;
}

body.gjp-page .service-actions .primary-btn,
body.gjp-page .service-actions .ghost-inline-btn {
    min-height: 34px;
    padding: 7px 13px;
}

body.gjp-page .service-strip-compact .detail-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    min-height: 36px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-3) 72%, var(--surface-2));
    line-height: 1.35;
    overflow: hidden;
}

body.gjp-page .manual-token-row {
    position: relative;
    margin: 0;
}

body.gjp-page .manual-token-row summary {
    cursor: pointer;
    color: var(--muted-ink);
    font-size: 12px;
    font-weight: 650;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: color-mix(in srgb, var(--surface-2) 86%, transparent);
    list-style: none;
}

body.gjp-page .manual-token-row summary::-webkit-details-marker {
    display: none;
}

body.gjp-page .manual-token-grid {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 12;
    width: min(520px, 70vw);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
    margin-top: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--surface-2);
    box-shadow: var(--shadow-panel);
}

body.gjp-page .manual-token-grid input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    padding: 9px 11px;
    background: var(--surface-2);
    color: var(--surface-ink);
}

body.gjp-page .query-stage {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 160px);
    padding: 22px;
    overflow: hidden;
}

body.gjp-page .query-stage-head {
    margin-bottom: 12px;
}

body.gjp-page .query-result-page {
    flex: 1 1 auto;
    min-height: 260px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
}

body.gjp-page .query-result-hero {
    flex: 0 0 auto;
    padding: 16px 20px;
}

body.gjp-page .result-box-large {
    flex: 1 1 auto;
    min-height: 220px;
    padding: 16px;
}

body.gjp-page .gjp-data-table th {
    position: static;
}

body.gjp-page .api-map-panel {
    display: none;
}

body.gjp-page .gjp-data-table {
    min-width: 1080px;
    font-size: 14px;
}

body.gjp-page .gjp-data-table th,
body.gjp-page .gjp-data-table td {
    padding: 13px 16px;
    vertical-align: middle;
}

body.gjp-page .gjp-data-table th:nth-child(1),
body.gjp-page .gjp-data-table td:nth-child(1) {
    width: 110px;
}

body.gjp-page .gjp-data-table th:nth-child(2),
body.gjp-page .gjp-data-table td:nth-child(2),
body.gjp-page .gjp-data-table th:nth-child(3),
body.gjp-page .gjp-data-table td:nth-child(3) {
    min-width: 230px;
}

body.gjp-page .warehouse-stock-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 220px;
}

body.gjp-page .warehouse-stock-list span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 76%, var(--surface-2));
    color: var(--surface-ink);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

body.gjp-page .warehouse-muted {
    color: var(--muted-ink);
    font-size: 12px;
}

/* 写接口通断状态卡片 */
.write-cap-panel { padding: 16px 20px; }
.write-cap-panel .detail-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.wcap-pill {
    display: inline-block; font-size: 13px; font-weight: 600;
    padding: 2px 10px; border-radius: 10px;
}
.wcap-pill-ok { background: #dcfce7; color: #166534; }
.wcap-pill-blocked { background: #fee2e2; color: #991b1b; }
.wcap-bar {
    height: 6px; border-radius: 3px; background: #fee2e2;
    margin: 10px 0 4px; overflow: hidden;
}
.wcap-bar-ok { height: 100%; background: #22c55e; border-radius: 3px; transition: width .4s; }
.wcap-details { margin-top: 4px; }
.wcap-summary {
    cursor: pointer; font-size: 13px; color: var(--text-muted);
    padding: 4px 0; user-select: none;
}
.wcap-summary:hover { color: var(--text-primary); }
.wcap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.wcap-col-head {
    font-size: 12px; font-weight: 600; padding: 4px 8px;
    border-radius: 6px; margin-bottom: 6px;
}
.wcap-col-head-ok { background: #f0fdf4; color: #166534; }
.wcap-col-head-blocked { background: #fef2f2; color: #991b1b; }
.wcap-item {
    font-size: 13px; padding: 3px 8px; border-radius: 4px;
    display: flex; align-items: baseline; gap: 8px;
}
.wcap-item-ok { color: var(--text-primary); justify-content: flex-start; }
.wcap-item-ok::before { content: "●"; color: #22c55e; font-size: 8px; margin-right: 4px; flex-shrink: 0; }
.wcap-item-blocked { color: var(--text-primary); justify-content: space-between; }
.wcap-item-blocked > span:first-child::before { content: "●"; color: #ef4444; font-size: 8px; margin-right: 4px; }
.wcap-reason { font-size: 11px; color: var(--text-muted); text-align: right; flex-shrink: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) {
    .wcap-grid { grid-template-columns: 1fr; }
}

body.dashboard-body .topbar-actions {
    gap: 10px;
}

body.dashboard-body .theme-switcher span {
    font-size: 11px;
    font-weight: 750;
    color: var(--muted-ink);
}

/* UI layout fixes: keep chrome in normal flow and reserve viewport for result workspaces. */
body.dashboard-body .topbar {
    position: relative;
    top: auto;
    z-index: 1;
    margin: 0 0 18px;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
}

body.dashboard-body .shell-action-btn {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: color-mix(in srgb, var(--surface-2) 88%, transparent);
    color: var(--surface-ink);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .16s cubic-bezier(.2,.8,.2,1), border-color .16s, background .16s, color .16s;
}

body.dashboard-body .shell-action-btn:hover {
    border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
    background: var(--accent-soft);
    color: var(--accent);
    transform: translateY(-1px);
}

body.dashboard-body .shell-action-btn:active {
    transform: translateY(1px);
}

body.dashboard-body .topbar-expand-btn {
    align-self: end;
}

body.dashboard-expanded .dashboard-main {
    width: 100%;
    max-width: none;
}

body.panel-resize-active,
body.panel-resize-active * {
    cursor: inherit;
    user-select: none;
}

body.panel-resize-active .resizable-panel,
body.panel-resize-active .resizable-panel *,
.resizable-panel.is-resizing,
.resizable-panel.is-resizing * {
    outline: 0 !important;
    box-shadow: none;
}

.resizable-panel[data-resized-height="true"] {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.resizable-panel[data-resized-height="true"] > .query-result-page,
.resizable-panel[data-resized-height="true"] > .embedded-result-page,
.resizable-panel[data-resized-height="true"] > .result-box,
.resizable-panel[data-resized-height="true"] > .module-grid {
    flex: 1 1 auto;
    min-height: 0;
}

.resizable-panel[data-resized-width="true"] {
    max-width: 100%;
}

body.gjp-page .dashboard-main {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: 18px;
    padding-bottom: 24px;
}

body.gjp-page .topbar {
    flex: 0 0 auto;
}

body.gjp-page .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.gjp-page .service-strip-compact {
    flex: 0 0 auto;
    padding: 8px 10px;
    margin-bottom: 10px;
}

body.gjp-page .service-strip-head {
    grid-template-columns: minmax(160px, 260px) minmax(0, 1fr);
}

body.gjp-page .query-stage {
    flex: 1 1 auto;
    min-height: calc(100dvh - 136px);
    padding: 18px;
    overflow: hidden;
}

body.gjp-page .query-console {
    grid-template-columns: minmax(190px, 250px) minmax(260px, 1fr) 112px;
    padding: 12px;
    gap: 12px;
}

body.gjp-page .gjp-brand-panel {
    margin-top: 10px;
    margin-bottom: 12px;
}

body.gjp-page .query-result-page {
    flex: 1 1 auto;
    min-height: max(360px, 52dvh);
}

body.gjp-page .result-box-large {
    flex: 1 1 auto;
    min-height: 320px;
    overflow: auto;
}

body.gjp-page .gjp-table-wrap {
    max-height: none;
    min-height: 260px;
}

@media (max-width: 980px) {
    body.dashboard-body .topbar-actions {
        grid-template-columns: 1fr 1fr;
    }

    body.dashboard-body .topbar-expand-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    body.gjp-page .service-strip-head,
    body.gjp-page .query-console {
        grid-template-columns: 1fr;
    }

    body.gjp-page .service-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    body.gjp-page .query-stage {
        min-height: 68dvh;
        padding: 14px;
    }
}

/* 管家婆页面最终收口：搜索结果优先，拉伸时不出现编辑态高亮。 */
body.gjp-page .topbar {
    position: static !important;
    z-index: auto !important;
    border: 0;
    box-shadow: none;
}

body.layout-topbar .sidebar {
    position: static !important;
    top: auto !important;
    z-index: 2;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}

body.gjp-page .query-stage,
body.gjp-page .query-stage.resizable-panel,
body.gjp-page .query-result-page,
body.gjp-page .result-box-large,
body.gjp-page .gjp-table-wrap {
    min-width: 0;
    max-width: 100%;
}

body.gjp-page .query-stage.resizable-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
}

body.gjp-page .query-console > *,
body.gjp-page .service-actions > * {
    min-width: 0;
}

body.gjp-page .query-result-page {
    flex: 1 1 auto;
    min-height: 0;
    border-color: color-mix(in srgb, var(--line) 88%, transparent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}

body.gjp-page .query-result-page.is-running {
    border-color: color-mix(in srgb, var(--line) 92%, transparent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}

body.gjp-page .query-result-page.is-running .query-result-hero {
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--accent-soft) 44%, var(--surface-2)), var(--surface-2));
}

body.panel-resize-active .query-result-page,
body.panel-resize-active .query-console,
body.panel-resize-active .gjp-table-wrap,
.resizable-panel.is-resizing .query-result-page,
.resizable-panel.is-resizing .query-console,
.resizable-panel.is-resizing .gjp-table-wrap,
.panel-resize-handle:focus,
.panel-resize-handle:focus-visible {
    outline: 0 !important;
    border-color: var(--line) !important;
    box-shadow: none !important;
}

body.gjp-page .gjp-table-wrap {
    flex: 1 1 auto;
    min-height: 260px;
    border-radius: 12px;
}

body.gjp-page .resizable-panel[data-resized-height="true"] .result-box-large {
    min-height: 0;
}

body.gjp-page .gjp-data-table {
    table-layout: fixed;
    min-width: 980px;
}

body.gjp-page .gjp-data-table th,
body.gjp-page .gjp-data-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

body.gjp-page .gjp-data-table th {
    background: color-mix(in srgb, var(--nav-bg) 86%, var(--surface-2));
    color: var(--nav-fg);
}

body.gjp-page .gjp-data-table tbody tr:hover td {
    background: color-mix(in srgb, var(--accent-soft) 52%, transparent);
}

body.gjp-page .gjp-data-table th:nth-child(1),
body.gjp-page .gjp-data-table td:nth-child(1) {
    width: 112px;
}

body.gjp-page .gjp-data-table th:nth-child(2),
body.gjp-page .gjp-data-table td:nth-child(2),
body.gjp-page .gjp-data-table th:nth-child(3),
body.gjp-page .gjp-data-table td:nth-child(3) {
    width: 210px;
}

body.gjp-page .gjp-data-table th:nth-child(4),
body.gjp-page .gjp-data-table td:nth-child(4) {
    width: 110px;
}

body.gjp-page .gjp-data-table th:nth-child(5),
body.gjp-page .gjp-data-table td:nth-child(5) {
    width: 140px;
}

body.gjp-page .warehouse-stock-list {
    min-width: 0;
    gap: 5px;
}

body.gjp-page .warehouse-stock-list span {
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-3) 64%, var(--surface-2));
    border-color: color-mix(in srgb, var(--line) 74%, var(--accent-soft));
}

/* 2026 CRM 全局视觉选择器：模板 + 质感 + 颜色，可在各模块复用。 */
body.crm-shell-2026 {
    --crm-shell-ring: color-mix(in srgb, var(--accent) 22%, var(--line));
    --crm-shell-soft: color-mix(in srgb, var(--accent-soft) 76%, var(--surface-2));
    --crm-shell-glass: color-mix(in srgb, var(--surface-2) 84%, transparent);
    --crm-shell-glass-strong: color-mix(in srgb, var(--surface-2) 92%, transparent);
}

body.crm-shell-2026 .crm-shell-controls {
    position: relative;
    display: flex;
    align-items: end;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
    max-width: 980px;
}

body.crm-shell-2026 .crm-shell-field {
    min-width: 162px;
}

body.crm-shell-2026 .crm-shell-field select {
    width: 100%;
    min-width: 0;
}

body.crm-shell-2026 .crm-shell-swatches {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 140px;
    min-height: 38px;
    padding: 3px 0;
}

body.crm-shell-2026 .crm-shell-swatches button {
    width: 24px;
    height: 24px;
    border: 1px solid color-mix(in srgb, var(--surface-ink) 12%, transparent);
    border-radius: 8px;
    background: var(--swatch);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
    cursor: pointer;
    transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .16s, border-color .16s;
}

body.crm-shell-2026 .crm-shell-swatches button:hover,
body.crm-shell-2026 .crm-shell-swatches button.active {
    border-color: color-mix(in srgb, var(--accent) 64%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent), inset 0 0 0 1px rgba(255,255,255,.55);
    transform: translateY(-1px);
}

body.crm-shell-2026 .crm-shell-settings-btn {
    min-width: 96px;
}

body.crm-shell-2026 .crm-shell-customizer {
    display: none;
    align-items: end;
    gap: 10px;
    width: min(420px, 100%);
    padding: 10px;
    border: 1px solid var(--crm-shell-ring);
    border-radius: 16px;
    background: var(--crm-shell-glass);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(16px);
}

body.crm-shell-2026.crm-shell-custom-open .crm-shell-customizer {
    display: flex;
}

body.crm-shell-2026 .crm-shell-customizer label {
    display: grid;
    gap: 4px;
    flex: 1 1 160px;
    color: var(--muted-ink);
    font-size: 11px;
    font-weight: 800;
}

body.crm-shell-2026 .crm-shell-customizer select {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--surface-2);
    color: var(--surface-ink);
    padding: 0 10px;
}

body.dashboard-home.crm-shell-2026.feel-glass .hero-panel,
body.dashboard-home.crm-shell-2026.feel-glass .detail-panel,
body.dashboard-home.crm-shell-2026.feel-glass .module-entry,
body.crm-shell-2026.feel-glass .topbar {
    background: var(--crm-shell-glass);
    border-color: var(--crm-shell-ring);
    backdrop-filter: blur(18px);
}

/* 真毛玻璃：半透明底、强背景模糊、边缘折射和底层光晕。 */
body.crm-shell-2026.feel-glass.dashboard-body {
    --crm-shell-glass: rgba(255, 255, 255, .46);
    --crm-shell-glass-strong: rgba(255, 255, 255, .74);
    --crm-shell-ring: rgba(255, 255, 255, .62);
    --shadow-panel: 0 24px 70px rgba(38, 88, 92, .16);
    background:
        radial-gradient(circle at 16% 12%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 30%),
        radial-gradient(circle at 82% 8%, rgba(255, 138, 92, .18), transparent 28%),
        linear-gradient(135deg, color-mix(in srgb, var(--surface) 78%, white), var(--surface-3));
}

body.crm-shell-2026.feel-glass .dashboard-main {
    position: relative;
    isolation: isolate;
}

body.crm-shell-2026.feel-glass .dashboard-main::before {
    content: "";
    position: fixed;
    inset: 56px 0 0 var(--nav-width);
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 18%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 24%),
        radial-gradient(circle at 74% 20%, rgba(255, 138, 92, .18), transparent 22%),
        radial-gradient(circle at 60% 78%, rgba(108, 126, 216, .15), transparent 26%);
    filter: blur(6px);
    opacity: .9;
}

body.crm-shell-2026.feel-glass .topbar,
body.dashboard-home.crm-shell-2026.feel-glass .hero-panel,
body.dashboard-home.crm-shell-2026.feel-glass .detail-panel,
body.dashboard-home.crm-shell-2026.feel-glass .module-entry {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .68), rgba(255, 255, 255, .34)) !important;
    border: 1px solid rgba(255, 255, 255, .64) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .78),
        inset 0 -1px 0 rgba(255, 255, 255, .26),
        0 22px 64px rgba(45, 88, 96, .14) !important;
    backdrop-filter: blur(24px) saturate(1.35);
    -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

body.crm-shell-2026.feel-glass .topbar::after,
body.dashboard-home.crm-shell-2026.feel-glass .detail-panel::after,
body.dashboard-home.crm-shell-2026.feel-glass .module-entry::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, .42), transparent 32%),
        radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .52), transparent 22%);
    opacity: .58;
}

body.crm-shell-2026.feel-glass .crm-shell-controls,
body.crm-shell-2026.feel-glass .crm-shell-customizer,
body.crm-shell-2026.feel-glass .crm-shell-controls .theme-switcher select,
body.crm-shell-2026.feel-glass .crm-shell-customizer select,
body.crm-shell-2026.feel-glass .crm-shell-controls .shell-action-btn {
    background: rgba(255, 255, 255, .48) !important;
    border-color: rgba(255, 255, 255, .62) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 10px 30px rgba(45, 88, 96, .08);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

body.crm-shell-2026.feel-glass .primary-btn {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 16px 34px color-mix(in srgb, var(--accent) 24%, transparent);
}

body.crm-shell-2026.feel-glass .fact-table th,
body.crm-shell-2026.feel-glass .task-table th,
body.crm-shell-2026.feel-glass .gjp-data-table th {
    background: var(--panel-bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.crm-shell-2026.feel-glass .detail-drawer,
body.crm-shell-2026.feel-glass .manual-correction-panel,
body.crm-shell-2026.feel-glass .drawer-section,
body.crm-shell-2026.feel-glass .modal,
body.crm-shell-2026.feel-glass .modal-content,
body.crm-shell-2026.feel-glass dialog {
    background: var(--panel-bg) !important;
    border-color: var(--border-color) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.dashboard-home.crm-shell-2026.feel-glass .home-hero-panel {
    min-height: 216px;
    color: var(--surface-ink);
    background:
        radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 30%),
        radial-gradient(circle at 76% 18%, rgba(255, 138, 92, .18), transparent 26%),
        linear-gradient(135deg, rgba(255, 255, 255, .58), rgba(255, 255, 255, .30)) !important;
}

body.dashboard-home.crm-shell-2026.feel-glass .home-hero-panel .hero-title,
body.dashboard-home.crm-shell-2026.feel-glass .home-hero-panel .hero-desc,
body.dashboard-home.crm-shell-2026.feel-glass .home-hero-panel .theme-switcher span,
body.dashboard-home.crm-shell-2026.feel-glass .home-hero-panel .shell-action-btn {
    color: var(--surface-ink) !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .56);
}

body.dashboard-home.crm-shell-2026.feel-glass .home-hero-panel .hero-title {
    font-weight: 900;
}

body.dashboard-home.crm-shell-2026.feel-glass .home-hero-panel .hero-desc {
    max-width: 680px;
    color: color-mix(in srgb, var(--surface-ink) 76%, transparent) !important;
}

body.dashboard-home.crm-shell-2026.feel-glass .dashboard-hero-controls,
body.dashboard-home.crm-shell-2026.feel-glass .dashboard-hero-controls .crm-shell-customizer {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .56), rgba(255, 255, 255, .30)) !important;
    border-color: rgba(255, 255, 255, .68) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .78),
        0 18px 48px rgba(46, 92, 100, .12) !important;
}

body.dashboard-home.crm-shell-2026.feel-glass .dashboard-hero-controls .theme-switcher select,
body.dashboard-home.crm-shell-2026.feel-glass .dashboard-hero-controls .crm-shell-customizer select {
    color: var(--surface-ink) !important;
    background: rgba(255, 255, 255, .62) !important;
    border-color: rgba(61, 96, 104, .22) !important;
}

body.dashboard-home.crm-shell-2026.feel-glass .dashboard-hero-controls .theme-switcher option,
body.dashboard-home.crm-shell-2026.feel-glass .dashboard-hero-controls .crm-shell-customizer option {
    color: #0f172a;
    background: #ffffff;
}

body.crm-shell-2026.feel-glass.layout-topbar .sidebar {
    --nav-fg: var(--surface-ink);
    --nav-muted: color-mix(in srgb, var(--surface-ink) 68%, transparent);
    color: var(--surface-ink) !important;
    background:
        radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 26%),
        radial-gradient(circle at 78% 0%, rgba(255, 138, 92, .16), transparent 22%),
        linear-gradient(135deg, rgba(255,255,255,.58), rgba(255,255,255,.30)) !important;
    border: 1px solid rgba(255,255,255,.68) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.76),
        inset 0 -1px 0 rgba(255,255,255,.24),
        0 18px 48px rgba(46, 92, 100, .14) !important;
    backdrop-filter: blur(24px) saturate(1.35);
    -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

body.crm-shell-2026.feel-glass.layout-topbar .sidebar-title,
body.crm-shell-2026.feel-glass.layout-topbar .sidebar-subtitle,
body.crm-shell-2026.feel-glass.layout-topbar .menu-list a,
body.crm-shell-2026.feel-glass.layout-topbar .ghost-btn,
body.crm-shell-2026.feel-glass.layout-topbar .sidebar-collapse-btn,
body.crm-shell-2026.feel-glass.layout-topbar .sidebar-mark,
body.crm-shell-2026.feel-glass.layout-topbar .menu-icon {
    color: var(--surface-ink) !important;
    text-shadow: 0 1px 0 rgba(255,255,255,.5);
}

body.crm-shell-2026.feel-glass.layout-topbar .sidebar-mark,
body.crm-shell-2026.feel-glass.layout-topbar .sidebar-collapse-btn,
body.crm-shell-2026.feel-glass.layout-topbar .menu-icon,
body.crm-shell-2026.feel-glass.layout-topbar .ghost-btn {
    background: rgba(255,255,255,.36) !important;
    border-color: rgba(255,255,255,.58) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 10px 28px rgba(46,92,100,.08);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

body.crm-shell-2026.feel-glass.layout-topbar .menu-list a {
    background: rgba(255,255,255,.18);
    border: 1px solid transparent;
}

body.crm-shell-2026.feel-glass.layout-topbar .menu-list a:hover {
    background: rgba(255,255,255,.34);
    border-color: rgba(255,255,255,.46);
    transform: translateY(-1px);
}

body.crm-shell-2026.feel-glass.layout-topbar .menu-list a.active {
    background: color-mix(in srgb, var(--accent) 18%, rgba(255,255,255,.42)) !important;
    border-color: color-mix(in srgb, var(--accent) 38%, rgba(255,255,255,.52)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.72),
        0 14px 32px color-mix(in srgb, var(--accent) 14%, transparent) !important;
}

body.crm-shell-2026.feel-tech .dashboard-main {
    background-image:
        linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px);
    background-size: 34px 34px;
}

body.crm-shell-2026.feel-bento .detail-panel,
body.crm-shell-2026.feel-bento .module-entry {
    box-shadow: 0 1px 0 rgba(255,255,255,.8), 0 16px 38px rgba(29, 45, 57, .08);
}

body.crm-shell-2026.feel-spatial .detail-panel,
body.crm-shell-2026.feel-spatial .module-entry {
    transform: translateZ(0);
    box-shadow: 0 18px 42px color-mix(in srgb, var(--accent) 12%, transparent);
}

body.crm-shell-2026.feel-minimal .hero-panel {
    box-shadow: none;
}

body.crm-shell-2026.feel-command .status-badge,
body.crm-shell-2026.feel-command .menu-icon {
    font-variant-numeric: tabular-nums;
}

body.crm-shell-2026.feel-warm {
    --shadow-panel: 0 18px 40px rgba(102, 76, 48, .11);
}

body.crm-shell-2026.feel-motion .module-entry,
body.crm-shell-2026.feel-motion .ghost-inline-btn,
body.crm-shell-2026.feel-motion .primary-btn,
body.crm-shell-2026.feel-motion .shell-action-btn {
    transition-duration: .24s;
    transition-timing-function: cubic-bezier(.2,.8,.2,1);
}

body.crm-shell-2026.density-compact .dashboard-main {
    padding: 16px 20px;
}

body.crm-shell-2026.density-compact .detail-panel,
body.crm-shell-2026.density-compact .module-entry {
    padding: 16px;
}

body.crm-shell-2026.density-airy .dashboard-main {
    padding: 34px 38px;
}

body.crm-shell-2026.density-airy .detail-panel,
body.crm-shell-2026.density-airy .module-entry {
    padding: 28px;
}

body.crm-shell-2026.priority-model .model-card,
body.crm-shell-2026.priority-model .ai-analysis-card {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

body.crm-shell-2026.priority-evidence .result-box,
body.crm-shell-2026.priority-evidence .detail-status {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
    background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface-2));
}

body.dashboard-home.crm-shell-2026 .dashboard-hero-tools {
    min-width: min(720px, 50vw);
}

body.dashboard-home.crm-shell-2026 .dashboard-hero-controls.crm-shell-controls {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

body.dashboard-home.crm-shell-2026 .dashboard-hero-controls .crm-shell-field {
    min-width: 150px;
}

body.dashboard-home.crm-shell-2026 .dashboard-hero-controls .crm-shell-customizer {
    border-color: color-mix(in srgb, #ffffff 26%, transparent);
    background: color-mix(in srgb, #ffffff 16%, transparent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

body.dashboard-home.crm-shell-2026 .dashboard-hero-controls .crm-shell-customizer label {
    color: color-mix(in srgb, #ffffff 78%, transparent);
}

body.dashboard-home.crm-shell-2026 .dashboard-hero-controls .crm-shell-customizer select {
    border-color: color-mix(in srgb, #ffffff 28%, transparent);
    background: color-mix(in srgb, #ffffff 18%, transparent);
    color: #fff;
}

body.dashboard-home.crm-shell-2026 .dashboard-hero-controls .crm-shell-customizer option {
    color: #0f172a;
}

body.model-collab-redesign.crm-shell-2026 .dashboard-main {
    min-height: 100dvh;
    background:
        radial-gradient(circle at 20% 12%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 28%),
        radial-gradient(circle at 84% 18%, rgba(255,138,92,.16), transparent 24%),
        linear-gradient(135deg, var(--surface), var(--surface-3));
}

body.model-collab-redesign.crm-shell-2026 .model-collab-main-pad {
    min-width: 0;
}

/* Distinct 2026 CRM templates. Keep these scoped to the shell/dashboard so business modules stay stable. */
body.dashboard-body.layout-classic .sidebar {
    border-radius: 0 24px 24px 0;
}

body.dashboard-home.layout-classic .home-hero-panel {
    min-height: 300px;
    display: grid;
    grid-template-columns: minmax(320px, .86fr) minmax(420px, 1.14fr);
    align-items: center;
    border-radius: 34px;
}

body.dashboard-home.layout-classic .dashboard-hero-controls {
    justify-self: end;
    max-width: 780px;
    border-radius: 28px;
}

body.dashboard-home.layout-classic .home-smart-panel,
body.dashboard-home.layout-classic .dashboard-main > .detail-panel:not(.home-smart-panel),
body.dashboard-home.layout-classic .module-entry {
    border-radius: 28px;
}

body.dashboard-home.layout-wide .dashboard-main {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
}

body.dashboard-home.layout-wide .home-hero-panel {
    grid-column: span 5;
    min-height: 520px;
    display: grid;
    align-content: space-between;
    margin-bottom: 0;
}

body.dashboard-home.layout-wide .dashboard-hero-tools {
    min-width: 0;
    width: 100%;
}

body.dashboard-home.layout-wide .dashboard-hero-controls {
    grid-template-columns: 1fr;
}

body.dashboard-home.layout-wide .home-smart-panel {
    grid-column: span 7;
    margin-bottom: 0;
}

body.dashboard-home.layout-wide .home-smart-panel + .detail-panel {
    grid-column: span 5;
    margin-bottom: 0;
}

body.dashboard-home.layout-wide .module-grid {
    grid-column: span 7;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    align-content: stretch;
    margin-bottom: 0;
}

body.dashboard-home.layout-wide .module-entry:first-child,
body.dashboard-home.layout-wide .module-entry:nth-child(4) {
    min-height: 240px;
}

body.dashboard-home.layout-wide .module-entry {
    min-height: 158px;
    border-radius: 12px;
}

body.dashboard-home.layout-twocol .dashboard-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: 22px;
}

body.dashboard-home.layout-twocol .home-hero-panel,
body.dashboard-home.layout-twocol .home-smart-panel {
    grid-column: 1;
}

body.dashboard-home.layout-twocol .home-hero-panel {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

body.dashboard-home.layout-twocol .home-hero-panel > div:first-child {
    max-width: none;
}

body.dashboard-home.layout-twocol .dashboard-hero-tools {
    min-width: 0;
    width: 100%;
}

body.dashboard-home.layout-twocol .dashboard-hero-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.dashboard-home.layout-twocol .smart-panel-head {
    grid-template-columns: 1fr;
    align-items: start;
}

body.dashboard-home.layout-twocol .search-mode-grid {
    grid-template-columns: 1fr;
}

body.dashboard-home.layout-twocol .function-choice {
    min-height: 64px;
}

body.dashboard-home.layout-twocol .home-smart-panel + .detail-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 100%;
    align-self: stretch;
}

body.dashboard-home.layout-twocol .home-smart-panel + .detail-panel::before {
    content: "AI COPILOT";
    display: inline-grid;
    place-items: center;
    height: 30px;
    padding: 0 10px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
}

body.dashboard-home.layout-twocol .module-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.dashboard-home.layout-spacious .dashboard-main {
    position: relative;
    padding-top: 58px;
}

body.dashboard-home.layout-spacious .home-hero-panel {
    width: min(86%, 1320px);
    min-height: 360px;
    margin-left: auto;
    margin-bottom: -38px;
    z-index: 2;
    transform: translateX(-2%);
}

body.dashboard-home.layout-spacious .home-smart-panel {
    width: min(88%, 1360px);
    margin-left: 0;
    padding-top: 52px;
    z-index: 1;
}

body.dashboard-home.layout-spacious .home-smart-panel + .detail-panel {
    width: min(76%, 1160px);
    margin-left: auto;
    transform: translateY(-12px);
}

body.dashboard-home.layout-spacious .module-grid {
    width: min(88%, 1360px);
    margin-left: 6%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.dashboard-home.layout-spacious .detail-panel,
body.dashboard-home.layout-spacious .module-entry {
    box-shadow: 0 30px 70px color-mix(in srgb, var(--accent) 12%, transparent);
}

body.dashboard-home.layout-borderless .dashboard-main {
    max-width: 1180px;
    padding-top: 76px;
}

body.dashboard-home.layout-borderless .home-hero-panel {
    min-height: 220px;
    display: block;
    padding: 0 0 34px;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
}

body.dashboard-home.layout-borderless .home-hero-panel > div:first-child {
    max-width: min(100%, 780px);
}

body.dashboard-home.layout-borderless .home-hero-panel .hero-title {
    max-width: none;
    font-size: clamp(34px, 3.2vw, 46px);
    line-height: 1.08;
}

body.dashboard-home.layout-borderless .dashboard-hero-tools {
    width: 100%;
    min-width: 0;
    margin-top: 24px;
}

body.dashboard-home.layout-borderless .dashboard-hero-controls,
body.dashboard-home.layout-borderless .home-smart-panel,
body.dashboard-home.layout-borderless .dashboard-main > .detail-panel:not(.home-smart-panel),
body.dashboard-home.layout-borderless .module-entry {
    border-width: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
}

body.dashboard-home.layout-borderless .home-smart-panel {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

body.dashboard-home.layout-borderless .module-grid {
    grid-template-columns: 1fr;
}

body.dashboard-home.layout-borderless .module-entry {
    min-height: 98px;
    grid-template-columns: 96px 1fr;
    align-items: center;
    border-top: 1px solid var(--line);
}

body.dashboard-home.layout-compact .dashboard-main {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(380px, .96fr);
    gap: 12px;
    padding-top: 18px;
}

body.dashboard-home.layout-compact .home-hero-panel {
    grid-column: 1 / -1;
    min-height: 158px;
    display: grid;
    grid-template-columns: minmax(280px, .75fr) minmax(520px, 1.25fr);
    margin-bottom: 0;
    border-radius: 10px;
}

body.dashboard-home.layout-compact .dashboard-hero-controls {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    padding: 10px;
    border-radius: 8px;
}

body.dashboard-home.layout-compact .smart-panel-head {
    grid-template-columns: 1fr;
    align-items: start;
}

body.dashboard-home.layout-compact .search-mode-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}

body.dashboard-home.layout-compact .home-smart-panel,
body.dashboard-home.layout-compact .home-smart-panel + .detail-panel,
body.dashboard-home.layout-compact .module-grid {
    margin-bottom: 0;
}

body.dashboard-home.layout-compact .home-smart-panel {
    grid-column: 1;
}

body.dashboard-home.layout-compact .home-smart-panel + .detail-panel {
    grid-column: 2;
}

body.dashboard-home.layout-compact .module-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.dashboard-home.layout-compact .detail-panel,
body.dashboard-home.layout-compact .module-entry,
body.dashboard-home.layout-compact .function-choice,
body.dashboard-home.layout-compact .brand-logo-btn {
    border-radius: 8px;
}

body.dashboard-home.layout-compact .module-entry {
    min-height: 116px;
}

body.dashboard-home.layout-rounded {
    --radius-panel: 36px;
    --radius-control: 999px;
}

body.dashboard-home.layout-rounded .home-hero-panel {
    min-height: 330px;
    display: grid;
    grid-template-columns: minmax(300px, .8fr) minmax(420px, 1.2fr);
    border-radius: 48px;
    padding: 42px;
}

body.dashboard-home.layout-rounded .dashboard-hero-controls {
    border-radius: 34px;
}

body.dashboard-home.layout-rounded .home-smart-panel {
    border-radius: 38px;
    padding: 34px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.88),
        0 26px 58px color-mix(in srgb, var(--accent) 14%, transparent);
}

body.dashboard-home.layout-rounded .function-choice,
body.dashboard-home.layout-rounded .brand-logo-btn,
body.dashboard-home.layout-rounded .module-entry {
    border-radius: 28px;
}

body.dashboard-home.layout-rounded .smart-query-row .primary-btn {
    border-radius: 999px;
}

body.dashboard-home.layout-rounded .module-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
}

body.dashboard-home.layout-sharp {
    --radius-panel: 2px;
    --radius-control: 2px;
    --shadow-panel: none;
}

body.dashboard-body.layout-sharp .sidebar,
body.dashboard-body.layout-sharp .sidebar-mark,
body.dashboard-body.layout-sharp .menu-icon,
body.dashboard-body.layout-sharp .ghost-btn {
    border-radius: 0;
}

body.dashboard-home.layout-sharp .dashboard-main {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
    gap: 18px;
    background-image:
        linear-gradient(color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px);
    background-size: 28px 28px;
}

body.dashboard-home.layout-sharp .home-hero-panel {
    grid-column: 1 / -1;
    min-height: 240px;
    display: grid;
    grid-template-columns: minmax(300px, .72fr) minmax(520px, 1.28fr);
    border-radius: 0;
    clip-path: polygon(0 0, 100% 0, 100% 88%, 97% 100%, 0 100%);
}

body.dashboard-home.layout-sharp .dashboard-hero-controls {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    border-radius: 0;
}

body.dashboard-home.layout-sharp .home-smart-panel,
body.dashboard-home.layout-sharp .home-smart-panel + .detail-panel,
body.dashboard-home.layout-sharp .module-grid {
    margin-bottom: 0;
}

body.dashboard-home.layout-sharp .home-smart-panel {
    grid-column: 1 / -1;
    border-radius: 0;
}

body.dashboard-home.layout-sharp .home-smart-panel + .detail-panel {
    grid-column: 1;
    border-radius: 0;
}

body.dashboard-home.layout-sharp .module-grid {
    grid-column: 2;
    grid-template-columns: 1fr;
}

body.dashboard-home.layout-sharp .detail-panel,
body.dashboard-home.layout-sharp .module-entry,
body.dashboard-home.layout-sharp .function-choice,
body.dashboard-home.layout-sharp .brand-logo-btn,
body.dashboard-home.layout-sharp .smart-query-row textarea,
body.dashboard-home.layout-sharp .smart-query-row .primary-btn {
    border-radius: 0;
}

body.dashboard-home.layout-sharp .module-entry {
    min-height: 96px;
    grid-template-columns: 72px 1fr;
    align-items: center;
}

body.dashboard-home.layout-sharp .module-entry:hover {
    transform: translateX(6px);
}

/* 2026 shell variants: each template changes navigation, not just cards. */
body.dashboard-body.layout-classic {
    --nav-width: 292px;
}

body.dashboard-body.layout-classic .dashboard-layout {
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
}

body.dashboard-body.layout-classic .sidebar {
    margin: 18px 0 18px 18px;
    height: calc(100dvh - 36px);
    border: 1px solid rgba(255,255,255,.68);
    border-radius: 34px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.44), rgba(255,255,255,.16)),
        linear-gradient(180deg, color-mix(in srgb, var(--accent) 42%, #ffffff), color-mix(in srgb, var(--nav-bg) 74%, #ffffff));
    box-shadow: 0 24px 60px color-mix(in srgb, var(--accent) 18%, transparent);
    backdrop-filter: blur(24px) saturate(1.16);
}

body.dashboard-body.layout-classic .sidebar-brand {
    grid-template-columns: 58px 1fr;
    padding: 8px;
    border-radius: 24px;
    background: rgba(255,255,255,.14);
}

body.dashboard-body.layout-classic .menu-list a {
    min-height: 48px;
    border-radius: 18px;
}

body.dashboard-body.layout-classic .menu-list a.active {
    background: rgba(255,255,255,.2);
    box-shadow: inset 4px 0 0 rgba(255,255,255,.92), 0 12px 28px rgba(0,0,0,.08);
}

body.dashboard-body.layout-wide {
    --nav-width: 1fr;
}

body.dashboard-body.layout-wide .dashboard-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
}

body.dashboard-body.layout-wide .sidebar {
    position: sticky;
    top: 12px;
    z-index: 12;
    height: auto;
    min-height: 0;
    margin: 12px 30px 0;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: minmax(210px, .7fr) minmax(0, 2.6fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255,255,255,.84);
    color: var(--surface-ink);
    box-shadow: 0 16px 44px color-mix(in srgb, var(--accent) 10%, transparent);
    backdrop-filter: blur(18px) saturate(1.12);
}

body.dashboard-body.layout-wide .sidebar-brand {
    min-height: 0;
}

body.dashboard-body.layout-wide .sidebar-title,
body.dashboard-body.layout-wide .sidebar-subtitle,
body.dashboard-body.layout-wide .menu-list a,
body.dashboard-body.layout-wide .ghost-btn {
    color: var(--surface-ink);
}

body.dashboard-body.layout-wide .sidebar-subtitle {
    color: var(--muted-ink);
}

body.dashboard-body.layout-wide .menu-list {
    display: grid;
    grid-template-columns: repeat(8, minmax(86px, 1fr));
    gap: 8px;
    margin: 0;
}

body.dashboard-body.layout-wide .menu-list a {
    min-height: 46px;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,.62);
    text-align: center;
}

body.dashboard-body.layout-wide .menu-list a.active {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
}

body.dashboard-body.layout-wide .menu-icon,
body.dashboard-body.layout-wide .sidebar-mark,
body.dashboard-body.layout-wide .sidebar-collapse-btn {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 26%, transparent);
}

body.dashboard-body.layout-wide .sidebar form {
    margin-left: auto;
}

body.dashboard-body.layout-wide .ghost-btn {
    width: auto;
    min-width: 96px;
    border-color: var(--line);
    background: rgba(255,255,255,.58);
}

body.dashboard-body.layout-wide .dashboard-main {
    grid-row: 2;
    width: 100%;
    max-width: none;
}

body.dashboard-body.sidebar-collapsed.layout-wide .sidebar-brand > div:not(.sidebar-mark),
body.dashboard-body.sidebar-collapsed.layout-wide .ghost-btn {
    display: block;
    font-size: inherit;
}

body.dashboard-body.layout-twocol {
    --nav-width: 286px;
}

body.dashboard-body.layout-twocol .dashboard-layout {
    grid-template-columns: minmax(0, 1fr) var(--nav-width);
}

body.dashboard-body.layout-twocol .dashboard-main {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: none;
}

body.dashboard-body.layout-twocol .sidebar {
    grid-column: 2;
    grid-row: 1;
    height: calc(100dvh - 28px);
    margin: 14px 14px 14px 0;
    border: 1px solid var(--line);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.7)),
        color-mix(in srgb, var(--accent-soft) 56%, #ffffff);
    color: var(--surface-ink);
    box-shadow: -18px 0 54px color-mix(in srgb, var(--accent) 10%, transparent);
}

body.dashboard-body.layout-twocol .sidebar::before {
    content: "AI COPILOT";
    display: inline-grid;
    place-items: center;
    width: max-content;
    height: 30px;
    padding: 0 12px;
    margin: 10px 0 16px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

body.dashboard-body.layout-twocol .sidebar-title,
body.dashboard-body.layout-twocol .sidebar-subtitle,
body.dashboard-body.layout-twocol .menu-list a,
body.dashboard-body.layout-twocol .ghost-btn {
    color: var(--surface-ink);
}

body.dashboard-body.layout-twocol .sidebar-subtitle {
    color: var(--muted-ink);
}

body.dashboard-body.layout-twocol .menu-list a {
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.66);
}

body.dashboard-body.layout-twocol .menu-list a.active {
    border-color: color-mix(in srgb, var(--accent) 48%, transparent);
    background: color-mix(in srgb, var(--accent-soft) 70%, #ffffff);
    box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 10%, transparent);
}

body.dashboard-body.layout-twocol .menu-icon,
body.dashboard-body.layout-twocol .sidebar-mark,
body.dashboard-body.layout-twocol .sidebar-collapse-btn {
    background: color-mix(in srgb, var(--accent-soft) 80%, #ffffff);
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

body.dashboard-body.layout-twocol .ghost-btn {
    border-color: var(--line);
    background: rgba(255,255,255,.66);
}

body.dashboard-body.layout-spacious {
    --nav-width: 124px;
}

body.dashboard-body.layout-spacious .dashboard-layout {
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
}

body.dashboard-body.layout-spacious .sidebar {
    align-items: center;
    position: sticky;
    top: 26px;
    justify-self: start;
    width: 112px;
    margin: 26px 0 26px 20px;
    height: calc(100dvh - 52px);
    padding: 16px 10px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 999px;
    background: rgba(255,255,255,.68);
    color: var(--surface-ink);
    box-shadow: 0 22px 52px color-mix(in srgb, var(--accent) 12%, transparent);
    backdrop-filter: blur(20px) saturate(1.18);
    overflow: visible;
    transition: transform .34s ease, opacity .34s ease, box-shadow .34s ease, background .34s ease;
    animation: crmSpatialDockGlow 8s ease-in-out infinite alternate;
}

body.dashboard-body.layout-spacious .sidebar::after {
    content: "导航";
    position: absolute;
    top: 50%;
    right: -38px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 92px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 78%, rgba(255,255,255,.86));
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    writing-mode: vertical-rl;
    transform: translateY(-50%);
    box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 18%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease, transform .28s ease;
}

body.dashboard-body.layout-spacious .sidebar-brand {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    padding-right: 0;
}

body.dashboard-body.layout-spacious .sidebar-brand > div:not(.sidebar-mark) {
    display: none;
}

body.dashboard-body.layout-spacious .sidebar-collapse-btn {
    position: static;
}

body.dashboard-body.layout-spacious .menu-list {
    margin: 28px 0;
}

body.dashboard-body.layout-spacious .menu-list a {
    width: 76px;
    min-height: 58px;
    justify-content: center;
    padding: 8px;
    border-radius: 22px;
    font-size: 0;
    background: rgba(255,255,255,.5);
}

body.dashboard-body.layout-spacious .menu-list a.active {
    transform: translateX(18px);
    background: var(--accent);
    box-shadow: 0 18px 34px color-mix(in srgb, var(--accent) 28%, transparent);
    animation: crmSpatialActiveFloat 4.8s ease-in-out infinite;
}

body.dashboard-body.layout-spacious .menu-list a.active .menu-icon {
    color: #fff;
}

body.dashboard-body.layout-spacious .menu-icon,
body.dashboard-body.layout-spacious .sidebar-mark,
body.dashboard-body.layout-spacious .sidebar-collapse-btn {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: transparent;
}

body.dashboard-body.layout-spacious .ghost-btn {
    width: 78px;
    min-height: 48px;
    padding: 0;
    border-radius: 999px;
    color: var(--surface-ink);
    font-size: 0;
    background: rgba(255,255,255,.56);
}

body.dashboard-body.layout-spacious .ghost-btn::after {
    content: "EXIT";
    font-size: 11px;
    font-weight: 900;
}

body.dashboard-body.layout-spacious.sidebar-collapsed {
    --nav-width: 36px;
}

body.dashboard-body.layout-spacious.sidebar-collapsed .dashboard-layout {
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
}

body.dashboard-body.layout-spacious.sidebar-collapsed .sidebar {
    transform: translateX(-100px);
    opacity: .74;
}

body.dashboard-body.layout-spacious.sidebar-collapsed .sidebar::after {
    opacity: 1;
    transform: translateY(-50%) translateX(4px);
    animation: crmSpatialNavHint 3.8s ease-in-out infinite;
}

body.dashboard-body.layout-spacious.sidebar-collapsed .sidebar:hover,
body.dashboard-body.layout-spacious.sidebar-collapsed .sidebar:focus-within {
    transform: translateX(0);
    opacity: 1;
    z-index: 20;
    background: rgba(255,255,255,.82);
    box-shadow: 0 28px 72px color-mix(in srgb, var(--accent) 22%, transparent);
}

body.dashboard-body.layout-spacious.sidebar-collapsed .sidebar:hover::after,
body.dashboard-body.layout-spacious.sidebar-collapsed .sidebar:focus-within::after {
    opacity: .18;
}

@keyframes crmSpatialDockGlow {
    0% {
        box-shadow: 0 18px 46px color-mix(in srgb, var(--accent) 10%, transparent);
    }
    100% {
        box-shadow: 0 28px 70px color-mix(in srgb, var(--accent) 20%, transparent);
    }
}

@keyframes crmSpatialActiveFloat {
    0%, 100% {
        transform: translateX(14px);
    }
    50% {
        transform: translateX(22px);
    }
}

@keyframes crmSpatialNavHint {
    0%, 100% {
        transform: translateY(-50%) translateX(4px);
    }
    50% {
        transform: translateY(-50%) translateX(10px);
    }
}

body.dashboard-body.layout-borderless {
    --nav-width: 1fr;
}

body.dashboard-body.layout-borderless .dashboard-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
}

body.dashboard-body.layout-borderless .sidebar {
    position: sticky;
    top: 0;
    z-index: 11;
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(210px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 16px 42px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255,255,255,.76);
    color: var(--surface-ink);
    box-shadow: none;
    backdrop-filter: blur(14px);
}

body.dashboard-body.layout-borderless .sidebar-title,
body.dashboard-body.layout-borderless .sidebar-subtitle,
body.dashboard-body.layout-borderless .menu-list a,
body.dashboard-body.layout-borderless .ghost-btn {
    color: var(--surface-ink);
}

body.dashboard-body.layout-borderless .sidebar-subtitle {
    color: var(--muted-ink);
}

body.dashboard-body.layout-borderless .menu-list {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 0;
}

body.dashboard-body.layout-borderless .menu-list a {
    min-height: 34px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted-ink);
    box-shadow: inset 0 -2px 0 transparent;
}

body.dashboard-body.layout-borderless .menu-list a.active {
    background: transparent;
    color: var(--surface-ink);
    box-shadow: inset 0 -2px 0 var(--accent);
}

body.dashboard-body.layout-borderless .menu-icon,
body.dashboard-body.layout-borderless .sidebar-mark,
body.dashboard-body.layout-borderless .sidebar-collapse-btn {
    background: transparent;
    color: var(--accent);
    border-color: var(--line);
}

body.dashboard-body.layout-borderless .sidebar form {
    margin-left: auto;
}

body.dashboard-body.layout-borderless .ghost-btn {
    width: auto;
    min-width: 86px;
    border-color: var(--line);
    background: transparent;
}

body.dashboard-body.sidebar-collapsed.layout-borderless .sidebar-brand > div:not(.sidebar-mark),
body.dashboard-body.sidebar-collapsed.layout-borderless .ghost-btn {
    display: block;
    font-size: inherit;
}

body.dashboard-body.layout-compact {
    --nav-width: 1fr;
}

body.dashboard-body.layout-compact .dashboard-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
}

body.dashboard-body.layout-compact .sidebar {
    position: sticky;
    top: 8px;
    z-index: 12;
    height: auto;
    min-height: 0;
    margin: 8px 18px 0;
    padding: 8px;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
    border-radius: 10px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--accent-soft) 72%, #ffffff), rgba(255,255,255,.9));
    color: var(--surface-ink);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 8%, transparent);
}

body.dashboard-body.layout-compact .sidebar-title,
body.dashboard-body.layout-compact .sidebar-subtitle,
body.dashboard-body.layout-compact .menu-list a,
body.dashboard-body.layout-compact .ghost-btn {
    color: var(--surface-ink);
}

body.dashboard-body.layout-compact .sidebar-subtitle {
    color: var(--muted-ink);
}

body.dashboard-body.layout-compact .menu-list {
    display: grid;
    grid-template-columns: repeat(8, minmax(78px, 1fr));
    gap: 6px;
    margin: 0;
}

body.dashboard-body.layout-compact .menu-list a {
    min-height: 36px;
    justify-content: center;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: rgba(255,255,255,.54);
    font-size: 12px;
}

body.dashboard-body.layout-compact .menu-list a.active {
    border-color: var(--accent);
    background: rgba(255,255,255,.88);
    box-shadow: inset 0 -3px 0 var(--accent);
}

body.dashboard-body.layout-compact .menu-icon,
body.dashboard-body.layout-compact .sidebar-mark,
body.dashboard-body.layout-compact .sidebar-collapse-btn {
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}

body.dashboard-body.layout-compact .sidebar form {
    margin-left: auto;
}

body.dashboard-body.layout-compact .ghost-btn {
    width: auto;
    min-width: 88px;
    min-height: 36px;
    border-radius: 6px;
    border-color: color-mix(in srgb, var(--accent) 18%, transparent);
    background: rgba(255,255,255,.6);
}

body.dashboard-body.sidebar-collapsed.layout-compact .sidebar-brand > div:not(.sidebar-mark),
body.dashboard-body.sidebar-collapsed.layout-compact .ghost-btn {
    display: block;
    font-size: inherit;
}

body.dashboard-body.layout-rounded {
    --nav-width: 300px;
}

body.dashboard-body.layout-rounded .sidebar {
    margin: 20px 0 20px 18px;
    height: calc(100dvh - 40px);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, #ffffff);
    border-radius: 46px;
    background:
        radial-gradient(circle at 18% 0, rgba(255,255,255,.88), transparent 42%),
        linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 76%, #ffffff), rgba(255,255,255,.78));
    color: var(--surface-ink);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.9),
        0 24px 64px color-mix(in srgb, var(--accent) 12%, transparent);
}

body.dashboard-body.layout-rounded .sidebar-brand {
    grid-template-columns: 62px 1fr;
    padding: 12px;
    border-radius: 32px;
    background: rgba(255,255,255,.58);
}

body.dashboard-body.layout-rounded .sidebar-title,
body.dashboard-body.layout-rounded .sidebar-subtitle,
body.dashboard-body.layout-rounded .menu-list a,
body.dashboard-body.layout-rounded .ghost-btn {
    color: var(--surface-ink);
}

body.dashboard-body.layout-rounded .sidebar-subtitle {
    color: var(--muted-ink);
}

body.dashboard-body.layout-rounded .menu-list a {
    min-height: 56px;
    border-radius: 999px;
    background: rgba(255,255,255,.5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.76);
}

body.dashboard-body.layout-rounded .menu-list a.active {
    background: #fff;
    color: var(--surface-ink);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 12%, transparent);
}

body.dashboard-body.layout-rounded .menu-icon,
body.dashboard-body.layout-rounded .sidebar-mark,
body.dashboard-body.layout-rounded .sidebar-collapse-btn {
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 82%, #ffffff);
    color: var(--accent);
    border-color: transparent;
}

body.dashboard-body.layout-rounded .ghost-btn {
    border-radius: 999px;
    border-color: color-mix(in srgb, var(--accent) 18%, transparent);
    background: rgba(255,255,255,.58);
}

body.dashboard-body.layout-sharp {
    --nav-width: 252px;
}

body.dashboard-body.layout-sharp .dashboard-layout {
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
}

body.dashboard-body.layout-sharp .sidebar {
    margin: 0;
    height: 100dvh;
    border: 0;
    border-right: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 0;
    background:
        linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,.94), color-mix(in srgb, var(--accent-soft) 50%, #ffffff));
    background-size: 18px 18px, 18px 18px, auto;
    color: var(--surface-ink);
}

body.dashboard-body.layout-sharp .sidebar::before {
    content: "MODEL BUS";
    display: block;
    margin: 12px 0 18px;
    padding: 7px 9px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
}

body.dashboard-body.layout-sharp .sidebar-title,
body.dashboard-body.layout-sharp .sidebar-subtitle,
body.dashboard-body.layout-sharp .menu-list a,
body.dashboard-body.layout-sharp .ghost-btn {
    color: var(--surface-ink);
}

body.dashboard-body.layout-sharp .sidebar-subtitle {
    color: var(--muted-ink);
}

body.dashboard-body.layout-sharp .menu-list a {
    min-height: 42px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
    background: rgba(255,255,255,.62);
}

body.dashboard-body.layout-sharp .menu-list a.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 6px 6px 0 color-mix(in srgb, var(--accent) 18%, transparent);
}

body.dashboard-body.layout-sharp .menu-list a.active .menu-icon {
    background: #fff;
    color: var(--accent);
}

body.dashboard-body.layout-sharp .menu-icon,
body.dashboard-body.layout-sharp .sidebar-mark,
body.dashboard-body.layout-sharp .sidebar-collapse-btn,
body.dashboard-body.layout-sharp .ghost-btn {
    border-radius: 0;
}

body.dashboard-body.layout-sharp .menu-icon,
body.dashboard-body.layout-sharp .sidebar-mark,
body.dashboard-body.layout-sharp .sidebar-collapse-btn {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

body.dashboard-body.layout-sharp .ghost-btn {
    border: 1px solid var(--accent);
    background: rgba(255,255,255,.62);
}

/* Living CRM layer: subtle operational motion, scoped to the dashboard shell. */
body.dashboard-home.crm-shell-2026 .dashboard-main {
    position: relative;
    isolation: isolate;
}

body.dashboard-home.crm-shell-2026 .module-entry,
body.dashboard-home.crm-shell-2026 .function-choice,
body.dashboard-home.crm-shell-2026 .primary-btn,
body.dashboard-home.crm-shell-2026 .menu-list a {
    position: relative;
    overflow: hidden;
}

body.dashboard-home.crm-shell-2026 .module-entry::before,
body.dashboard-home.crm-shell-2026 .function-choice.active::before {
    content: "";
    position: absolute;
    inset: auto 16px 12px 16px;
    height: 2px;
    border-radius: 999px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: .48;
    transform: translateX(-34%);
}

body.dashboard-home.crm-shell-2026 .status-badge {
    position: relative;
    padding-left: 21px;
}

body.dashboard-home.crm-shell-2026 .status-badge::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    transform: translateY(-50%);
}

body.dashboard-home.crm-shell-2026 #aTotal,
body.dashboard-home.crm-shell-2026 #aRate,
body.dashboard-home.crm-shell-2026 #aClaimed,
body.dashboard-home.crm-shell-2026 #aToday {
    font-variant-numeric: tabular-nums;
}

@keyframes crmLiveBackground {
    0% { transform: translate3d(-2%, -1%, 0) scale(1); opacity: .36; }
    50% { transform: translate3d(2%, 1%, 0) scale(1.02); opacity: .5; }
    100% { transform: translate3d(1%, -2%, 0) scale(1.01); opacity: .42; }
}

@keyframes crmLivePulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 28%, transparent); opacity: .82; }
    50% { box-shadow: 0 0 0 8px color-mix(in srgb, currentColor 0%, transparent); opacity: 1; }
}

@keyframes crmLiveSweep {
    0% { transform: translateX(-120%); opacity: 0; }
    24% { opacity: .5; }
    52%, 100% { transform: translateX(120%); opacity: 0; }
}

@keyframes crmLiveLine {
    0%, 100% { transform: translateX(-38%); opacity: .18; }
    50% { transform: translateX(38%); opacity: .64; }
}

@keyframes crmLiveFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes crmLiveMetric {
    0%, 100% { filter: saturate(1); text-shadow: none; }
    50% { filter: saturate(1.16); text-shadow: 0 0 18px color-mix(in srgb, currentColor 24%, transparent); }
}

@media (prefers-reduced-motion: no-preference) {
    body.dashboard-home.crm-shell-2026 .dashboard-main::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: -1;
        pointer-events: none;
        background:
            radial-gradient(circle at 18% 22%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 28%),
            radial-gradient(circle at 82% 18%, rgba(255, 138, 92, .14), transparent 24%),
            radial-gradient(circle at 68% 78%, rgba(108, 126, 216, .12), transparent 30%);
        animation: crmLiveBackground 18s ease-in-out infinite alternate;
    }

    body.dashboard-home.crm-shell-2026 .status-badge::before {
        animation: crmLivePulse 2.8s ease-in-out infinite;
    }

    body.dashboard-home.crm-shell-2026 .menu-list a.active::before,
    body.dashboard-home.crm-shell-2026 .primary-btn::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        pointer-events: none;
        background: linear-gradient(120deg, transparent 18%, rgba(255,255,255,.38), transparent 58%);
        animation: crmLiveSweep 4.8s ease-in-out infinite;
    }

    body.dashboard-home.crm-shell-2026 .module-entry::before,
    body.dashboard-home.crm-shell-2026 .function-choice.active::before {
        animation: crmLiveLine 3.8s ease-in-out infinite;
    }

    body.dashboard-home.crm-shell-2026 .module-entry-icon,
    body.dashboard-home.crm-shell-2026 .function-code,
    body.dashboard-home.crm-shell-2026 .sidebar-mark {
        animation: crmLiveFloat 5.6s ease-in-out infinite;
    }

    body.dashboard-home.crm-shell-2026 #aTotal,
    body.dashboard-home.crm-shell-2026 #aRate,
    body.dashboard-home.crm-shell-2026 #aClaimed,
    body.dashboard-home.crm-shell-2026 #aToday {
        animation: crmLiveMetric 4.2s ease-in-out infinite;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.dashboard-home.crm-shell-2026 *,
    body.dashboard-home.crm-shell-2026 *::before,
    body.dashboard-home.crm-shell-2026 *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 1180px) {
    body.crm-shell-2026 .topbar {
        align-items: flex-start;
        gap: 14px;
    }

    body.crm-shell-2026 .crm-shell-controls {
        justify-content: flex-start;
        max-width: 100%;
    }

    body.dashboard-home.crm-shell-2026 .dashboard-hero-tools {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 980px) {
    body.dashboard-home.layout-wide .dashboard-main,
    body.dashboard-home.layout-twocol .dashboard-main,
    body.dashboard-home.layout-compact .dashboard-main,
    body.dashboard-home.layout-sharp .dashboard-main,
    body.dashboard-home.layout-wide .home-hero-panel,
    body.dashboard-home.layout-wide .home-smart-panel,
    body.dashboard-home.layout-wide .home-smart-panel + .detail-panel,
    body.dashboard-home.layout-wide .module-grid,
    body.dashboard-home.layout-twocol .home-hero-panel,
    body.dashboard-home.layout-twocol .home-smart-panel,
    body.dashboard-home.layout-twocol .home-smart-panel + .detail-panel,
    body.dashboard-home.layout-twocol .module-grid,
    body.dashboard-home.layout-compact .home-hero-panel,
    body.dashboard-home.layout-compact .home-smart-panel,
    body.dashboard-home.layout-compact .home-smart-panel + .detail-panel,
    body.dashboard-home.layout-compact .module-grid,
    body.dashboard-home.layout-sharp .home-hero-panel,
    body.dashboard-home.layout-sharp .home-smart-panel,
    body.dashboard-home.layout-sharp .home-smart-panel + .detail-panel,
    body.dashboard-home.layout-sharp .module-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-column: auto;
        grid-row: auto;
        width: 100%;
        margin-left: 0;
        transform: none;
        clip-path: none;
    }

    body.dashboard-home.layout-spacious .home-hero-panel,
    body.dashboard-home.layout-spacious .home-smart-panel,
    body.dashboard-home.layout-spacious .home-smart-panel + .detail-panel,
    body.dashboard-home.layout-spacious .module-grid {
        width: 100%;
        margin-left: 0;
        transform: none;
    }

    body.dashboard-home.layout-borderless .module-entry,
    body.dashboard-home.layout-sharp .module-entry {
        grid-template-columns: 1fr;
    }
}
