@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

/* L0 令牌在 seango-theme.css，由 WebAssetController 前置拼接。 */
:root {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
body { min-height: 100vh; margin: 0; background: var(--shell-canvas); color: var(--ink); font-weight: 500; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { color: #fff; background: var(--brand); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--ring) 55%, transparent); outline-offset: 2px; }
.skip-link { position: fixed; z-index: 100; top: -50px; left: 16px; padding: 10px 14px; border-radius: 9px; color: #fff; background: var(--ink); font-size: 12px; transition: top .15s ease; }
.skip-link:focus { top: 16px; }

.shell { min-height: 100vh; display: flex; align-items: stretch; gap: 0; padding: 0; background: var(--sidebar-bg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.is-hidden { display: none !important; }
.ui-icon { display: block; flex: 0 0 auto; }
.sidebar { flex: 0 0 256px; width: 256px; min-width: 256px; padding: 8px; border-radius: 0; box-shadow: none; background: var(--sidebar-bg); box-sizing: border-box; }
.workspace,
.workspace-inset { flex: 1 1 auto; min-width: 0; margin: 8px 8px 8px var(--sidebar-inset-gap, 0); min-height: calc(100vh - 16px); display: flex; flex-direction: column; border: 0; border-radius: 12px; background: var(--background); box-shadow: var(--shadow-inset-panel); overflow: visible; position: relative; }
.workspace-inset > .topbar:first-child { border-radius: 12px 12px 0 0; }
.topbar { position: sticky; z-index: 10; top: 0; flex-shrink: 0; height: 64px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 0; background: var(--background); box-shadow: none; }
.topbar-start, .topbar-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-start { flex: 1; }
.topbar-start .command-menu { margin-left: auto; margin-right: 4px; }
.topbar-actions { padding-left: 4px; }
.topbar-trigger { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--foreground); background: var(--background); box-shadow: var(--shadow-xs); cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; text-decoration: none; }
.topbar-trigger:hover { color: var(--foreground); border-color: var(--border); background: var(--accent); }
.topbar-trigger .ui-icon { width: 16px; height: 16px; }
.topbar-separator { width: 1px; height: 24px; background: var(--line); }
.topbar-separator-small { height: 22px; }
.content { flex: 1 1 auto; width: 100%; max-width: 80rem; margin: 0 auto; padding: 24px 16px 32px; position: relative; }

/* Shadcn-style, no-JavaScript disclosure primitives. They keep the shell usable
   under the strict CSP while still providing command and profile menus. */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.mobile-nav { display: none; position: relative; }
.mobile-nav > summary { display: grid; place-items: center; }
.mobile-nav-panel { position: absolute; z-index: 30; top: 44px; left: -8px; width: min(280px, calc(100vw - 32px)); padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 15px 42px rgba(15,23,42,.14); }
.mobile-nav-panel a { display: flex; gap: 9px; align-items: center; padding: 9px 10px; border-radius: 7px; color: #475569; font-size: 13px; }
.mobile-nav-panel a:hover { color: var(--brand); background: var(--brand-soft); }
.mobile-nav-label { margin: 9px 10px 4px; color: #94a3b8; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.command-menu { position: relative; }
.command-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: auto; min-width: 168px; max-width: 220px; min-height: 36px; padding: 0 10px 0 12px; border: 1px solid #e2e8f0; border-radius: 9999px; color: #94a3b8; background: #fff; font-size: 13px; cursor: pointer; list-style: none; }
.command-trigger:hover { border-color: #cbd5e1; color: #64748b; background: #fff; }
.command-trigger-leading { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.command-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-search-icon { display: inline-flex; flex-shrink: 0; color: inherit; }
.command-trigger-kbd { margin-left: auto; flex-shrink: 0; padding: 2px 6px; border: 1px solid #e2e8f0; border-radius: 6px; color: #64748b; background: #f8fafc; font: 11px/1.2 ui-sans-serif, system-ui, sans-serif; font-weight: 500; letter-spacing: .02em; box-shadow: none; }
.header-icon-button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: #0f172a; }
.header-icon-button:hover { color: var(--brand); background: var(--brand-soft); }
.command-panel { position: absolute; z-index: 40; top: 44px; right: 0; width: min(360px, calc(100vw - 32px)); padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 16px 44px rgba(15,23,42,.15); }
.command-heading, .command-foot { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px 9px; color: #334155; font-size: 11px; font-weight: 750; }
.command-input { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; color: #94a3b8; background: #f8fafc; font-size: 12px; }
.command-panel > a { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 7px; color: #475569; font-size: 12px; }
.command-panel > a:hover { color: var(--brand); background: var(--brand-soft); }
.command-panel > a small { margin-left: auto; color: #94a3b8; font-size: 10px; }
.command-arrow { width: 16px; color: #94a3b8; text-align: center; }
.command-divider, .profile-divider { height: 1px; margin: 7px 0; background: #f1f5f9; }
.theme-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.theme-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; color: #64748b; font-size: 11px; text-align: center; }
.theme-actions a:hover, .theme-actions a.selected { color: var(--brand); border-color: #bfdbfe; background: var(--brand-soft); }
.command-foot { padding: 9px 8px 3px; color: #64748b; font-weight: 500; }
.profile-menu { position: relative; }
.profile-menu summary { display: flex; align-items: center; gap: 9px; min-width: 0; }
.profile-menu-sidebar summary { padding: 4px; }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy strong { display: block; overflow: hidden; color: #0f172a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy span { display: block; margin-top: 3px; color: #64748b; font-size: 10px; }
.profile-more, .profile-chevron { color: #94a3b8; font-size: 13px; letter-spacing: .04em; }
.profile-menu-top summary { padding: 3px 4px; border-radius: 7px; }
.profile-menu-top summary:hover { background: #f8fafc; }
.profile-top-name { max-width: 120px; overflow: hidden; color: #475569; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.profile-panel { position: absolute; z-index: 50; width: 238px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 16px 44px rgba(15,23,42,.15); }
.profile-panel-sidebar { z-index: 120; right: 0; bottom: calc(100% + 4px); left: auto; }
.profile-panel-top { top: 43px; right: 0; }
.profile-panel a, .profile-panel button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 9px; border: 0; border-radius: 7px; color: #475569; background: transparent; font-size: 12px; text-align: left; }
.profile-panel a:hover, .profile-panel button:hover { color: var(--brand); background: var(--brand-soft); }
.profile-panel kbd { margin-left: auto; }
.profile-panel-user { display: flex; align-items: center; gap: 9px; padding: 5px 4px 8px; }
.profile-panel-user strong, .profile-panel-user small { display: block; }
.profile-panel-user strong { color: #0f172a; font-size: 12px; }
.profile-panel-user small { margin-top: 3px; color: #64748b; font-size: 10px; }
.profile-danger { color: #b91c1c !important; }
.avatar { position: relative; width: 30px; height: 30px; flex: 0 0 30px; overflow: hidden; border-radius: 999px; display: grid; place-items: center; color: var(--brand-dark); background: #dbeafe; font-size: 12px; font-weight: 850; }
.avatar-fallback { position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; }
.avatar img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; background: var(--sidebar-accent); }
.avatar-sidebar { width: 30px; height: 30px; flex-basis: 30px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid rgba(221, 227, 238, .88); }
.eyebrow { margin: 0 0 7px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; }
h2 { margin-bottom: 6px; font-size: 19px; letter-spacing: -.02em; }
h3 { margin-bottom: 5px; font-size: 15px; }
.lead { max-width: 760px; margin-bottom: 0; color: var(--muted); line-height: 1.7; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { min-height: 40px; padding: 10px 15px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 750; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease; }
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 7px 18px rgba(33,86,217,.2); }
.button-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.button-secondary { border-color: var(--line); color: var(--ink); background: #fff; }
.button-secondary:hover { border-color: #cbd4e4; background: #fbfcff; }
.button-small { min-height: 32px; padding: 7px 10px; font-size: 12px; }

.notice { margin-bottom: 18px; padding: 13px 15px; border-radius: 11px; font-size: 13px; line-height: 1.55; }
.notice-success { border: 1px solid #bdebd7; color: #116744; background: var(--green-soft); }
.notice-error { border: 1px solid color-mix(in srgb, var(--red) 24%, var(--border)); color: var(--red); background: var(--red-soft); }
.notice-info { border: 1px solid #cfdcff; color: #244cae; background: var(--brand-soft); }
.notice ul { margin: 5px 0 0; padding-left: 20px; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: grid; gap: 18px; }
.section-gap { margin-top: 18px; }
.card { border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow-sm); }
.card:hover { box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { padding: 20px 22px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.card-body { padding: 22px; }
.metric { position: relative; overflow: visible; min-height: auto; padding: 24px; display: flex; flex-direction: column; gap: 24px; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); background: var(--background); }
.metric::after { display: none; }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0; }
.metric-body { padding: 0; display: flex; flex-direction: column; gap: 6px; }
.metric-icon { width: 16px; height: 16px; border: 0; border-radius: 0; color: var(--muted-foreground); background: transparent; }
.metric-icon .ui-icon { width: 16px; height: 16px; }
.metric-label { color: var(--foreground); font-size: 14px; font-weight: 500; line-height: 1; }
.metric-value { margin: 0; padding: 0; font-size: 38px; line-height: 1.1; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric-trend { margin: 0; padding: 0; font-size: 12px; font-weight: 500; line-height: 1.4; color: var(--muted-foreground); }
.metric-trend.is-up { color: var(--foreground); }
.metric-trend.is-down { color: #dc2626; }
.metric-trend.is-neutral { color: var(--muted-foreground); }
.metric-hint { display: none; }
.metric:not(.metric-link) > .metric-hint,
.card-body > .metric-hint,
.card.metric > .metric-hint { display: block; margin: 0; padding: 0; color: var(--muted-foreground); font-size: 12px; font-weight: 500; line-height: 1.4; }
.metric.metric-link { display: flex; flex-direction: column; gap: 32px; color: inherit; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
.metric-link:hover { box-shadow: var(--shadow-md); }
.insight-card { min-height: 148px; padding: 20px 21px; }
.insight-head { display: flex; align-items: center; justify-content: space-between; }
.insight-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; font-weight: 850; }
.insight-blue { color: var(--brand); background: var(--brand-soft); }
.insight-violet { color: var(--violet); background: #f1edff; }
.insight-orange { color: var(--orange); background: var(--orange-soft); }
.insight-value { margin-top: 12px; font-size: 25px; font-weight: 820; letter-spacing: -.04em; }
.mini-bars { height: 40px; margin-top: 7px; padding: 8px 10px; display: flex; align-items: flex-end; gap: 4px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--muted-foreground) 5%, var(--card)); box-sizing: border-box; }
.mini-bars span { flex: 1; min-width: 4px; max-width: 20px; border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, var(--primary) 68%, var(--foreground)); opacity: .88; transition: opacity .15s ease, background .15s ease; }
.trend-row-link:hover .mini-bars span { opacity: 1; background: var(--primary); }
.mini-bars .bar-level-1 { height: 6px; opacity: .35; }
.mini-bars .bar-level-2 { height: 10px; opacity: .45; }
.mini-bars .bar-level-3 { height: 14px; opacity: .55; }
.mini-bars .bar-level-4 { height: 18px; opacity: .65; }
.mini-bars .bar-level-5 { height: 22px; opacity: .75; }
.mini-bars .bar-level-6 { height: 26px; opacity: .85; }
.mini-bars .bar-level-7 { height: 30px; opacity: .92; }
.mini-bars .bar-level-8 { height: 34px; opacity: 1; }
.insight-baseline { margin-top: 15px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-success { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.dot-warning { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }

.toolbar { margin-bottom: 16px; padding: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar form { width: 100%; display: flex; flex-wrap: wrap; gap: 10px; }
.grow { flex: 1 1 260px; }
.field { display: grid; gap: 8px; }
.field label, .field .ui-label { color: var(--foreground); font-size: 14px; font-weight: 500; line-height: 1.4; }
.field small, .field-hint { margin: 0; color: var(--muted-foreground); font-size: 12px; line-height: 1.5; font-weight: 400; }
.input, .select, .textarea { width: 100%; min-height: 36px; border: 1px solid var(--input); border-radius: 6px; padding: 8px 12px; color: var(--foreground); background: var(--background); font-size: 14px; outline: none; box-shadow: var(--shadow-xs); transition: border-color .15s ease, box-shadow .15s ease; }
.textarea { min-height: 112px; resize: vertical; line-height: 1.55; padding-top: 10px; padding-bottom: 10px; }
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); opacity: 1; }
.input:focus, .select:focus, .textarea:focus { border-color: color-mix(in srgb, var(--foreground) 22%, var(--border)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--foreground) 6%, transparent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; align-items: start; }
.form-grid > .field { align-self: start; }
.field-full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 9px; color: #3f4a60; font-size: 13px; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-actions { grid-column: 1 / -1; padding-top: 6px; display: flex; gap: 10px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 16px; color: #7b869a; background: #fafbfc; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 11px; font-weight: 720; letter-spacing: .02em; }
td { padding: 16px; border-bottom: 1px solid #edf0f5; color: #3a465b; font-size: 13px; vertical-align: middle; }
.list-table th,
.list-table td { border-bottom: 0; }
tbody tr:hover { background: #fcfdff; }
.primary-cell strong { display: block; color: var(--ink); font-size: 13px; }
.primary-cell span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.link { color: var(--brand); font-weight: 720; }
.link:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }

.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; }
.badge::before { display: none; }
.badge-tone-success, .badge-ready, .badge-online, .badge-enabled, .badge-deal, .badge-maintaining, .badge-done { color: var(--green); background: var(--green-soft); border-color: #b7e5d2; }
.badge-tone-info, .badge-configured, .badge-developing, .badge-intention, .badge-testing, .badge-in-progress { color: var(--brand); background: var(--brand-soft); border-color: #bfdbfe; }
.badge-tone-warning, .badge-setup_required, .badge-attention, .badge-paused, .badge-lead, .badge-planning, .badge-todo, .badge-backlog { color: var(--orange); background: var(--orange-soft); border-color: #fed7aa; }
.badge-tone-danger, .badge-disabled, .badge-invalid, .badge-lost, .badge-closed, .badge-canceled, .badge-failed { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 24%, var(--border)); }
.badge-tone-neutral, .badge-available { color: #58657a; background: #eef1f5; border-color: #dce2ea; }

.pagination { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.pagination .pages { display: flex; gap: 8px; }
.empty { padding: 44px 24px; text-align: center; }
.empty-mark { width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); font-weight: 850; }
.empty p { max-width: 480px; margin: 7px auto 17px; color: var(--muted); line-height: 1.65; font-size: 13px; }

.hero-card { padding: 28px; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; background: linear-gradient(135deg, #fff, #f6f9ff); }
.hero-card .app-icon { width: 58px; height: 58px; }
.hero-copy { display: flex; gap: 18px; align-items: flex-start; }
.hero-copy h1 { margin-bottom: 8px; font-size: 28px; }
.hero-metrics { display: flex; gap: 26px; }
.hero-metrics strong { display: block; font-size: 23px; }
.hero-metrics span { color: var(--muted); font-size: 10px; }
.steps { counter-reset: step; display: grid; gap: 12px; }
.step { position: relative; padding: 3px 0 3px 42px; min-height: 32px; display: flex; align-items: center; color: #435068; font-size: 13px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); font-size: 11px; font-weight: 800; }
.code { padding: 2px 6px; border-radius: 5px; color: #334160; background: #edf0f5; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.secret { word-break: break-all; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.definition { display: grid; grid-template-columns: 145px 1fr; gap: 0; }
.definition dt, .definition dd { margin: 0; padding: 11px 0; border-bottom: 1px solid #edf0f5; font-size: 13px; }
.definition dt { color: var(--muted); }
.definition dd { color: #344057; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 20px 26px; border-left: 1px solid #dfe4ed; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 2px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 1px #b7c8ee; }
.timeline-item p { margin: 5px 0 0; color: var(--muted); line-height: 1.55; font-size: 12px; }

/* 可复用 UI 契约：宿主项目可仅覆盖这些 token，不需要引入前端构建链。 */
.ui-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ui-toolbar .field { min-width: 180px; }
.ui-divider { height: 1px; margin: 22px 0; background: var(--line); }
.ui-eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ui-subtle { color: var(--muted); font-size: 12px; }
.ui-icon-button { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; }
.ui-icon-button:hover { color: var(--brand); border-color: #b9c8ee; background: var(--brand-soft); }
.data-count { color: var(--muted); font-size: 12px; }
.table-wrap table { min-width: 720px; }
.table-wrap thead th { position: sticky; top: 0; z-index: 1; }
.table-empty { padding: 54px 24px; text-align: center; color: var(--muted); }
.table-empty strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 14px; }
.form-grid .field-full > h2 { margin-bottom: 6px; }
.button-danger { color: #a52b34; border-color: #f0c9cc; background: #fff7f7; }
.button-danger:hover { background: var(--red-soft); }
.toolbar-inline { margin: 0; padding: 15px 22px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.toolbar-inline form { position: relative; align-items: center; }
.search-field { position: relative; flex: 1 1 340px; min-width: 220px; }
.search-field .input { width: 100%; padding-left: 38px; }
.toolbar-search-icon { position: absolute; z-index: 1; top: 50%; left: 12px; display: inline-flex; align-items: center; color: #94a3b8; transform: translateY(-50%); pointer-events: none; }
.toolbar-inline form .search-field .input { width: 100%; padding-left: 38px; }
.toolbar-inline form .input { width: auto; }
.toolbar-inline form .select { width: auto; min-width: 150px; }
.users-filter { overflow: visible; }
.users-list-card { overflow: visible; }
.users-table th:last-child, .users-table td:last-child { width: 72px; }
.row-actions { position: relative; display: inline-block; }
.row-actions > summary { display: grid; place-items: center; }
.row-actions-panel { position: absolute; z-index: 20; top: 38px; right: 0; width: 132px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 12px 30px rgba(15,23,42,.13); }
.row-actions-panel a, .row-actions-panel button { display: block; width: 100%; padding: 8px 9px; border: 0; border-radius: 6px; color: #475569; background: transparent; font-size: 12px; text-align: left; }
.row-actions-panel a:hover, .row-actions-panel button:hover { color: var(--brand); background: var(--brand-soft); }
.summary-card { min-height: 122px; padding: 18px 20px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
.summary-card strong { display: block; margin: 10px 0 4px; font-size: 25px; letter-spacing: -.04em; }
.summary-card > span:last-child { color: var(--muted); font-size: 11px; }
.user-cell { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.user-cell strong, .user-cell small { display: block; }
.user-cell small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.user-username { font-size: 13px !important; font-weight: 650; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 999px; color: var(--brand); background: var(--brand-soft); font-size: 13px; font-weight: 850; }
.avatar-sidebar { border-radius: 8px; }
.role-label { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.role-icon { display: inline-flex; color: #64748b; }
.inline-form { display: inline; }
.link-button { padding: 0; border: 0; background: transparent; }
.input-readonly { display: flex; align-items: center; color: var(--muted); background: #f6f8fb; }
.role-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.role-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.role-option:hover { border-color: #b9c8ee; background: var(--brand-soft); }
.role-option input { margin-top: 3px; accent-color: var(--brand); }
.role-option strong, .role-option small { display: block; }
.role-option small { margin-top: 4px; color: var(--muted); font-size: 11px; }

/* Optional dark mode is persisted in a secure, HttpOnly-compatible cookie by
   the theme endpoint; token 值见 seango-theme.css .theme-dark。 */
.theme-dark, .theme-dark body { background: #0f172a; color: var(--ink); }
.theme-dark .sidebar, .theme-dark .topbar, .theme-dark .card, .theme-dark .command-panel, .theme-dark .profile-panel, .theme-dark .mobile-nav-panel { border-color: var(--line); }
.theme-dark .sidebar { color: #cbd5e1; background: var(--sidebar-bg); }
.theme-dark .workspace-inset { background: var(--background); box-shadow: var(--shadow-inset-panel); }
.theme-dark .brand strong, .theme-dark .profile-copy strong, .theme-dark .profile-panel-user strong, .theme-dark h1, .theme-dark h2, .theme-dark h3, .theme-dark .primary-cell strong { color: #f8fafc; }
.theme-dark .brand span, .theme-dark .profile-copy span, .theme-dark .profile-panel-user small, .theme-dark .muted, .theme-dark .metric-label, .theme-dark .lead { color: #94a3b8; }
.theme-dark .nav a.active, .theme-dark .profile-panel a:hover, .theme-dark .profile-panel button:hover, .theme-dark .command-panel > a:hover, .theme-dark .row-actions-panel a:hover, .theme-dark .row-actions-panel button:hover { background: #172554; border-color: #1e40af; }
.theme-dark .nav a, .theme-dark .profile-panel a, .theme-dark .profile-panel button, .theme-dark .command-panel > a, .theme-dark .mobile-nav-panel a { color: #cbd5e1; }
.theme-dark .nav a:hover, .theme-dark .mobile-nav-panel a:hover { color: #bfdbfe; background: #172033; }
.theme-dark .topbar-trigger { border-color: var(--border); color: var(--foreground); background: color-mix(in srgb, var(--background) 88%, #fff 12%); box-shadow: none; }
.theme-dark .topbar-trigger:hover { border-color: var(--border); color: var(--foreground); background: var(--accent); }
.theme-dark .nav-icon, .theme-dark .command-trigger, .theme-dark .command-input, .theme-dark .sidebar-user, .theme-dark th, .theme-dark .app-stat, .theme-dark .input-readonly { border-color: var(--line); background: #0f172a; }
.theme-dark .input, .theme-dark .select, .theme-dark .textarea, .theme-dark .button-secondary, .theme-dark .ui-icon-button, .theme-dark .role-option, .theme-dark .customer-level { border-color: var(--line); color: #e2e8f0; background: #111c2f; }
.theme-dark .row-actions-panel { border-color: var(--line); background: #111c2f; }
.theme-dark .row-actions-panel a, .theme-dark .row-actions-panel button { color: #cbd5e1; }
.theme-dark td { border-color: #1e293b; color: #cbd5e1; }
.theme-dark th { color: #94a3b8; }
.theme-dark tbody tr:hover { background: #172033; }
.theme-dark .card-head, .theme-dark .ui-divider, .theme-dark .command-divider, .theme-dark .profile-divider { border-color: var(--line); background: transparent; }
.theme-dark .button-secondary:hover { border-color: #3b82f6; background: #172554; }

@media (max-width: 1050px) {
  .grid-4, .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { flex-direction: column; padding: 0; }
  .sidebar { position: static; width: 100%; min-width: 0; flex: 0 0 auto; height: auto; max-height: none; padding: 8px 12px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .team-switcher { flex: 1 1 auto; min-width: 0; padding: 0; }
  .sidebar > .nav, .sidebar-user { display: none; }
  .mobile-nav { display: block; }
  .topbar-trigger { display: none; }
  .topbar { height: 58px; padding: 0 14px; }
  .topbar-actions { gap: 8px; }
  .command-trigger { width: 36px; padding: 0; justify-content: center; border-radius: 9999px; }
  .command-trigger-leading, .command-trigger-kbd, .topbar-separator-small { display: none; }
  .command-trigger .command-search-icon { display: inline-flex; }
  .content { padding: 24px 18px 44px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-metrics { justify-content: space-between; }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 270px; padding: 34px; }
  .login-story h2 { margin-top: 28px; font-size: 30px; }
}
@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2, .app-grid, .form-grid { grid-template-columns: 1fr; }
  .span-2, .field-full { grid-column: auto; }
  .hero-copy { display: block; }
  .hero-copy .app-icon { margin-bottom: 16px; }
  .page-head .actions, .page-head .button { width: 100%; }
  .definition { grid-template-columns: 1fr; }
  .definition dt { border-bottom: 0; padding-bottom: 2px; }
  .definition dd { padding-top: 2px; }
  .role-picker { grid-template-columns: 1fr; }
  .command-panel { right: -45px; }
  .profile-panel-top { right: -5px; }
}

/* --------------------------------------------------------------------------
   Shadcn Admin source-aligned component layer
   Values mirror the supplied template: 16rem/3rem sidebar, 4px spacing grid,
   0.625rem radius, 64px header, 32/36px controls and restrained shadows.
   -------------------------------------------------------------------------- */
body { font-size: 14px; line-height: 1.5; background: var(--shell-canvas); }
.shell { display: flex; align-items: stretch; gap: 0; padding: 0; background: var(--sidebar-bg); overflow: visible; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; flex: 0 0 256px; width: 256px; min-width: 256px; height: 100vh; max-height: 100vh; overflow: visible; padding: 8px; color: var(--sidebar-foreground); border: 0; border-radius: 0; box-shadow: none; background: var(--sidebar-bg); align-self: flex-start; box-sizing: border-box; }
.brand { min-height: 72px; padding: 20px 16px 16px; border-bottom: 0; }
.brand-logo, .brand-logo img { width: 166px; height: 26px; }
.nav { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; gap: 6px; overflow-x: hidden; overflow-y: auto; padding: 0 12px 12px; scrollbar-gutter: auto; }
.nav-label { display: flex; align-items: center; height: 38px; flex: 0 0 38px; margin: 14px 0 0; padding: 0 10px; color: #64748b; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.nav-label-line { display: none; }
.nav a { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 10px 10px; gap: 10px; border-radius: 8px; color: #0f172a; font-size: 14px; font-weight: 500; text-decoration: none; box-sizing: border-box; transition: background .15s ease, color .15s ease; }
.nav a > span:not(.nav-icon) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a:hover { color: var(--sidebar-foreground); background: var(--sidebar-accent); }
.nav a.active { color: var(--brand-dark); background: var(--brand-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent); font-weight: 600; }
.nav a.active::before { display: none; }
.nav-icon { width: 16px; height: 16px; border: 0; border-radius: 0; color: currentColor; background: transparent; }
.nav a.active .nav-icon { color: currentColor; border: 0; background: transparent; }
.nav-count { min-width: 20px; height: 20px; margin-left: auto; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: var(--brand); font-size: 10px; font-weight: 600; }
.nav a .nav-count.nav-count-compact,
.nav-count[data-debug-pending-verify-badge] {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
}

/* Sidebar collapsible groups (settings / auth / errors in template nav) */
.nav-group { margin: 0; flex-shrink: 0; }
.nav-group > summary { list-style: none; cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group-summary { display: flex; align-items: center; width: 100%; gap: 10px; min-height: 44px; padding: 10px 10px; border-radius: 8px; color: #0f172a; font-size: 14px; font-weight: 500; box-sizing: border-box; transition: background .15s ease, color .15s ease; }
.nav-group-summary > span:not(.nav-icon):not(.nav-group-chevron) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-summary:hover { color: var(--sidebar-foreground); background: var(--sidebar-accent); }
.nav-group[open] > .nav-group-summary,
.nav-group.is-active > .nav-group-summary { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }
.nav-group-chevron { width: 16px; height: 16px; margin-left: auto; color: var(--muted-foreground); transition: transform .15s ease; }
.nav-group-chevron .ui-icon { width: 16px; height: 16px; }
.nav-group[open] > .nav-group-summary .nav-group-chevron { transform: rotate(90deg); }
.nav-group-items { display: grid; gap: 2px; margin: 2px 0 4px; padding: 2px 0 2px 20px; border-left: 1px solid var(--line); margin-left: 20px; }
.nav-group-items a { min-height: 34px; padding: 7px 10px; border-radius: 6px; color: var(--muted-foreground); font-size: 13px; font-weight: 500; display: flex; align-items: center; }
.nav-group-items a:hover { color: var(--sidebar-foreground); background: var(--sidebar-accent); }
.nav-group-items a.active { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }

.team-switcher { position: relative; z-index: 50; flex-shrink: 0; margin: 0; padding: 8px 12px; overflow: visible; box-sizing: border-box; }
.team-switcher[open] { z-index: 100; }
.team-switcher-trigger { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px; border: 0; border-radius: 8px; list-style: none; cursor: pointer; box-sizing: border-box; background: transparent; transition: background .15s ease, color .15s ease; }
.team-switcher-trigger > * { pointer-events: none; }
.team-switcher-trigger::-webkit-details-marker { display: none; }
.team-switcher-trigger:hover, .team-switcher[open] > .team-switcher-trigger { background: var(--sidebar-accent); color: var(--sidebar-foreground); }
.team-switcher-logo { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; overflow: hidden; border: 0; border-radius: 8px; color: var(--sidebar-primary-foreground); background: var(--sidebar-primary); }
.team-switcher-logo img { width: 18px; height: auto; max-height: 18px; object-fit: contain; filter: brightness(0) invert(1); }
.team-switcher-trigger:has(.team-switcher-logo--brand) { padding: 4px 8px; }
.team-switcher-logo.team-switcher-logo--brand { width: auto; max-width: calc(100% - 28px); height: auto; align-self: stretch; flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch; background: transparent; border-radius: 0; overflow: hidden; }
.team-switcher-logo.team-switcher-logo--brand img { display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; object-position: left center; filter: none; }
.team-switcher-logo--text { font-size: 13px; font-weight: 700; color: var(--sidebar-primary-foreground); }
.team-switcher-copy { min-width: 0; flex: 1; text-align: left; }
.team-switcher-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--sidebar-foreground); }
.team-switcher-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; color: var(--muted-foreground); font-size: 12px; line-height: 1.25; }
.team-switcher-chevron { width: 16px; margin-left: auto; color: var(--muted-foreground); flex-shrink: 0; }
.team-switcher-chevron .ui-icon { width: 16px; height: 16px; }
.team-switcher-menu { position: absolute; z-index: 200; top: calc(100% + 4px); left: 8px; right: 8px; width: auto; min-width: 14rem; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--popover); box-shadow: var(--shadow-lg); display: none; gap: 2px; pointer-events: auto; isolation: isolate; }
.team-switcher[open] .team-switcher-menu { display: grid; }
.team-switcher-menu-label { margin: 0; padding: 6px 8px; color: var(--muted-foreground); font-size: 12px; font-weight: 500; }
.team-switcher-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; color: var(--foreground); font-size: 14px; }
.team-switcher-item:hover { background: var(--accent); }
.team-switcher-item.is-active { background: var(--accent); }
.team-switcher-mark { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; color: var(--foreground); background: var(--background); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.team-switcher-mark-muted { color: var(--muted-foreground); background: var(--secondary); }
.team-switcher-mark-logo { padding: 0; overflow: hidden; border: 0; background: transparent; }
.team-switcher-mark-logo img { width: 100%; height: 100%; object-fit: contain; filter: none; }
.team-switcher-item strong { display: block; font-size: 13px; font-weight: 600; }
.team-switcher-item small { display: block; margin-top: 2px; color: var(--muted-foreground); font-size: 11px; }

.sidebar-user { flex-shrink: 0; position: relative; z-index: 40; margin: auto 8px 8px; padding: 0; border: 0; border-radius: 8px; background: transparent; overflow: visible; }
.profile-menu-sidebar summary { min-height: 52px; padding: 10px; border-radius: 8px; }
.profile-menu-sidebar summary:hover, .profile-menu-sidebar[open] summary { background: var(--sidebar-accent); }
.profile-copy strong { font-size: 14px; font-weight: 600; line-height: 1.25; }
.profile-copy span { margin-top: 2px; font-size: 12px; line-height: 1.25; }
.profile-more { width: 16px; color: #0f172a; }
.avatar-sidebar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 8px; }
.workspace,
.workspace-inset { position: relative; min-height: calc(100vh - 16px); min-width: 0; margin: 8px 8px 8px var(--sidebar-inset-gap, 0); overflow: visible; border: 0; border-radius: 12px; background: var(--background); box-shadow: var(--shadow-inset-panel); display: flex; flex-direction: column; flex: 1 1 auto; }
.workspace::before { display: none; }
.topbar { height: 64px; padding: 0 16px; border-bottom: 0; border-radius: 0; background: var(--background); box-shadow: none; flex-shrink: 0; }
.topbar-start, .topbar-actions { gap: 12px; }
.topbar-separator { height: 24px; background: var(--line); }
.command-trigger { width: auto; min-width: 168px; max-width: 220px; min-height: 36px; border-radius: 9999px; box-shadow: none; }
kbd:not(.command-trigger-kbd) { padding: 2px 5px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted-foreground); background: var(--background); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.header-icon-button { width: 36px; height: 36px; border-radius: 6px; }
.header-icon-button:hover { color: #0f172a; background: #f1f5f9; }
.profile-menu-top summary { padding: 2px; border-radius: 999px; }
.profile-menu-top .avatar { border-radius: 999px; }
.content { width: 100%; max-width: 80rem; margin: 0 auto; padding: 24px 16px 32px; flex: 1 1 auto; }

.page-head { align-items: flex-start; margin-bottom: 24px; padding-bottom: 0; border-bottom: 0; }
.page-head .eyebrow { color: var(--muted-foreground); font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.list-page-stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; max-width: 100%; }
.list-page-top { margin-bottom: 24px; }
.list-page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; width: 100%; }
.list-page-header-inline { align-items: center; }
.list-page-header-inline .list-page-toolbar-row { flex: 1 1 520px; margin-left: auto; min-width: min(100%, 420px); }
.list-page-toolbar-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; width: 100%; }
.list-page-toolbar-form .search-field { flex: 1 1 220px; max-width: 280px; min-width: 160px; }
.list-table-section { display: flex; flex-direction: column; gap: 16px; }
.list-table-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; --toolbar-control-height: 32px; position: relative; z-index: 2; overflow: visible; }
.list-table-toolbar-main { display: flex; flex: 1 1 420px; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.list-table-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.list-table-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.list-page-toolbar-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; width: 100%; --toolbar-control-height: 32px; }
.list-table-toolbar .input,
.list-table-toolbar .select,
.list-table-toolbar .button,
.list-table-toolbar summary.button,
.list-page-toolbar-form .input,
.list-page-toolbar-form .select,
.list-page-toolbar-form .button,
.list-page-toolbar-form summary.button { min-height: var(--toolbar-control-height); height: var(--toolbar-control-height); box-sizing: border-box; font-size: 13px; line-height: 1; border-radius: 6px; }
.list-table-toolbar .input,
.list-page-toolbar-form .input { padding: 0 12px; box-shadow: none; }
.list-table-toolbar .search-field .input,
.list-page-toolbar-form .search-field .input { padding-left: 38px; padding-right: 12px; }
.list-table-toolbar .select,
.list-page-toolbar-form .select { padding: 0 28px 0 12px; box-shadow: none; }
.list-table-toolbar .button,
.list-table-toolbar summary.button,
.list-page-toolbar-form .button,
.list-page-toolbar-form summary.button { padding: 0 12px; font-weight: 500; transform: none; box-shadow: none; }
.list-table-toolbar .button-outline,
.list-table-toolbar summary.button-outline,
.list-page-toolbar-form .button-outline { border: 1px solid var(--border); color: var(--foreground); background: var(--background); }
.list-table-toolbar .button-outline:hover,
.list-table-toolbar summary.button-outline:hover,
.list-page-toolbar-form .button-outline:hover { border-color: color-mix(in srgb, var(--foreground) 12%, var(--border)); background: var(--accent); color: var(--foreground); transform: none; }
.list-table-toolbar .button-primary,
.list-page-toolbar-form .button-primary { border: 1px solid var(--primary); color: var(--primary-foreground); background: var(--primary); box-shadow: none; }
.list-table-toolbar .button-primary:hover,
.list-page-toolbar-form .button-primary:hover { background: color-mix(in srgb, var(--primary) 90%, #000); transform: none; }
.input-compact, .select-compact { min-height: 32px; height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px; box-shadow: none; }
.list-table-toolbar .search-field { flex: 0 1 250px; min-width: 180px; }
.list-table-toolbar .search-field .input { width: 100%; }

/* --------------------------------------------------------------------------
   Shadcn UI primitives → Blade/CSS（对照 shadcn-admin-main/src/components/ui）
   无 React/Radix 运行时；dialog 用原生 <dialog>，菜单用 <details>。
   -------------------------------------------------------------------------- */
.button-ghost { border-color: transparent; color: var(--foreground); background: transparent; box-shadow: none; }
.button-ghost:hover { color: var(--foreground); background: var(--accent); transform: none; }
.button-outline { border-color: var(--border); color: var(--foreground); background: var(--background); box-shadow: var(--shadow-xs); }
.button-outline:hover { border-color: #cbd5e1; background: var(--accent); transform: none; }
.button-destructive { color: var(--destructive-foreground); border-color: transparent; background: var(--destructive); box-shadow: var(--shadow-xs); }
.button-destructive:hover { background: color-mix(in srgb, var(--destructive) 88%, #000); transform: none; }
.button-link { min-height: auto; padding: 0; border: 0; color: var(--primary); background: transparent; box-shadow: none; font-weight: 500; }
.button-link:hover { text-decoration: underline; transform: none; }
.button-icon { width: 36px; min-width: 36px; padding: 0; }

.ui-label { display: block; color: var(--foreground); font-size: 14px; font-weight: 500; line-height: 1.4; }
.ui-label-hint { margin-top: 4px; color: var(--muted-foreground); font-size: 12px; font-weight: 400; }
.ui-separator { flex-shrink: 0; border: 0; margin: 0; background: var(--border); }
.ui-separator[data-orientation="horizontal"] { width: 100%; height: 1px; }
.ui-separator[data-orientation="vertical"] { width: 1px; height: 100%; min-height: 16px; align-self: stretch; }

.ui-badge-outline { color: var(--foreground); border-color: var(--border); background: var(--background); }
.ui-badge-secondary { color: var(--secondary-foreground); border-color: transparent; background: var(--secondary); }
.ui-badge-destructive { color: #fff; border-color: transparent; background: var(--destructive); }

.password-field { position: relative; display: grid; gap: 6px; }
.password-field-control { position: relative; display: flex; align-items: center; }
.password-field-control .input { padding-right: 40px; -webkit-text-security: disc; }
.password-reveal { position: absolute; right: 4px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); cursor: pointer; }
.password-reveal input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.password-reveal span { color: var(--muted-foreground); font-size: 11px; font-weight: 600; }
.password-field-control:has(.password-reveal-input:checked) .input { -webkit-text-security: none; }
.copy-field,
.secret-field { display: grid; gap: 6px; min-width: 0; }
.input-readonly { color: var(--foreground); background: color-mix(in srgb, var(--muted-foreground) 4%, var(--background)); cursor: text; }
.secret-field .password-field-control .input { -webkit-text-security: disc; }
.secret-field .password-field-control:has(.password-reveal-input:checked) .input { -webkit-text-security: none; }
.project-access-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; }
.project-access-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.project-access-actions--end { margin-left: auto; justify-content: flex-end; }
.project-access-fields { align-items: start; }
.project-app-bindings-panel > .card-body.list-table-section { gap: 16px; padding-top: 20px; }
.project-handoff-meta { margin-top: 8px; }
.credential-flash { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form { display: inline; margin: 0; }

.ui-switch-field { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.ui-switch-field input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ui-switch-track { width: 36px; height: 20px; padding: 2px; display: inline-flex; align-items: center; border-radius: 999px; background: #cbd5e1; transition: background .15s ease; }
.ui-switch-track::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform .15s ease; }
.ui-switch-field input:checked + .ui-switch-track { background: var(--primary); }
.ui-switch-field input:checked + .ui-switch-track::after { transform: translateX(16px); }
.ui-switch-field input:focus-visible + .ui-switch-track { outline: 3px solid rgba(148, 163, 184, .35); outline-offset: 2px; }

.ui-skeleton-block { border-radius: var(--radius-md); background: linear-gradient(90deg, #f1f5f9 25%, #e7edf5 50%, #f1f5f9 75%); background-size: 200% 100%; animation: ui-skeleton-pulse 1.7s ease-in-out infinite; }
.ui-skeleton-line { height: 14px; }
.ui-skeleton-title { height: 24px; width: 40%; }
.ui-skeleton-avatar { width: 40px; height: 40px; border-radius: 999px; }

.ui-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--background); box-shadow: var(--shadow-lg); position: relative; }
.ui-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.ui-dialog-body { padding: 24px; display: grid; gap: 16px; }
.ui-dialog-header { display: grid; gap: 6px; text-align: start; }
.ui-dialog-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.ui-dialog-description { margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.5; }
.ui-dialog-footer { padding: 0 24px 24px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ui-dialog-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); color: var(--muted-foreground); background: transparent; cursor: pointer; }
.ui-dialog-close:hover { color: var(--foreground); background: var(--accent); }

.ui-sheet { width: min(420px, 100vw); max-width: 100vw; height: 100%; max-height: 100vh; margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--border); border-radius: 0; background: var(--background); box-shadow: var(--shadow-lg); }
.ui-sheet::backdrop { background: rgba(15, 23, 42, .45); }
.ui-sheet-header { padding: 20px 20px 12px; border-bottom: 1px solid var(--line); }
.ui-sheet-body { padding: 20px; overflow-y: auto; }
.ui-sheet-footer { margin-top: auto; padding: 16px 20px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.ui-dropdown { position: relative; display: inline-block; }
.ui-dropdown-panel { position: absolute; z-index: 50; min-width: 8rem; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-md); }
.ui-dropdown-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); color: var(--foreground); background: transparent; font-size: 14px; text-align: left; cursor: pointer; }
.ui-dropdown-item:hover, .ui-dropdown-item:focus-visible { background: var(--accent); outline: none; }
.ui-dropdown-item.is-destructive { color: var(--destructive); }
.ui-dropdown-item.is-destructive:hover { background: var(--red-soft); }
.ui-dropdown-separator { height: 1px; margin: 4px 0; background: var(--border); }

/* ---- Unified content page titles (dashboard / list / settings / detail) ---- */
.content-page-head { margin-bottom: 24px; }
.content-page-head h1,
.page-head-row h1,
.list-page-header .page-head h1,
.list-page-header > h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.025em; line-height: 1.25; color: var(--foreground); }
.content-page-head .lead,
.page-head-lead { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted-foreground); }
.content-page-head--split { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.content-page-head--split .content-page-head-main { flex: 0 0 auto; min-width: 0; }
.content-page-head--split .content-page-head-main .lead,
.content-page-head--split .content-page-head-main .page-head-lead { margin: 6px 0 0; }
.content-page-head--split .content-page-head-actions { display: flex; flex: 1 1 auto; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; margin-left: auto; }
.content-page-head--split .content-page-head-actions .list-page-toolbar-form { flex-wrap: nowrap; justify-content: flex-end; width: auto; max-width: 100%; }
.content-page-head--split .list-page-toolbar-form .search-field { flex: 0 1 200px; max-width: 220px; min-width: 120px; }
.content-page-head--form { margin-bottom: 24px; }
.content-page-head-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.content-page-head-title-row h1 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.025em; line-height: 1.25; color: var(--foreground); }
.content-page-head--form .lead { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted-foreground); }
.list-page-top > .list-page-toolbar-form--standalone { margin-top: -8px; }
.list-page-toolbar-form--standalone { flex-wrap: nowrap; justify-content: flex-start; width: 100%; }
.list-page-toolbar-form--standalone .search-field { flex: 0 1 240px; max-width: 280px; min-width: 160px; }
.list-page-toolbar-form--standalone .filter-select,
.list-page-toolbar-form--standalone .button { flex-shrink: 0; white-space: nowrap; }
.list-filter-submit,
.list-page-toolbar-form .list-filter-submit,
.list-table-toolbar .list-filter-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: 500;
}
.list-filter-submit .ui-icon { width: 14px; height: 14px; flex-shrink: 0; }
.list-filter-submit span { line-height: 1; }
.content-page-head--dashboard { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.content-page-head--dashboard > h1 { flex: 0 0 auto; min-width: 0; }
.content-page-head--dashboard .ui-tabs { flex: 0 1 auto; min-width: 0; }
.content-page-head--dashboard .content-page-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.content-page-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (min-width: 768px) {
  .content-page-head h1,
  .page-head-row h1,
  .list-page-header .page-head h1,
  .list-page-header > h1,
  .content-page-head-title-row h1 { font-size: 30px; line-height: 1.2; }
}

@media (max-width: 960px) {
  .content-page-head--split { flex-wrap: wrap; align-items: flex-start; }
  .content-page-head--split .content-page-head-actions { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
  .content-page-head--split .content-page-head-actions .list-page-toolbar-form { flex-wrap: wrap; width: 100%; }
}

.settings-layout { display: flex; flex: 1; flex-direction: column; gap: 8px; align-items: stretch; }
.settings-aside { flex: 0 0 auto; width: 100%; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 8px 4px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.settings-nav a { width: 100%; min-height: 36px; height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 6px; color: var(--foreground); font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; transition: background .15s ease, color .15s ease; }
.settings-nav a .ui-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted-foreground); }
.settings-nav a:hover { background: var(--accent); text-decoration: none; }
.settings-nav a.is-active { background: var(--secondary); color: var(--foreground); font-weight: 500; text-decoration: none; }
.settings-nav a.is-active:hover { background: var(--accent); text-decoration: none; }
.settings-nav a.is-active .ui-icon { color: var(--foreground); }
.settings-section-head { flex: none; }
.settings-section-head h3 { margin: 0 0 2px; font-size: 18px; font-weight: 500; letter-spacing: -.015em; line-height: 1.35; }
.settings-section-head p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted-foreground); }
.settings-page-separator.ui-separator,
.settings-section-separator.ui-separator { border: 0; height: 1px; background: var(--border); }
.settings-page-separator.ui-separator { margin: 16px 0; }
.settings-section-separator.ui-separator { margin: 16px 0; flex: none; }
.settings-content { flex: 1 1 auto; min-width: 0; padding: 4px; display: flex; flex-direction: column; align-items: flex-start; overflow: visible; }
.settings-content-section { display: flex; flex-direction: column; width: 100%; max-width: 42rem; }
.settings-section-body { width: 100%; padding: 0 2px 48px; }
.settings-form { display: grid; gap: 0; width: 100%; padding: 0; margin: 0; }
.settings-form .field,
.settings-form .asset-field { display: grid; grid-template-columns: minmax(112px, 132px) minmax(0, 1fr); align-items: center; column-gap: 16px; row-gap: 4px; margin: 0; padding: 11px 0; border-bottom: 1px solid var(--border); }
.settings-form .field:has(.field-hint),
.settings-form .field:has(.avatar-upload) { align-items: start; }
.settings-form .asset-field { align-items: center; }
.settings-form .field .ui-label,
.settings-form .asset-field .ui-label { margin: 0; padding-top: 7px; font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--muted-foreground); }
.settings-form .asset-field .ui-label { padding-top: 0; align-self: center; }
.settings-form .field > :not(.ui-label),
.settings-form .asset-field > :not(.ui-label):not(.field-hint) { grid-column: 2; }
.settings-form .asset-field > .ui-label { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
.settings-form .asset-field > .asset-field-controls { grid-column: 2; grid-row: 1; }
.settings-form .field-hint { grid-column: 2; margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted-foreground); }
.settings-form .input,
.settings-form .select,
.settings-form .textarea,
.settings-form .file-input { width: 100%; max-width: 100%; min-height: 36px; padding: 7px 12px; font-size: 14px; line-height: 1.5; color: var(--foreground); border: 1px solid var(--input); border-radius: 6px; background: transparent; box-shadow: var(--shadow-xs); outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.settings-form .input::placeholder,
.settings-form .textarea::placeholder { color: var(--muted-foreground); opacity: 1; }
.settings-form .textarea { min-height: 64px; padding-top: 8px; padding-bottom: 8px; resize: none; field-sizing: content; }
.settings-form .field:has(.textarea),
.settings-form .field:has(.field-hint),
.settings-form .field:has(.avatar-upload),
.settings-form .field.field-stacked { align-items: start; }
.settings-form .field:has(.textarea) .ui-label,
.settings-form .field.field-stacked .ui-label { padding-top: 8px; }
.settings-form .field.field-avatar-upload { grid-column: 1 / -1; grid-template-columns: 1fr; padding: 11px 0 16px; border-bottom: 1px solid var(--border); }
.settings-form .settings-avatar-upload { width: 100%; min-height: 96px; padding: 16px 20px; display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 20px; border: 1px dashed color-mix(in srgb, var(--foreground) 16%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--secondary) 85%, var(--background)); box-sizing: border-box; }
.settings-form .settings-avatar-upload .avatar-upload-fields { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; width: 100%; }
.settings-form .settings-avatar-title { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--foreground); }
.settings-form .settings-avatar-hint { margin: 0; grid-column: auto; }
.settings-form .settings-avatar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; width: 100%; }
.settings-form .settings-avatar-upload .file-input { width: auto; max-width: 100%; min-height: auto; height: auto; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--muted-foreground); font-size: 13px; }
.settings-form .settings-avatar-remove { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted-foreground); white-space: nowrap; cursor: pointer; }
.settings-form .input:focus,
.settings-form .select:focus,
.settings-form .textarea:focus { border-color: color-mix(in srgb, var(--foreground) 22%, var(--border)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--foreground) 6%, transparent); }
.settings-form .input-readonly { min-height: 36px; padding: 7px 12px; font-size: 14px; color: var(--muted-foreground); background: var(--secondary); box-shadow: none; }
.theme-dark .settings-form .input,
.theme-dark .settings-form .select,
.theme-dark .settings-form .textarea { background: color-mix(in srgb, var(--input) 30%, transparent); }
.settings-form--sheet .field,
.settings-form--sheet .asset-field { grid-template-columns: 1fr; row-gap: 6px; padding: 10px 0; border-bottom: 0; }
.settings-form--sheet .field > :not(.ui-label),
.settings-form--sheet .field-hint { grid-column: 1; }
.settings-form--sheet .field .ui-label,
.settings-form--sheet .field.field-stacked .ui-label { padding-top: 0; }
.settings-form--sheet .role-picker-compact { display: grid; gap: 8px; max-height: 220px; overflow-y: auto; padding: 2px 0; }
.settings-form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; padding: 0; border: 0; }
.settings-form .button-primary,
.theme-settings-panel .button-primary { min-height: 36px; padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; color: #fafafa; background: #18181b; border: 1px solid #18181b; box-shadow: 0 1px 2px rgba(15,23,42,.05); transform: none; width: auto; display: inline-flex; align-self: flex-start; justify-self: start; white-space: nowrap; }
.settings-form .button-primary:hover,
.theme-settings-panel .button-primary:hover { color: #fafafa; background: #27272a; border-color: #27272a; transform: none; }
.theme-dark .settings-form .button-primary,
.theme-dark .theme-settings-panel .button-primary { color: #18181b; background: #fafafa; border-color: #fafafa; }
.theme-dark .settings-form .button-primary:hover,
.theme-dark .theme-settings-panel .button-primary:hover { color: #18181b; background: #e4e4e7; border-color: #e4e4e7; }
.settings-content-section .theme-settings-panel { width: 100%; padding: 0; gap: 20px; border: 0; background: transparent; box-shadow: none; }
@media (min-width: 1024px) {
  .settings-layout { flex-direction: row; gap: 48px; align-items: flex-start; }
  .settings-aside { position: sticky; top: 84px; flex: 0 0 11rem; width: 11rem; }
  .settings-page-separator.ui-separator { margin: 24px 0; }
}
@media (max-width: 640px) {
  .settings-form .field,
  .settings-form .asset-field { grid-template-columns: 1fr; row-gap: 6px; padding: 12px 0; }
  .settings-form .field .ui-label,
  .settings-form .asset-field .ui-label { padding-top: 0; }
  .settings-form .field > :not(.ui-label),
  .settings-form .asset-field > :not(.ui-label),
  .settings-form .asset-field > .asset-field-controls,
  .settings-form .field-hint { grid-column: 1; }
  .settings-form .asset-field > .ui-label { grid-row: auto; }
  .list-page-toolbar-form--standalone { flex-wrap: wrap; }
}
.permission-matrix { display: grid; gap: 24px; }
.permission-group { padding-top: 4px; }
.permission-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.permission-group-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.permission-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--background); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.permission-option:hover { border-color: #cbd5e1; background: var(--accent); }
.permission-option:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); background: var(--brand-soft); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 12%, transparent); }
.permission-option strong { display: block; font-size: 13px; font-weight: 500; }
.permission-option small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted-foreground); }
.theme-picker-card { max-width: 520px; }
.theme-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-picker-option { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--background); transition: border-color .15s ease, box-shadow .15s ease; }
.theme-picker-option:hover { border-color: #cbd5e1; }
.theme-picker-option.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px rgba(37,99,235,.12); }
.theme-picker-option strong { display: block; font-size: 14px; }
.theme-picker-option small { display: block; margin-top: 2px; color: var(--muted-foreground); font-size: 12px; }
.theme-picker-preview { height: 72px; border-radius: var(--radius-md); border: 1px solid var(--line); }
.theme-picker-preview-light { background: linear-gradient(135deg, #fff 0%, #f4f4f5 100%); }
.theme-picker-preview-dark { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
.shell-showcase .team-switcher-logo:not(.team-switcher-logo--brand) { background: var(--sidebar-primary); }
.shell-showcase .team-switcher-logo.team-switcher-logo--brand,
.shell-debug .team-switcher-logo.team-switcher-logo--brand { width: auto; max-width: calc(100% - 28px); height: auto; align-self: stretch; flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch; background: transparent; border-radius: 0; overflow: hidden; }
.shell-showcase .team-switcher-logo.team-switcher-logo--brand img,
.shell-debug .team-switcher-logo.team-switcher-logo--brand img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; object-position: left center; object-view-box: inset(26% 0.8% 26% 0.8%); filter: none; }
.shell.theme-light.shell-showcase .team-switcher-logo.team-switcher-logo--brand img { mix-blend-mode: multiply; }
.shell-showcase .team-switcher-mark-muted { color: var(--violet); background: color-mix(in srgb, var(--violet) 10%, #fff); }
.shell-debug .team-switcher-logo:not(.team-switcher-logo--brand) { background: var(--sidebar-primary); }
.shell-debug .team-switcher-mark-muted { color: var(--amber, #d97706); background: color-mix(in srgb, var(--amber, #f59e0b) 12%, #fff); }
.debug-notification-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.debug-notification-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 20px; align-items: start; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.debug-notification-item.is-unread { background: var(--card); border-color: color-mix(in srgb, var(--amber, #f59e0b) 28%, var(--border)); box-shadow: inset 3px 0 0 var(--amber, #f59e0b); }
.debug-notification-item.is-read { opacity: .92; }
.debug-notification-main { display: grid; gap: 6px; min-width: 0; }
.debug-notification-main strong { font-size: 14px; font-weight: 650; line-height: 1.4; color: var(--foreground); }
.debug-notification-main p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted-foreground); }
.debug-notification-time { font-size: 12px; color: var(--muted-foreground); }
.debug-notification-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; color: var(--muted-foreground); }
.debug-notification-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.debug-notification-card { padding: 12px; border: 0; background: transparent; box-shadow: none; }
.team-switcher-static .team-switcher-trigger-static { cursor: default; }
.team-switcher-static .team-switcher-trigger-static:hover { background: transparent; }
.workspace-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--secondary); color: var(--muted-foreground); font-size: 11px; font-weight: 600; }
.workspace-badge-debug { border-color: color-mix(in srgb, var(--amber, #f59e0b) 35%, var(--line)); color: color-mix(in srgb, var(--amber, #d97706) 80%, var(--foreground)); background: color-mix(in srgb, var(--amber, #f59e0b) 10%, var(--secondary)); }
.debug-kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; min-height: 420px; }
.debug-kanban--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.debug-kanban-column { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--card); min-height: 360px; }
.debug-kanban-column--pending_verify { border-color: color-mix(in srgb, var(--amber, #f59e0b) 40%, var(--line)); }
.debug-kanban-column--closed { opacity: .88; }
.debug-kanban-column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.debug-kanban-column-head h2 { margin: 0; font-size: 13px; font-weight: 650; }
.debug-kanban-cards { display: grid; align-content: start; gap: 8px; padding: 10px; flex: 1; max-height: 62vh; overflow: auto; }
.debug-kanban-card { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--background); color: inherit; text-decoration: none; }
.debug-kanban-card:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 12%, transparent); }
.debug-kanban-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.debug-kanban-card-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted-foreground); }
.debug-kanban-empty { margin: 8px 2px; font-size: 12px; }
.debug-board-toolbar { margin: 0 0 12px; }
.debug-board-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-foreground); white-space: nowrap; }
.debug-priority-chip { font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 999px; background: var(--secondary); }
.debug-priority-chip--urgent, .debug-kanban-card--urgent { border-color: color-mix(in srgb, #dc2626 35%, var(--line)); }
.debug-priority-chip--urgent { color: #b91c1c; background: color-mix(in srgb, #dc2626 10%, var(--secondary)); }
.debug-priority-chip--high { color: #c2410c; background: color-mix(in srgb, #ea580c 12%, var(--secondary)); }
.debug-kanban-card strong { font-size: 14px; line-height: 1.35; }
.debug-task-table-wrap { overflow-x: auto; }
.debug-task-table .primary-cell { min-width: 160px; max-width: 280px; }
.debug-task-table .primary-cell .link strong { font-weight: 500; }
.debug-task-project-cell {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
}
.debug-task-complete-col form { margin: 0; display: inline-flex; align-items: center; justify-content: center; }
.debug-task-complete {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--input);
    border-radius: 999px;
    background: var(--background);
    cursor: pointer;
    vertical-align: middle;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
button.debug-task-complete:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--input)); }
.debug-task-complete.is-done {
    border-color: var(--primary);
    background: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 8.2 6.6 10.8 12 5.4' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}
.debug-task-complete.is-disabled { opacity: .35; cursor: default; pointer-events: none; }
.debug-priority-level {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted-foreground);
    background: var(--background);
    font-size: 12px;
    font-weight: 500;
}
.debug-priority-level[title*="紧急"] { color: #b91c1c; border-color: color-mix(in srgb, #dc2626 35%, var(--line)); }
.debug-priority-level[title*="高"] { color: #c2410c; }
.debug-task-sheet, .debug-sheet-stack { display: grid; gap: 12px; }
.debug-sheet-stack .field, .debug-sheet-more { display: grid; gap: 8px; }
.debug-sheet-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.debug-sheet-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--muted); border: 1px solid var(--line); }
.debug-sheet-toolbar-hint { font-size: 13px; }
.debug-sheet-toolbar > form { margin: 0; display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.debug-status-form { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0; }
.debug-status-form .select,
.debug-status-form .input { width: auto; min-width: 120px; max-width: 168px; flex: 0 0 auto; }
.debug-more-list { display: grid; gap: 10px; padding: 4px 0 2px; }
.debug-more-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 0; }
.debug-more-label { font-size: 13px; color: var(--muted-foreground); }
.debug-more-row .select,
.debug-more-row .input { width: 100%; min-width: 0; }
.debug-title-card, .debug-type-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.debug-title-card { font-size: 16px; font-weight: 650; line-height: 1.55; }
.debug-title-input { font-size: 16px; font-weight: 600; line-height: 1.5; }
.debug-type-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.debug-props {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 28px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
}
.debug-props > div { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: baseline; min-width: 0; }
.debug-title-meta { display: block; margin-top: 6px; font-size: 12px; font-weight: 500; }
.debug-props dt { margin: 0; color: var(--muted-foreground); font-size: 13px; font-weight: 500; }
.debug-props dd { margin: 0; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debug-sheet-body { display: grid; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.debug-sheet-h { margin: 0; font-size: 13px; font-weight: 650; }
.debug-sheet-hint { margin: 0; font-size: 13px; }
.debug-sheet-flow { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--secondary); }
.debug-sheet-disclose { border-top: 1px solid var(--line); padding-top: 12px; }
.debug-sheet-disclose > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.debug-sheet-disclose[open] > summary { margin-bottom: 10px; color: var(--foreground); }
.debug-sheet-hero { display: grid; gap: 6px; }
.debug-sheet-hero-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.debug-sheet-title { margin: 0; font-size: 20px; line-height: 1.35; }
.debug-sheet-sub { margin: 0; }
.debug-prose { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.debug-comments { display: grid; gap: 12px; margin-top: 4px; }
.debug-comments-title { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.35; color: var(--foreground); }
.debug-comments-empty { margin: 0; font-size: 13px; }
.debug-composer { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.debug-composer-actions-only { border-style: dashed; background: transparent; }
.debug-composer-actions-only .debug-composer-bar { border-top: 0; }
.debug-composer .textarea { border: 0; border-radius: 0; box-shadow: none; min-height: 44px; }
.debug-composer-bar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 6px 8px 8px; border-top: 1px solid var(--line); }
.debug-composer-action-form { margin: 0; display: inline-flex; }
.debug-composer-bar .button-outline { --button-bg: var(--background); }
.debug-sheet-danger { margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.debug-sheet-danger-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.debug-comment-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.debug-comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.debug-comment-item { margin: 0; padding: 0; border: 0; background: transparent; }
.debug-comment-row { display: flex; align-items: flex-start; gap: 10px; }
.debug-comment-avatar { width: 32px; height: 32px; flex: 0 0 32px; font-size: 13px; font-weight: 600; }
.debug-comment-avatar .avatar-fallback { border: 0; color: #fff; font-weight: 600; }
.debug-comment-avatar-tone-0 .avatar-fallback { background: #6366f1; }
.debug-comment-avatar-tone-1 .avatar-fallback { background: #8b5cf6; }
.debug-comment-avatar-tone-2 .avatar-fallback { background: #3b82f6; }
.debug-comment-avatar-tone-3 .avatar-fallback { background: #0ea5e9; }
.debug-comment-avatar-tone-4 .avatar-fallback { background: #14b8a6; }
.debug-comment-avatar-tone-5 .avatar-fallback { background: #f97316; }
.debug-comment-main { min-width: 0; flex: 1 1 auto; display: grid; gap: 4px; }
.debug-comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 32px; line-height: 1.35; }
.debug-comment-author { font-size: 14px; font-weight: 600; color: var(--foreground); }
.debug-comment-time { font-size: 12px; font-weight: 400; color: var(--muted-foreground); }
.debug-comment-body { margin: 0; font-size: 14px; line-height: 1.65; color: var(--foreground); word-break: break-word; white-space: pre-wrap; }
.debug-callout { padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--secondary); margin: 12px 0; }
.debug-callout-reply { border-color: color-mix(in srgb, var(--amber, #f59e0b) 40%, var(--line)); background: color-mix(in srgb, var(--amber, #f59e0b) 8%, var(--card)); }
.debug-callout-fail { border-color: color-mix(in srgb, #dc2626 35%, var(--line)); background: color-mix(in srgb, #dc2626 8%, var(--card)); }
.debug-callout-ok { border-color: color-mix(in srgb, #059669 35%, var(--line)); background: color-mix(in srgb, #059669 8%, var(--card)); }
.debug-shot-block { margin: 0 0 16px; }
.debug-shot-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.debug-shot { display: block; width: 160px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--background); }
.debug-shot img { display: block; width: 160px; height: 100px; object-fit: cover; }
.debug-list-problem { display: flex; align-items: flex-start; gap: 10px; color: inherit; text-decoration: none; }
.debug-list-problem strong { display: block; }
.debug-list-excerpt { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; }
.debug-list-shot { width: 96px; height: 60px; flex: 0 0 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--secondary); }
.debug-shot-empty, .debug-paste-hint { margin: 0 0 8px; font-size: 13px; color: var(--muted-foreground); }
.debug-paste-hint .link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; }
.debug-sheet-actions { display: grid; gap: 12px; }
.debug-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 560px) { .debug-sheet-pair { grid-template-columns: 1fr; } .debug-props { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .debug-kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .debug-kanban { grid-template-columns: 1fr; } }
.asset-field { display: grid; gap: 6px; }
.asset-field-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.asset-field-controls .file-input { flex: 1 1 auto; width: auto; min-width: 180px; max-width: 100%; }
.settings-form .asset-field-controls .file-input { width: 100%; max-width: 100%; }
.asset-field-preview { width: 52px; height: 52px; flex: 0 0 52px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--secondary); }
.asset-field-preview img { width: 100%; height: 100%; object-fit: contain; }
.asset-field-preview-missing { border-color: color-mix(in srgb, var(--destructive, #dc2626) 45%, var(--line)); background: color-mix(in srgb, var(--destructive, #dc2626) 8%, var(--secondary)); }
.asset-field-preview-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--destructive, #dc2626); font-size: 12px; font-weight: 600; }

.card-description { margin: 4px 0 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.5; }
.card-footer { padding: 16px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--line); }

.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: #fca5a5; box-shadow: 0 0 0 3px rgba(239, 68, 68, .15); }
.field-error { margin-top: 4px; color: var(--destructive); font-size: 12px; }

.notice { border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }

.eyebrow { margin: 0 0 4px; color: var(--muted-foreground); font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 0; text-transform: none; }
.page-context { display: none; align-items: center; gap: 6px; min-width: 0; max-width: min(360px, 40vw); overflow: hidden; color: var(--muted-foreground); font-size: 13px; white-space: nowrap; }
.page-context span + span::before { content: "/"; margin: 0 6px; color: #cbd5e1; }
.page-context span:last-child { color: var(--foreground); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.topbar-separator-context { display: none; }
@media (min-width: 900px) {
  .page-context, .topbar-separator-context { display: inline-flex; }
}
.mobile-nav-sublabel { margin: 8px 0 2px 34px; padding: 0 10px; color: var(--muted-foreground); font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
h1 { margin-bottom: 2px; font-size: inherit; line-height: inherit; font-weight: inherit; letter-spacing: inherit; }
h2 { font-size: 18px; line-height: 1.35; font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: 14px; font-weight: 650; }
.lead { font-size: 14px; line-height: 1.5; }
.button { min-height: 36px; padding: 8px 16px; border-radius: 7px; font-size: 14px; font-weight: 500; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.button .ui-icon { width: 16px; height: 16px; }
.button:hover { transform: none; }
.button-primary { box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.button-secondary:hover { border-color: var(--line); background: #f1f5f9; }
.button-small { min-height: 32px; padding: 6px 10px; }

/* Reusable source-aligned primitives for pages enabled by host projects. */
.ui-tabs { width: max-content; max-width: 100%; margin: 0 0 16px; padding: 3px; display: flex; align-items: center; gap: 2px; overflow-x: auto; border-radius: 9px; color: var(--muted); background: #f1f5f9; }
.ui-tab { min-height: 32px; padding: 6px 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.ui-tab:hover { background: rgba(255,255,255,.65); }
.ui-tab.is-active { border-color: color-mix(in srgb, var(--brand) 20%, var(--border)); background: var(--background); color: var(--brand-dark); box-shadow: 0 1px 2px rgba(15,23,42,.08); font-weight: 600; }
.ui-tab.is-disabled { color: #94a3b8; cursor: not-allowed; opacity: .72; }
.ui-alert { padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.ui-alert-title { margin: 0; font-size: 14px; font-weight: 600; }
.ui-alert-description { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.ui-skeleton { min-height: 16px; border-radius: 6px; background: linear-gradient(90deg, #f1f5f9 25%, #e7edf5 50%, #f1f5f9 75%); background-size: 200% 100%; animation: ui-skeleton-pulse 1.7s ease-in-out infinite; }
.ui-switch { width: 36px; height: 20px; padding: 2px; display: inline-flex; align-items: center; border: 0; border-radius: 999px; background: #cbd5e1; }
.ui-switch::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.18); transition: transform .15s ease; }
.ui-switch.is-active { background: var(--brand); }
.ui-switch.is-active::after { transform: translateX(16px); }
@keyframes ui-skeleton-pulse { to { background-position: -200% 0; } }

.grid { gap: 16px; }
.section-gap { margin-top: 16px; }
.list-create-button { flex: 0 0 auto; white-space: nowrap; }
.card { border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow-sm); }
.card:hover { box-shadow: var(--shadow-sm); }
.card-pad, .card-body { padding: 24px; }
.card-head { padding: 24px 24px 14px; border-bottom: 0; }
.card-head p { margin-top: 4px; font-size: 14px; }
.dashboard-quick-actions .button .nav-count { margin-left: 6px; }
.ui-tab-badge { min-width: 18px; height: 18px; margin-left: 8px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; color: #fff; background: var(--brand); font-size: 11px; font-weight: 600; line-height: 1; }
.avatar-initials.avatar-sm { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.avatar-initials.avatar-md { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 999px; font-size: 16px; font-weight: 600; }
.avatar-initials .avatar-fallback { width: 100%; height: 100%; display: grid; place-items: center; border: 1px solid var(--line); border-radius: inherit; color: var(--ink); background: #f8fafc; }
.dashboard-activity-item .avatar-initials { flex: 0 0 auto; }
.dashboard-activity-empty .avatar-initials { margin-bottom: 4px; }
.list-page-toolbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.list-table-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.list-active-filters { margin: -8px 0 8px; }
.list-table-section { display: flex; flex-direction: column; gap: 16px; overflow: visible; }
.list-table-section .list-bulk-form { margin: 0; padding: 0; overflow: visible; }
.list-table-section .table-wrap { overflow-x: auto; overflow-y: visible; margin: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--card); }
.list-table-section:has(.row-actions[open]) .table-wrap,
.list-table-section:has(.list-bulk-form .row-actions[open]) .table-wrap,
.data-card:has(.row-actions[open]) .table-wrap { overflow: visible; }
.list-table-section:has(.row-actions[open]),
.data-card:has(.row-actions[open]) { position: relative; z-index: 3; }
.row-actions[open] { z-index: 90; }
.list-table-section .list-table td.text-right { overflow: visible; position: relative; }
.list-table-section .pagination { margin: 16px 0 0; padding: 12px 8px 0; border: 0; background: transparent; box-shadow: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.list-table-section .pagination .pages { margin-left: auto; }
.list-data-card-head { display: none; }
.list-data-card-head-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-width: 0; }
.list-data-card-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.dashboard-page-tabs { margin: 0; flex: 0 0 auto; width: fit-content; max-width: 100%; }
.dashboard-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.permission-matrix-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.permission-matrix-head h2 { margin: 0; font-size: 16px; }
.permission-matrix-inline { padding: 0; border: 0; background: transparent; box-shadow: none; }
.public-docs-body { background: var(--soft); }
.public-docs-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 16px 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.public-docs-brand { display: flex; align-items: center; gap: 12px; }
.public-docs-brand strong { display: block; font-size: 15px; }
.public-docs-brand small { display: block; color: var(--muted); font-size: 12px; }
.public-docs-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.public-docs-main { width: min(1180px, 100%); margin: 0 auto; padding: 28px 24px 72px; }
.public-docs-hero { margin-bottom: 18px; }
.public-docs-hero h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.03em; }
.public-docs-note { margin-top: 8px; font-size: 13px; }
.list-data-card-count { color: var(--ink); font-size: 13px; font-weight: 600; }
.list-data-card-meta { font-size: 12px; }
.list-filter-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.list-filter-tag { min-height: 24px; padding: 2px 10px; display: inline-flex; align-items: center; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border)); border-radius: 999px; color: var(--brand-dark); background: var(--brand-soft); font-size: 12px; font-weight: 500; }
.list-table .primary-cell.is-stacked > a, .list-table .primary-cell.is-stacked > strong { display: block; }
.list-table .primary-cell.is-stacked > span { display: block; margin: 2px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-table .primary-cell.is-stacked > span::before { content: none; margin: 0; }
.header-icon-button-badge { position: relative; }
.header-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: #ef4444; font-size: 10px; font-weight: 700; line-height: 1; pointer-events: none; }
.notification-list { display: grid; }
.notification-item { padding: 16px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: 0; }
.notification-item.is-unread { background: #f8fbff; }
.list-table tbody tr.is-row-unread { background: #f8fbff; }
.list-table tbody tr.is-row-unread td { border-color: color-mix(in srgb, var(--line) 70%, #93c5fd); }
.notification-item-main { min-width: 0; display: flex; align-items: flex-start; gap: 14px; }
.notification-copy { min-width: 0; }
.notification-copy strong { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.notification-copy p { margin: 4px 0; color: var(--ink); font-size: 13px; line-height: 1.55; }
.notification-copy small { color: var(--muted); font-size: 12px; }
.api-docs-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
.api-docs-nav-list { padding: 8px; display: grid; gap: 4px; }
.api-docs-nav-list a { padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; }
.api-docs-nav-list a:hover { background: #f1f5f9; }
.api-docs-nav-list a.is-active { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }
.api-docs-foot { padding: 12px 16px 16px; font-size: 12px; }
.api-docs-panel .card-head { border-bottom: 1px solid var(--line); }
.api-method { min-width: 52px; padding: 2px 8px; display: inline-flex; justify-content: center; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.api-method-get { color: #166534; background: #dcfce7; }
.api-method-post { color: #1d4ed8; background: #dbeafe; }
.api-method-put { color: #9a3412; background: #ffedd5; }
.api-method-delete { color: #991b1b; background: #fee2e2; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; }

.command-search-form { padding: 0 8px 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.command-input-live { flex: 1 1 220px; min-width: 180px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.command-input-live .input { width: 100%; min-height: 34px; padding: 0; border: 0; box-shadow: none; background: transparent; }
.command-input-live .input:focus { box-shadow: none; }
.search-hero { padding: 20px 24px; }
.search-hero-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search-field-wide { flex: 1 1 420px; min-width: min(100%, 280px); }
.search-results { display: grid; gap: 16px; }
.search-result-list { padding: 8px; display: grid; gap: 4px; }
.search-result-item { padding: 10px 12px; display: flex; align-items: center; gap: 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.search-result-item:hover { background: #f8fafc; }
.search-result-item strong { display: block; font-size: 14px; }
.search-result-item small { color: var(--muted); font-size: 12px; }
.search-result-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.dashboard-reports-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-reports-wide { grid-column: 1 / -1; }
.dashboard-overview-secondary { grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 16px; }
.dashboard-todo-groups { display: grid; gap: 16px; }
.dashboard-todo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.dashboard-todo-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; color: inherit; text-decoration: none; }
.dashboard-todo-item:last-child { border-bottom: 0; }
.dashboard-todo-item:hover strong { color: var(--brand); }
.dashboard-todo-item small { display: block; color: var(--muted); font-size: 12px; }
.dashboard-todo-empty { padding: 8px 0; font-size: 13px; }
.dashboard-risk-banner { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px 12px; border: 1px solid #fecaca; border-radius: 8px; background: #fef2f2; color: #991b1b; text-decoration: none; font-size: 13px; }
.dashboard-risk-banner small { display: block; color: #b91c1c; font-size: 12px; }
.bar-list-item-link { display: block; color: inherit; text-decoration: none; }
.bar-list-item-link:hover .bar-list-label span { color: var(--brand); }
.trend-row-link { display: grid; gap: 7px; color: inherit; text-decoration: none; }
.trend-row-link:hover .bar-list-label span { color: var(--brand); }
.dashboard-tab-foot { margin-top: 8px; font-size: 13px; }
.dashboard-risk-banner-compact { margin-top: 14px; }
.dashboard-report-toolbar { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 12px 16px; margin-top: 4px; }
.dashboard-period-form { display: flex; flex: 1 1 auto; flex-wrap: nowrap; align-items: center; gap: 10px; min-width: 0; }
.dashboard-period-label { flex-shrink: 0; font-size: 13px; white-space: nowrap; }
.dashboard-report-toolbar-actions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 8px; margin-left: auto; }
.report-link-list { display: grid; gap: 10px; }
.report-link-card { padding: 14px 16px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; background: #fafafa; }
.report-link-card:hover { border-color: #bfdbfe; background: #eff6ff; }
.report-link-card strong { font-size: 14px; }
.report-link-card span { color: var(--muted); font-size: 12px; }
.api-spec-group + .api-spec-group { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.api-spec-tag { margin: 0 0 12px; padding: 0 20px; font-size: 14px; font-weight: 600; }
.curl-example-list { padding: 8px 20px 20px; display: grid; gap: 16px; }
.curl-example-card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.curl-example-pre { margin: 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #0f172a; color: #e2e8f0; font-size: 12px; line-height: 1.55; }
.curl-example-pre code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre; }
.list-sort-select .select { min-width: 132px; }
.list-table-tools { padding: 12px 20px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.list-table-tools-end, .list-table-tools-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bulk-actions-bar { display: none; }
.bulk-actions-dock { position: fixed; z-index: 50; bottom: 24px; left: 50%; display: none; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--background) 95%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(12px); transform: translateX(-50%); transition: transform .2s ease, opacity .2s ease; }
.list-bulk-form:has(input[name="ids[]"]:checked) .bulk-actions-dock,
.list-bulk-form.is-bulk-active .bulk-actions-dock { display: flex; }
.list-bulk-form:has(input[name="ids[]"]:checked),
.list-bulk-form.is-bulk-active { padding-bottom: 72px; }
.bulk-actions-clear { width: 32px; min-width: 32px; height: 32px; padding: 0; border-radius: 999px; }
.bulk-actions-separator { height: 20px; align-self: center; }
.bulk-actions-meta { display: inline-flex; align-items: center; gap: 8px; padding-inline: 4px; color: var(--foreground); font-size: 14px; white-space: nowrap; }
.bulk-actions-badge { min-width: 32px; height: 24px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--primary-foreground); background: var(--primary); font-size: 12px; font-weight: 600; line-height: 1; }
.bulk-actions-label { color: var(--foreground); font-size: 14px; font-weight: 500; }
.bulk-actions-buttons { display: inline-flex; align-items: center; gap: 6px; }
.bulk-actions-buttons .button-icon { width: 32px; min-width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.bulk-actions-hint { display: none; }
.ui-popover { position: relative; display: inline-block; }
.ui-popover > summary { list-style: none; cursor: pointer; }
.ui-popover > summary::-webkit-details-marker { display: none; }
.ui-popover-panel { position: absolute; z-index: 80; top: calc(100% + 4px); right: 0; min-width: 12rem; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-lg); }
.column-toggle-panel { display: grid; gap: 8px; min-width: 180px; padding: 4px; }
.column-toggle-panel label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.bulk-confirm-card { max-width: 720px; }
.bulk-confirm-list { margin: 16px 0 20px; padding-left: 20px; color: var(--ink); }
.bulk-confirm-list li { margin: 4px 0; }
.bulk-confirm-list-dialog { margin: 0; padding: 12px 12px 12px 28px; max-height: 160px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--secondary); color: var(--muted-foreground); font-size: 13px; line-height: 1.5; }
.bulk-confirm-list-dialog li { margin: 2px 0; }
.bulk-confirm-list-dialog li::marker { color: color-mix(in srgb, var(--red) 55%, var(--muted)); }
.bulk-delete-overlay { display: block; }
.bulk-delete-backdrop { display: none; position: fixed; inset: 0; z-index: 240; background: rgba(15, 23, 42, .45); cursor: default; }
.bulk-delete-toggle:not(:checked) ~ .bulk-delete-modal { display: none; }
.bulk-delete-toggle:checked ~ .bulk-delete-backdrop { display: block; }
.bulk-delete-toggle:checked ~ .bulk-delete-modal {
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 250;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 48px));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.bulk-delete-modal-body {
  display: grid;
  gap: 16px;
  padding: 24px;
  overflow-y: auto;
}
.bulk-delete-modal-header { display: grid; gap: 6px; }
.bulk-delete-modal-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.015em; color: var(--foreground); }
.bulk-delete-modal-lead { margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.5; }
.bulk-delete-modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  background: var(--background);
  flex-shrink: 0;
}
.bulk-delete-modal-footer form { display: inline-flex; margin: 0; }
.bulk-delete-modal .ui-alert-destructive { margin: 0; }
.ui-dialog-destructive .ui-dialog-body { gap: 14px; }
.ui-alert-destructive { border-color: color-mix(in srgb, var(--red) 24%, var(--border)); background: var(--red-soft); }
.ui-alert-destructive > span { color: var(--red); }
.ui-alert-destructive .ui-alert-title { color: var(--red); }
.ui-alert-destructive .ui-alert-description { color: color-mix(in srgb, var(--red) 68%, var(--muted)); }
.command-results { padding: 0 8px 4px; }
.command-results-group { margin-bottom: 6px; }
.command-results-label { padding: 4px 8px; font-size: 10px; font-weight: 750; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.command-result-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; color: #475569; font-size: 12px; text-decoration: none; }
.command-result-item:hover { color: var(--brand); background: var(--brand-soft); }
.command-result-item small { margin-left: auto; color: #94a3b8; font-size: 10px; }
.command-results-empty { padding: 8px 10px 4px; font-size: 12px; }
.command-results-foot { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px 2px; font-size: 12px; }
.chat-list-item.is-unread strong { color: var(--ink); }
.chat-list-empty, .chat-compose-hint { padding: 12px 16px; font-size: 13px; }
.chat-compose-hint { border-top: 1px solid var(--line); margin: 0; }
.metric > .metric-label { margin: 0; padding: 24px 24px 8px; }
.metric > .section-gap { margin: 0; padding: 4px 24px 12px; }
.card-body > .metric-value { margin-top: 12px; padding: 0; }
.card-body > .metric-hint { margin-top: 4px; padding: 0; color: var(--muted-foreground); font-size: 12px; font-weight: 500; }
.insight-card { min-height: 142px; padding: 24px; }
.insight-icon { width: 24px; height: 24px; border-radius: 6px; }
.insight-value { font-size: 24px; }

/* App integrations — shadcn-admin apps/index.tsx */
.app-page-head { margin-bottom: 24px; }
.app-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.app-controls-main { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.app-controls .input, .app-controls .select { min-height: 36px; }
.app-controls .app-search { width: 280px; }
.app-controls .app-type { width: 150px; }
.app-sort-control { position: relative; display: flex; align-items: center; }
.app-sort-control > span { position: absolute; z-index: 1; left: 12px; display: inline-flex; color: var(--muted); pointer-events: none; }
.app-sort-control > span .ui-icon { width: 16px; height: 16px; }
.app-sort-control .select { width: 142px; padding-left: 36px; }
.app-separator { height: 1px; margin-bottom: 24px; background: var(--line); }
.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.app-card { display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); transition: border-color .15s ease, box-shadow .15s ease; }
.app-card-link { color: inherit; text-decoration: none; }
.app-card:hover, .app-card-link:hover { border-color: var(--border); box-shadow: var(--shadow-md); }
.app-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 32px; }
.app-card-icon, .app-mark { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--foreground); background: var(--secondary); font-size: 13px; font-weight: 700; }
.app-card-icon .ui-icon { width: 20px; height: 20px; }
.app-card-mark { font-size: 13px; font-weight: 700; }
.app-card-status { min-height: 32px; padding: 0 12px; white-space: nowrap; pointer-events: none; font-size: 12px; font-weight: 500; }
.app-card-status.is-connected { color: #1d4ed8; border-color: #93c5fd; background: #eff6ff; }
.app-card-body { display: grid; gap: 4px; }
.app-card-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--foreground); }
.app-card-desc { margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-empty { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 8px; }

.field { gap: 8px; }
.field label { color: var(--foreground); font-size: 14px; font-weight: 500; }
.input, .select, .textarea { min-height: 36px; padding: 8px 12px; border-radius: 6px; border-color: var(--input); font-size: 14px; box-shadow: var(--shadow-xs); background: var(--background); }
.input:focus, .select:focus, .textarea:focus { border-color: color-mix(in srgb, var(--foreground) 22%, var(--border)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--foreground) 6%, transparent); }
.textarea { min-height: 96px; padding-top: 10px; padding-bottom: 10px; resize: vertical; }
.input-readonly { display: flex; align-items: center; color: var(--muted-foreground); background: var(--secondary); box-shadow: none; }
.toolbar, .toolbar-inline { margin-bottom: 16px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.toolbar.card { border: 0; background: transparent; box-shadow: none; }
.toolbar form, .toolbar-inline form { align-items: center; gap: 8px; }
.toolbar .input, .toolbar-inline form .input { width: 250px; min-height: 32px; }
.toolbar .select, .toolbar-inline form .select { width: auto; min-width: 132px; min-height: 32px; }
.search-field { flex: 0 1 250px; min-width: 180px; }
.toolbar-inline form .search-field .input { width: 100%; min-height: 32px; }
.filter-select { position: relative; display: inline-flex; align-items: center; }
.filter-select .ui-icon { position: absolute; z-index: 1; left: 10px; pointer-events: none; }
.filter-select:has(.ui-icon) .select { padding-left: 32px; }
.toolbar .filter-select .select,
.list-page-toolbar-row .filter-select .select { border-style: solid; font-weight: 400; }
.toolbar .button, .toolbar-inline .button { min-height: 32px; padding: 6px 10px; }

.users-list-card, .data-card { overflow: visible; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.data-card .list-bulk-form,
.list-table-section .list-bulk-form { display: flex; flex-direction: column; margin: 0; padding: 0; }
.data-card .list-bulk-form .table-wrap,
.list-table-section .table-wrap { overflow-x: auto; margin: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--card); }
.data-card .list-table,
.list-table-section .list-table { width: 100%; min-width: 100%; border-collapse: collapse; font-size: 13px; font-weight: 400; table-layout: auto; }
.data-card .list-table thead tr { border-bottom: 1px solid var(--border); }
.data-card .list-table tbody tr { border-bottom: 1px solid var(--border); transition: background-color .15s ease; }
.data-card .list-table tbody tr:last-child { border-bottom: 0; }
.data-card .list-table thead th { position: static; height: 40px; padding: 0 16px; border-bottom: 0; color: var(--foreground); background: var(--card); font-size: 12px; font-weight: 600; letter-spacing: 0; text-align: left; vertical-align: middle; white-space: nowrap; }
.data-card .list-table tbody td { height: auto; padding: 12px 16px; border-bottom: 0; color: var(--muted-foreground); font-size: 13px; font-weight: 400; vertical-align: middle; white-space: nowrap; }
.data-card .list-table tbody tr:hover,
.data-card .list-table tbody tr:focus-within { background: color-mix(in srgb, var(--muted-foreground) 5%, transparent); }
.table-wrap { border-radius: inherit; }
.table-wrap table:not(.list-table) { min-width: 720px; font-size: 14px; }
.table-wrap thead th { position: sticky; top: 0; z-index: 1; }
th { height: 40px; padding: 0 16px; color: var(--foreground); background: var(--card); font-size: 12px; font-weight: 600; letter-spacing: 0; }
td { height: auto; padding: 12px 16px; color: var(--muted-foreground); font-size: 13px; white-space: nowrap; vertical-align: middle; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: color-mix(in srgb, var(--muted-foreground) 5%, transparent); }
tbody tr:focus-within { background: color-mix(in srgb, var(--muted-foreground) 5%, transparent); }
.data-card tbody tr:hover,
.data-card tbody tr:focus-within { background: color-mix(in srgb, var(--muted-foreground) 5%, transparent); }
.primary-cell strong, .user-username { font-size: 13px; font-weight: 500; color: var(--foreground); }
.cell-truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.primary-cell span, .user-cell small { margin-top: 2px; font-size: 12px; }
.table-sort { display: inline-flex; align-items: center; gap: 6px; }
.table-sort .ui-icon { width: 14px; height: 14px; color: var(--muted); }
.user-cell { gap: 8px; }
.customer-level { min-width: 24px; height: 24px; padding: 0 7px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; font-size: 12px; font-weight: 400; }
.ui-icon-button { width: 32px; height: 32px; border-radius: 6px; }
.row-actions > summary { border-color: transparent; color: var(--foreground); background: transparent; box-shadow: none; }
.row-actions > summary:hover, .row-actions[open] > summary { border-color: transparent; color: var(--foreground); background: var(--accent); }
.row-actions-panel { z-index: 80; top: calc(100% + 4px); min-width: 168px; padding: 4px; border-radius: 8px; box-shadow: var(--shadow-lg); }
.row-actions-panel a, .row-actions-panel button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 14px; font-weight: 500; }
.row-actions-panel .ui-icon { width: 15px; height: 15px; color: var(--muted); }
.row-actions-panel .row-action-danger { color: var(--red); }
.row-actions-panel .row-action-danger .ui-icon { color: currentColor; }
.row-actions-panel .row-action-disabled { color: #94a3b8; cursor: not-allowed; }
.row-actions-panel .row-action-disabled:hover { color: #94a3b8; background: transparent; }
.list-table tbody tr:nth-last-child(-n+2) .row-actions-panel { top: auto; bottom: 34px; }
.list-table .primary-cell { max-width: 360px; }
.list-table .primary-cell > a, .list-table .primary-cell > strong { display: inline; font-weight: 500; }
.list-table .primary-cell > span { display: none; }
.pagination { margin-top: 0; padding: 0 8px; border: 0; font-size: 14px; background: transparent; }
.pagination-total { min-width: 132px; color: var(--muted-foreground); }
.pagination-state { color: var(--foreground); font-size: 13px; font-weight: 500; }
.pagination .button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.pagination .button:not(.button-primary):not(.button-secondary) { border-color: var(--border); background: var(--background); box-shadow: var(--shadow-xs); }
.pagination .pages { gap: 4px; }
.pagination-icon { width: 32px; padding: 0 !important; }
.pagination-icon .ui-icon { width: 15px; height: 15px; }
.pagination-disabled { opacity: .45; cursor: default; }
.empty { padding: 64px 24px; }
.empty-mark { width: 40px; height: 40px; margin-bottom: 12px; border-radius: 10px; }

/* Long business forms follow the hierarchy of the reference settings pages. */
.form-card { width: min(1040px, 100%); margin-inline: 0; padding: 28px; gap: 20px 24px; }
.content-page-head--form + .form-card { margin-top: 20px; }
.form-grid > * { min-width: 0; }
.member-form { width: 100%; max-width: 1040px; }
.form-section-title { padding: 2px 0 12px; border-bottom: 1px solid var(--line); }
.form-section-title:not(:first-child) { margin-top: 8px; }
.form-card > .form-section-title:first-of-type { margin-top: 0; }
.form-section-heading { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 15px; font-weight: 600; }
.form-section-heading .ui-icon { color: var(--muted); }
.form-section-title p { margin: 4px 0 0 25px; color: var(--muted); font-size: 12px; }
.form-actions { margin-top: 4px; padding-top: 20px; border-top: 1px solid var(--line); }
.avatar-upload { min-height: 92px; padding: 16px; display: flex; align-items: center; gap: 18px; border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; }
.avatar-large { width: 64px; height: 64px; flex-basis: 64px; border-radius: 14px; font-size: 20px; }
.avatar-upload-fields { min-width: 0; display: grid; gap: 6px; }
.avatar-upload-fields > label:not(.check) { color: var(--ink); font-size: 14px; font-weight: 500; }
.avatar-upload-fields small { color: var(--muted); font-size: 12px; }
.file-input { max-width: 100%; color: var(--muted); font-size: 13px; }
.file-input::file-selector-button { min-height: 32px; margin-right: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; font: inherit; font-weight: 500; cursor: pointer; }
.file-input::file-selector-button:hover { background: #f1f5f9; }
.danger-zone { width: min(1040px, 100%); margin: 16px auto 0; border: 1px solid #fecaca; border-radius: 10px; background: #fff; }
.danger-zone > summary { min-height: 64px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #991b1b; }
.danger-zone > summary strong, .danger-zone > summary small { display: block; }
.danger-zone > summary strong { font-size: 14px; }
.danger-zone > summary small { margin-top: 3px; color: #b45359; font-size: 12px; font-weight: 400; }
.danger-zone[open] > summary { border-bottom: 1px solid #fecaca; }
.danger-zone[open] > summary > span:last-child { transform: rotate(180deg); }
.danger-zone-panel { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.danger-zone-panel p { margin: 0; color: var(--muted); font-size: 13px; }
.detail-summary .card-body { min-height: 144px; }
.detail-summary .metric-value, .date-value { font-variant-numeric: tabular-nums; }
.dashboard-detail-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 3fr); }
.dashboard-detail-grid > .card { min-width: 0; }
.dashboard-overview-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(320px, 3fr); gap: 16px; }
.dashboard-overview-grid > .card { min-width: 0; }
.dashboard-chart-card, .dashboard-activity-card { min-height: 420px; }

.ui-area-chart { position: relative; min-height: 280px; padding: 8px 20px 12px 4px; }
.dashboard-area-chart { min-height: 320px; }
.ui-area-chart-svg { width: 100%; height: auto; min-height: 260px; display: block; overflow: hidden; }
.ui-area-chart-grid { stroke: rgba(148, 163, 184, .28); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ui-area-chart-y-label { fill: var(--muted-foreground); font-size: 11px; font-family: inherit; }
.ui-area-chart-x-label { fill: var(--muted-foreground); font-size: 11px; font-family: inherit; }
.ui-area-chart-line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.ui-area-chart-line-primary { stroke: var(--chart-1); }
.ui-area-chart-line-secondary { stroke: var(--chart-2); }
.ui-area-chart-area { stroke: none; }
.ui-area-chart-area-primary { fill: color-mix(in srgb, var(--chart-1) 18%, transparent); }
.ui-area-chart-area-secondary { fill: color-mix(in srgb, var(--chart-2) 14%, transparent); }
.ui-area-chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; padding-left: 16px; color: var(--muted-foreground); font-size: 12px; }
.ui-area-chart-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.ui-area-chart-dot-primary { background: var(--chart-1); }
.ui-area-chart-dot-secondary { background: var(--chart-2); }

.dashboard-chart { position: relative; height: 326px; padding: 18px 30px 24px; display: grid; grid-template-columns: repeat(7, minmax(44px, 1fr)); align-items: end; gap: 16px; }
.dashboard-chart::before { content: ""; position: absolute; z-index: 0; inset: 18px 30px 55px; background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), rgba(226,232,240,.7) 25%); pointer-events: none; }
.dashboard-chart-column { position: relative; z-index: 1; height: 100%; min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) 24px; justify-items: center; align-items: end; gap: 8px; }
.dashboard-chart-value { position: absolute; left: 50%; top: -24px; color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; transform: translateX(-50%); }
.dashboard-chart-track { width: min(40px, 58%); height: calc(100% - 18px); display: flex; align-items: end; }
.dashboard-chart-bar { position: relative; width: 100%; min-height: 4px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #3b82f6, var(--brand)); box-shadow: 0 1px 2px rgba(37,99,235,.20); }
.dashboard-chart-label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.chart-level-0 { height: 4px; opacity: .18; }
.chart-level-1 { height: 10%; }
.chart-level-2 { height: 20%; }
.chart-level-3 { height: 30%; }
.chart-level-4 { height: 40%; }
.chart-level-5 { height: 50%; }
.chart-level-6 { height: 60%; }
.chart-level-7 { height: 70%; }
.chart-level-8 { height: 80%; }
.chart-level-9 { height: 90%; }
.chart-level-10 { height: 100%; }
.dashboard-activity-list { padding: 0 24px 24px; display: grid; gap: 32px; }
.dashboard-activity-item { min-width: 0; padding: 0; display: flex; align-items: center; gap: 16px; border-radius: 8px; color: inherit; text-decoration: none; }
.dashboard-activity-item:hover .activity-copy strong { color: var(--brand); }
.activity-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 999px; color: var(--ink); background: var(--secondary); border: 1px solid var(--line); }
.activity-copy { min-width: 0; flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.activity-copy strong, .activity-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy strong { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.25; transition: color .15s ease; }
.activity-copy small { width: 100%; margin-top: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.25; }
.dashboard-activity-item > .badge { flex: 0 0 auto; margin-left: auto; }
.dashboard-activity-empty { min-height: 250px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: var(--muted); }
.dashboard-activity-empty strong { color: var(--ink); font-size: 14px; font-weight: 500; }
.dashboard-tab-content { margin-top: 4px; }
.dashboard-analytics-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: stretch; }
.dashboard-analytics-grid > .card { min-width: 0; }
.dashboard-analytics-grid > .dashboard-analytics-card { display: flex; flex-direction: column; }
.analytics-card-head { margin-bottom: 24px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.analytics-card-head h2 { margin: 0; }
.bar-list { display: grid; gap: 18px; }
.bar-list-item, .trend-row { display: grid; gap: 7px; }
.bar-list-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.bar-list-label strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: #f1f5f9; }
.progress-track > span { height: 100%; display: block; border-radius: inherit; background: var(--brand); }
.progress-level-0 { width: 0; }
.progress-level-1 { width: 10%; }
.progress-level-2 { width: 20%; }
.progress-level-3 { width: 30%; }
.progress-level-4 { width: 40%; }
.progress-level-5 { width: 50%; }
.progress-level-6 { width: 60%; }
.progress-level-7 { width: 70%; }
.progress-level-8 { width: 80%; }
.progress-level-9 { width: 90%; }
.progress-level-10 { width: 100%; }
.trend-row + .trend-row { margin-top: 18px; }
.trend-row .mini-bars { height: 40px; margin-top: 0; gap: 4px; }
.button-primary .ui-icon { stroke-width: 2; }
.link { font-weight: 500; text-underline-offset: 3px; }
.role-option:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); background: var(--brand-soft); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 12%, transparent); }
.role-option:has(input:focus-visible) { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }

.shell.is-sidebar-collapsed .sidebar { flex: 0 0 64px; width: 64px; min-width: 64px; padding: 8px; overflow: visible; }
.shell.is-sidebar-collapsed .brand,
.shell.is-sidebar-collapsed .team-switcher-trigger { min-height: 48px; padding: 8px; justify-content: center; }
.shell.is-sidebar-collapsed .brand-logo,
.shell.is-sidebar-collapsed .team-switcher-logo { width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; }
.shell.is-sidebar-collapsed .team-switcher-logo img { width: 100%; height: 100%; max-width: 28px; max-height: 28px; object-fit: contain; }
.shell.is-sidebar-collapsed .team-switcher-logo--brand { max-width: 32px; flex: 0 0 32px; overflow: hidden; }
.shell.is-sidebar-collapsed .team-switcher-logo--brand img { width: auto; height: auto; max-width: 28px; max-height: 28px; filter: none; }
.shell.is-sidebar-collapsed .nav { padding-inline: 0; }
.shell.is-sidebar-collapsed .nav-label,
.shell.is-sidebar-collapsed .nav a > span:not(.nav-icon),
.shell.is-sidebar-collapsed .nav-group-summary > span:not(.nav-icon),
.shell.is-sidebar-collapsed .nav-count,
.shell.is-sidebar-collapsed .team-switcher-copy,
.shell.is-sidebar-collapsed .team-switcher-chevron { display: none; }
.shell.is-sidebar-collapsed .nav-label { height: 0; margin: 0; padding: 0; overflow: hidden; flex: 0 0 0; }
.shell.is-sidebar-collapsed .nav a,
.shell.is-sidebar-collapsed .nav-group-summary { width: 100%; min-width: 0; min-height: 36px; padding: 8px; justify-content: center; box-sizing: border-box; }
.shell.is-sidebar-collapsed .nav-group-items { display: none; }
.shell.is-sidebar-collapsed .nav-group-chevron { display: none; }
.shell.is-sidebar-collapsed .team-switcher-trigger { justify-content: center; padding-inline: 8px; }
.shell.is-sidebar-collapsed .nav-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.shell.is-sidebar-collapsed .team-switcher { padding-inline: 0; }

/* Split login: left illustration + right form, matching the SEANGO mock. */
.login-page { min-height: 100vh; margin: 0; padding: 0; display: block; background: #fff; color: #0f172a; }
.login-shell { width: 100%; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(440px, .88fr); align-items: stretch; overflow: hidden; background: #fff; }
.login-preview { position: relative; min-height: 100vh; overflow: hidden; background: #d7ebff; }
.login-preview-media { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 58% 46%; user-select: none; pointer-events: none; }
.login-preview-video { z-index: 1; }
.login-story { position: relative; z-index: 2; height: 100%; min-height: 100vh; padding: 40px 48px 36px; display: flex; flex-direction: column; }
.login-story-brand { display: inline-flex; width: fit-content; }
.login-story-brand img { display: block; height: 36px; width: auto; max-width: 220px; object-fit: contain; }
.login-story h2 { margin: 42px 0 12px; max-width: 12em; color: #1d4ed8; font-size: clamp(36px, 4vw, 52px); font-weight: 800; line-height: 1.12; letter-spacing: -.04em; }
.login-story p { margin: 0; color: #334155; font-size: 16px; font-weight: 500; letter-spacing: .08em; }
.login-story-rule { display: block; width: 48px; height: 3px; margin-top: 18px; border-radius: 99px; background: #2563eb; }
.login-story-foot { margin-top: auto; color: #64748b; }
.login-story-foot span { display: block; font-size: 13px; letter-spacing: .12em; }
.login-story-foot i { margin: 0 8px; font-style: normal; color: #94a3b8; }
.login-story-foot small { display: block; margin-top: 6px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.login-panel { position: relative; display: grid; place-items: center; padding: 48px 40px 40px; background: #fff; }
.login-corner { position: absolute; top: 28px; right: 40px; margin: 0; text-align: right; color: #94a3b8; font-size: 12px; line-height: 1.45; }
.login-corner strong { display: block; color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.login-panel-inner { width: min(400px, 100%); }
.login-logo { display: flex; justify-content: flex-start; margin-bottom: 36px; }
.login-logo img { display: block; width: auto; height: 40px; max-width: 220px; object-fit: contain; }
.login-heading { display: grid; gap: 8px; margin-bottom: 22px; }
.login-heading h1 { margin: 0; color: #0f172a; font-size: 28px; font-weight: 760; letter-spacing: -.03em; }
.login-heading .login-lead { margin: 0; color: #64748b; font-size: 14px; line-height: 1.5; text-align: left; }
.login-form { padding: 0; display: grid; gap: 14px; }
.login-mode-switch { display: flex; gap: 0; margin-bottom: 6px; padding: 4px; border-radius: 999px; background: #f1f5f9; }
.login-mode-link { flex: 1 1 0; min-height: 40px; display: inline-grid; place-items: center; border-radius: 999px; color: #64748b; font-size: 14px; font-weight: 600; text-decoration: none; }
.login-mode-link.is-active { color: #1d4ed8; background: #fff; box-shadow: 0 6px 16px rgba(15, 23, 42, .08); }
.login-input { position: relative; }
.login-input .input { min-height: 48px; padding: 12px 42px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: none; }
.login-input .input:focus { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.login-input-icon { position: absolute; left: 14px; top: 50%; display: grid; place-items: center; color: #94a3b8; transform: translateY(-50%); pointer-events: none; }
.login-input-action { position: absolute; right: 8px; top: 50%; display: grid; place-items: center; width: 32px; height: 32px; margin: 0; color: #94a3b8; border-radius: 8px; transform: translateY(-50%); pointer-events: none; }
.login-form-links { display: flex; justify-content: flex-end; margin-top: 8px; }
.login-form-links .link { color: #2563eb; font-size: 13px; font-weight: 600; text-decoration: none; }
.login-form .field-hint { margin: 0; }
.login-page .login-submit { width: 100%; min-height: 48px; margin-top: 4px; border: 0; border-radius: 12px; background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff; font-size: 16px; font-weight: 700; box-shadow: 0 10px 20px rgba(37, 99, 235, .28); }
.login-page .login-submit:hover { background: linear-gradient(180deg, #2563eb, #1d4ed8); }
.login-page .login-submit .ui-icon { stroke: #fff; }
.login-notice { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #bbf7d0; border-radius: 12px; background: #ecfdf5; color: #15803d; }
.login-notice-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: #22c55e; color: #fff; }
.login-notice-icon .ui-icon { width: 12px; height: 12px; stroke: #fff; }
.login-foot { margin: 22px 0 0; color: #94a3b8; font-size: 12px; line-height: 1.55; text-align: center; }
.login-preview-dark { display: none; }
.theme-dark .login-preview-light { display: none; }
.theme-dark .login-preview-dark { display: block; }

/* Error screens use the same typography and controls as shadcn-admin. */
.error-page { min-height: 100vh; margin: 0; background: #fff; }
.error-shell { min-height: 100vh; padding: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.error-code { margin: 0; color: var(--ink); font-size: clamp(88px, 12vw, 112px); line-height: 1; font-weight: 700; letter-spacing: -.055em; }
.error-title { margin: 4px 0 0; font-size: 16px; font-weight: 500; }
.error-description { max-width: 440px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.error-actions { display: flex; gap: 16px; margin-top: 24px; }
.error-brand { position: absolute; top: 28px; left: 32px; }
.error-brand img { width: 166px; height: 26px; }

.theme-dark.login-page, .theme-dark .login-shell, .theme-dark .login-panel { background: #fff; }
.theme-dark.error-page { background: #0f172a; }
.theme-dark.login-page .login-heading h1, .theme-dark.login-page .field label { color: #0f172a; }
.theme-dark .error-code, .theme-dark .error-title { color: #f8fafc; }
.theme-dark.login-page .login-logo { width: auto; margin-inline: 0; padding: 0; border-radius: 0; background: transparent; }
.theme-dark .error-brand { padding: 8px 10px; border-radius: 8px; background: #fff; }
.theme-dark, .theme-dark .sidebar { background: var(--sidebar-bg); }
.theme-dark .nav-group-summary,
.theme-dark .nav-group-items a { color: #cbd5e1; }
.theme-dark .nav-group-items a.active,
.theme-dark .nav-group[open] > .nav-group-summary,
.theme-dark .nav-group.is-active > .nav-group-summary { color: #f8fafc; background: #172033; }
.theme-dark .team-switcher-menu { border-color: var(--line); background: #111c2f; }
.theme-dark .team-switcher-copy strong { color: #e2e8f0; }
.theme-dark .app-card { border-color: var(--line); background: #111c2f; }
.theme-dark .app-card-icon, .theme-dark .app-mark { color: #e2e8f0; border-color: var(--line); background: #0f172a; }
.theme-dark .app-card-title a { color: #f8fafc; }
.theme-dark .app-card-status.is-connected { color: #bfdbfe; border-color: #1d4ed8; background: #172554; }
.theme-dark .card, .theme-dark .data-card { border-color: var(--line); }
.theme-dark .row-actions > summary:hover, .theme-dark .row-actions[open] > summary { background: #172033; }
.theme-dark .badge-tone-success, .theme-dark .badge-ready, .theme-dark .badge-online, .theme-dark .badge-enabled, .theme-dark .badge-deal, .theme-dark .badge-maintaining, .theme-dark .badge-done { border-color: #166044; background: rgba(22,135,93,.16); }
.theme-dark .badge-tone-info, .theme-dark .badge-configured, .theme-dark .badge-developing, .theme-dark .badge-intention, .theme-dark .badge-testing, .theme-dark .badge-in-progress { border-color: #1d4ed8; background: rgba(37,99,235,.16); }
.theme-dark .badge-tone-warning, .theme-dark .badge-setup_required, .theme-dark .badge-attention, .theme-dark .badge-paused, .theme-dark .badge-lead, .theme-dark .badge-planning, .theme-dark .badge-todo, .theme-dark .badge-backlog { border-color: #9a4d0a; background: rgba(189,101,11,.16); }
.theme-dark .badge-tone-danger, .theme-dark .badge-disabled, .theme-dark .badge-invalid, .theme-dark .badge-lost, .theme-dark .badge-closed, .theme-dark .badge-canceled, .theme-dark .badge-failed { border-color: #8f242b; background: rgba(189,47,54,.16); }
.theme-dark .badge-tone-neutral, .theme-dark .badge-available { border-color: #475569; background: rgba(100,116,139,.14); }
.theme-dark .role-option:has(input:checked) { border-color: #2563eb; background: #172554; }
.theme-dark .ui-tabs, .theme-dark .progress-track { background: #0f172a; }
.theme-dark .ui-tab { color: #cbd5e1; }
.theme-dark .ui-tab.is-active { color: #f8fafc; border-color: #334155; background: #1e293b; }
.theme-dark .ui-skeleton, .theme-dark .ui-skeleton-block { background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%); background-size: 200% 100%; }
.theme-dark .ui-tab:hover { background: #172033; }
.theme-dark .ui-alert, .theme-dark .avatar-upload { border-color: #334155; background: #0f172a; }
.theme-dark .ui-alert-destructive { border-color: color-mix(in srgb, var(--red) 42%, #334155); background: color-mix(in srgb, var(--red) 14%, #0f172a); }
.theme-dark .ui-alert-destructive > span,
.theme-dark .ui-alert-destructive .ui-alert-title { color: #fca5a5; }
.theme-dark .ui-alert-destructive .ui-alert-description { color: #fecaca; }
.theme-dark .bulk-delete-modal .bulk-confirm-list-dialog { border-color: #334155; background: color-mix(in srgb, var(--secondary) 36%, #0f172a); color: #cbd5e1; }
.theme-dark .activity-icon { color: #e2e8f0; background: #1e293b; }
.theme-dark .ui-area-chart-grid { stroke: rgba(100, 116, 139, .35); }
.theme-dark .ui-area-chart-area-primary { fill: color-mix(in srgb, var(--chart-1) 28%, transparent); }
.theme-dark .ui-area-chart-area-secondary { fill: color-mix(in srgb, var(--chart-2) 20%, transparent); }
.theme-dark .ui-area-chart-line-secondary { stroke: var(--chart-2); }
.theme-dark .public-docs-header { background: rgba(15, 23, 42, .92); }
.theme-dark .dashboard-chart::before { background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), rgba(51,65,85,.65) 25%); }
.theme-dark .workspace::before { display: none; }
.theme-dark .file-input::file-selector-button { color: #e2e8f0; border-color: #334155; background: #111c2f; }
.theme-dark .danger-zone { border-color: #7f1d1d; background: #111c2f; }
.theme-dark .danger-zone[open] > summary { border-color: #7f1d1d; }

@media (max-width: 820px) {
  .login-shell { display: block; }
  .login-panel { min-height: 100vh; padding: 28px 22px; }
  .login-preview { display: none; }
  .login-corner { display: none; }
  .content { padding: 24px 16px 44px; }
  .search-field { flex: 1 1 100%; }
  .list-page-toolbar-row .toolbar form,
  .list-page-toolbar-row .toolbar-inline form { flex-wrap: wrap; }
  .shell { flex-direction: column; gap: 0; padding: 0; }
  .sidebar { position: static; width: 100%; min-width: 0; flex: 0 0 auto; height: auto; max-height: none; top: 0; border-radius: 0; }
  .data-card .table-wrap, .users-list-card .table-wrap, .list-table-section .table-wrap { overflow-x: auto; }
  .toolbar .input, .toolbar-inline form .input { width: 100%; }
  .workspace,
  .workspace-inset { margin: 0; min-height: 100vh; border-radius: 0; box-shadow: none; }
  .workspace::before { display: none; }
  .topbar { border-radius: 0; }
  .app-controls { align-items: stretch; flex-direction: column; }
  .app-controls-main { display: grid; grid-template-columns: 1fr 1fr auto; }
  .app-controls .app-search { width: 100%; grid-column: 1 / -1; }
  .app-controls .app-type { width: 100%; }
  .app-sort-control .select { width: 100%; }
  .app-sort-control { width: 100%; }
  .pagination { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .pagination-state { order: 3; width: 100%; }
}

.list-select-col { width: 40px; min-width: 40px; padding: 8px !important; text-align: center; vertical-align: middle; }
.list-select-col input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--input); border-radius: 999px; background: var(--background); cursor: pointer; vertical-align: middle; box-shadow: var(--shadow-xs); transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.list-select-col input[type="checkbox"]:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--input)); }
.list-select-col input[type="checkbox"]:checked { border-color: var(--primary); background: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 8.2 6.6 10.8 12 5.4' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; background-size: 12px 12px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent); }
.list-select-all { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; vertical-align: middle; }
.list-select-all:hover .list-select-all-box { border-color: var(--primary); }
.list-select-all-box { width: 16px; height: 16px; border: 1px solid var(--input); border-radius: 999px; background: var(--background); box-shadow: var(--shadow-xs); box-sizing: border-box; transition: border-color .15s ease, background .15s ease; }
.list-select-all-box.is-checked { border-color: var(--primary); background: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 8.2 6.6 10.8 12 5.4' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; background-size: 12px 12px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent); }

.config-drawer { position: relative; }
.config-drawer-panel { position: absolute; z-index: 50; top: 44px; right: 0; width: min(340px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--popover); box-shadow: 0 16px 40px rgba(15,23,42,.12); overflow: hidden; }
.theme-settings-panel { display: grid; gap: 14px; padding: 14px 16px 16px; }
.theme-settings-panel-compact { gap: 10px; padding: 12px 14px 14px; }
.theme-settings-head strong { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.theme-settings-head p { margin: 4px 0 0; font-size: 12px; line-height: 1.45; }
.theme-settings-section { display: grid; gap: 8px; padding-top: 2px; }
.theme-settings-section + .theme-settings-section { padding-top: 8px; border-top: 1px solid var(--line); }
.theme-settings-section-head { color: var(--muted-foreground); font-size: 12px; font-weight: 600; }
.theme-settings-segment { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--secondary); }
.theme-settings-segment-wide { max-width: 280px; }
.theme-settings-segment-item { min-height: 32px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--foreground); font-size: 13px; font-weight: 500; transition: background .15s ease, box-shadow .15s ease; }
.theme-settings-segment-item:hover { background: color-mix(in srgb, var(--background) 70%, transparent); }
.theme-settings-segment-item.is-active { color: var(--foreground); background: var(--background); box-shadow: var(--shadow-xs); }
.theme-settings-dots { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.theme-settings-dot { width: 24px; height: 24px; display: inline-flex; border-radius: 999px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(15,23,42,.08); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.theme-settings-dot:hover { transform: scale(1.05); }
.theme-settings-dot.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.theme-settings-dots-labeled { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.theme-settings-dot-item { display: grid; gap: 6px; justify-items: center; padding: 8px 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--background); transition: border-color .15s ease, background .15s ease; }
.theme-settings-dot-item:hover { background: var(--accent); }
.theme-settings-dot-item.is-active { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 55%, var(--background)); }
.theme-settings-dot-item .theme-settings-dot { width: 20px; height: 20px; }
.theme-settings-color-blue .theme-settings-dot,
a.theme-settings-dot.theme-settings-color-blue { background: #2563eb; }
.theme-settings-color-slate .theme-settings-dot,
a.theme-settings-dot.theme-settings-color-slate { background: #475569; }
.theme-settings-color-emerald .theme-settings-dot,
a.theme-settings-dot.theme-settings-color-emerald { background: #059669; }
.theme-settings-color-violet .theme-settings-dot,
a.theme-settings-dot.theme-settings-color-violet { background: #7c3aed; }
.theme-settings-color-orange .theme-settings-dot,
a.theme-settings-dot.theme-settings-color-orange { background: #ea580c; }
.theme-settings-color-black .theme-settings-dot,
a.theme-settings-dot.theme-settings-color-black { background: #18181b; }
.theme-settings-dots-compact { gap: 10px; }
.theme-settings-label { font-size: 11px; font-weight: 500; color: var(--muted-foreground); text-align: center; }
.theme-settings-reset { width: fit-content; max-width: none; }
.theme-settings-reset-link { align-self: flex-start; color: var(--muted-foreground); font-size: 12px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.theme-settings-reset-link:hover { color: var(--foreground); }
.content .lead { font-size: 14px; font-weight: 500; line-height: 1.6; color: var(--muted-foreground); }
.card-head p, .card-description, .metric-hint { font-weight: 500; }
.theme-dark .config-drawer-panel { border-color: var(--line); background: #111c2f; }
.header-icon-button.is-active { border-color: color-mix(in srgb, var(--brand) 28%, var(--border)); color: var(--brand-dark); background: var(--brand-soft); }
.dashboard-chart-full .dashboard-chart-card { min-height: 380px; }
.dashboard-chart-full .dashboard-area-chart { min-height: 340px; padding-inline: 8px 16px; }
.grid.grid-4 { gap: 16px; }
.dashboard-tab-content.grid-4,
.dashboard-analytics-stats { gap: 16px; }
.dashboard-renewal-alerts { gap: 12px; }
.contract-scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.contract-scan-item { display: grid; gap: 10px; }
.contract-scan-preview { display: flex; align-items: center; justify-content: center; min-height: 140px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--secondary); text-decoration: none; color: var(--muted-foreground); }
.contract-scan-preview img { width: 100%; height: 140px; object-fit: cover; }
.contract-scan-preview--doc { flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; }
.contract-scan-meta .muted { margin: 4px 0 0; font-size: 12px; }
.contract-scan-actions { display: flex; justify-content: flex-end; }
.contract-scan-upload { margin: 0 16px 16px; }
.contract-scan-grid--embedded { padding: 0; margin-bottom: 8px; }
.contract-scans-body { padding: 20px 20px 28px; }
.contract-scans .card-head + .card-body { padding-top: 4px; }
.card-head-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.contract-renewal-dialog { width: min(560px, calc(100vw - 32px)); border: 0; padding: 0; }
.contract-renewal-dialog .ui-dialog-body { max-height: min(70vh, 640px); overflow: auto; }
.contract-attachment-upload-dialog { width: min(520px, calc(100vw - 32px)); border: 0; padding: 0; }
.contract-attachment-upload-bar--dialog { margin-top: 4px; }
.contract-index-attachments .link { white-space: nowrap; }
.contract-attachment-list-wrap { margin: 0; }
.contract-scans-body .contract-attachment-list-wrap,
.contract-renewals-body .contract-attachment-list-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.contract-attachment-list-wrap .list-table { margin: 0; }
.contract-attachment-panel { display: grid; gap: 0; min-width: 0; }
.contract-attachment-panel--embedded { gap: 0; }
.contract-attachment-empty { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.contract-attachment-list { table-layout: fixed; width: 100%; }
.contract-attachment-list th:nth-child(1),
.contract-attachment-list td:nth-child(1) { width: 42%; }
.contract-attachment-list th:nth-child(2),
.contract-attachment-list td:nth-child(2) { width: 14%; }
.contract-attachment-list th:nth-child(3),
.contract-attachment-list td:nth-child(3) { width: 28%; }
.contract-attachment-list th:nth-child(4),
.contract-attachment-list td:nth-child(4) { width: 16%; }
.contract-attachment-list .contract-attachment-filename {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
}
.contract-attachment-time { font-size: 12px; color: var(--muted-foreground); }
.contract-attachment-actions { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; width: 100%; }
.contract-attachment-actions .link,
.contract-attachment-actions .link-as-button { font-size: 13px; font-weight: 500; }
.contract-attachment-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.contract-attachment-upload { position: relative; min-width: 0; }
.contract-attachment-upload-bar { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.contract-attachment-upload-hint { flex: 1 1 auto; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contract-attachment-upload-loading { display: none; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted-foreground); }
.contract-attachment-upload.is-uploading .contract-attachment-upload-bar { opacity: .45; pointer-events: none; }
.contract-attachment-upload.is-uploading .contract-attachment-upload-loading { display: inline-flex; }
.contract-attachment-upload-queue { margin: 8px 0 0; }
.ui-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: contract-ui-spin .7s linear infinite;
}
@keyframes contract-ui-spin { to { transform: rotate(360deg); } }
.contract-form.is-uploading { opacity: .72; pointer-events: none; }
.contract-form.is-uploading .form-actions--sticky { opacity: 1; }
.contract-renewals-section { overflow: hidden; }
.contract-renewals-section .card-head { padding-bottom: 4px; }
.contract-renewals-section .card-body { padding-top: 8px; padding-bottom: 28px; }
.contract-renewals-body { padding: 20px 20px 28px; }
.contract-renewals-section .card-head + .contract-renewals-body { padding-top: 4px; }
.contract-renewals-section .contract-renewals-summary-wrap { margin: 0; }
.contract-renewal-summary-table { table-layout: fixed; width: 100%; }
.contract-renewal-summary-table th:nth-child(1),
.contract-renewal-summary-table td:nth-child(1) { width: 14%; }
.contract-renewal-summary-table th:nth-child(2),
.contract-renewal-summary-table td:nth-child(2) { width: 14%; }
.contract-renewal-summary-table th:nth-child(3),
.contract-renewal-summary-table td:nth-child(3) { width: 52%; }
.contract-renewal-summary-table th:nth-child(4),
.contract-renewal-summary-table td:nth-child(4) { width: 20%; }
.contract-renewal-files-table { table-layout: fixed; width: 100%; }
.contract-renewal-file-cell .link { font-size: 13px; font-weight: 500; }
.contract-renewal-table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 12px;
  max-width: 100%;
}
.contract-renewal-table-actions .link,
.contract-renewal-table-actions .link-as-button {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.contract-renewal-remark-text { margin: 0; white-space: pre-wrap; word-break: break-word; }
.contract-renewal-remark-empty { margin: 0; }
.contract-modal-overlay { display: block; }
.contract-modal-backdrop { display: block; position: fixed; inset: 0; z-index: 240; background: rgba(15, 23, 42, .45); cursor: default; }
.contract-modal-panel {
  position: fixed;
  z-index: 241;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.contract-modal-panel-upload { width: min(520px, calc(100vw - 32px)); }
.contract-modal-panel-confirm { width: min(420px, calc(100vw - 32px)); }
.contract-delete-renewal-summary { margin: 0; }
.contract-modal-header {
  position: relative;
  display: block;
  padding: 24px 56px 12px 24px;
  border-bottom: 1px solid var(--line);
}
.contract-modal-header-copy { min-width: 0; }
.contract-modal-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.contract-modal-description { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted-foreground); }
.contract-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--muted-foreground);
  background: transparent;
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
}
.contract-modal-close:hover { color: var(--foreground); background: var(--accent); }
.contract-modal-body { padding: 24px; overflow: auto; }
.contract-modal-body .form-grid { gap: 16px; }
.contract-modal-upload-picker { display: grid; gap: 12px; }
.contract-modal-upload-picker .file-input { width: 100%; max-width: 100%; }
.contract-modal-upload-picker .field-hint { margin: 0; }
.contract-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 24px;
  border-top: 0;
}
.contract-modal-panel .contract-modal-body + .contract-modal-footer {
  padding-top: 0;
}
.contract-attachment-actions .link-as-button {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}
.contract-attachment-inline { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.contract-attachment-inline .link { font-size: 13px; }
.contract-form-attachments { margin-top: -4px; }
.contract-form-attachments .table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.contract-attachments-manage-hint { margin: 12px 0 0; }
.contract-pending-files { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.contract-pending-file { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--secondary); }
.contract-index-attachments { min-width: 56px; vertical-align: middle; }
.contract-form .form-section-title { margin-top: 12px; }
.contract-form .form-section-title + .field,
.contract-form .form-section-title + .contract-form-attachments { margin-top: 4px; }
.contract-form .form-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin-top: 16px;
  padding: 16px 0 4px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px color-mix(in srgb, var(--foreground) 6%, transparent);
}
@media (min-width: 1100px) {
  .dashboard-analytics-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.dashboard-tab-content { gap: 16px; margin-bottom: 16px; }
.dashboard-tab-content .metric.metric-link { gap: 32px; }
.dashboard-tab-content .metric-value { font-size: 38px; line-height: 1.1; font-weight: 900; }
.dashboard-tab-content .metric.metric-link > .metric-hint { display: block; margin-top: 4px; }
.dashboard-page-tabs.ui-tabs { background: var(--secondary); border: 1px solid var(--border); border-radius: 8px; }
.dashboard-page-tabs .ui-tab { font-size: 12px; min-height: 28px; padding: 4px 10px; }
.dashboard-page-tabs .ui-tab.is-active { font-weight: 600; }

/* ---- Shadcn deep polish (chart / table / topbar / inner pages) ---- */

/* Team switcher 与 nav 链接同宽；侧栏左右留白 12px */
.sidebar > .team-switcher,
.sidebar > .nav { padding-inline: 12px; }

.page-head-stack,
.page-head-detail:not(.content-page-head--split) { display: grid; gap: 8px; margin-bottom: 24px; padding-bottom: 0; border-bottom: 0; align-items: stretch; }
.content-page-head.content-page-head--split.page-head-detail { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 24px; }
.page-head-top { display: grid; gap: 6px; min-width: 0; }
.page-head-detail .page-head-top { width: 100%; }
.page-head-row { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; width: 100%; }
.page-head-row h1 { flex: 1 1 auto; min-width: 0; }
.page-head-actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; margin-left: auto; }
.page-head-lead { margin: 0; max-width: none; font-size: 14px; line-height: 1.5; }
.page-head-back { flex-shrink: 0; white-space: nowrap; }

.card.metric:not(.metric-link) { display: flex; flex-direction: column; gap: 0; min-height: auto; padding: 24px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.card.metric:not(.metric-link) > .metric-label { margin: 0 0 24px; padding: 0; color: var(--foreground); font-size: 14px; font-weight: 500; line-height: 1; }
.card.metric:not(.metric-link) > .metric-value,
.card.metric:not(.metric-link) > .metric-slot { margin: 0 0 6px; padding: 0; font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; }
.card.metric:not(.metric-link) > .metric-slot { min-height: 32px; display: flex; align-items: center; }
.card.metric:not(.metric-link) > .metric-hint { display: block; margin: 0; padding: 0; color: var(--muted-foreground); font-size: 12px; font-weight: 500; line-height: 1.4; }
.detail-metrics { margin-bottom: 16px; }

.dashboard-chart-card { border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; min-height: auto; }
.dashboard-chart-card .card-head { padding: 24px 24px 0; border-bottom: 0; align-items: flex-start; }
.dashboard-chart-card .card-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.dashboard-chart-card .card-head p { margin-top: 6px; color: var(--muted-foreground); font-size: 14px; line-height: 1.5; }
.dashboard-chart-card .ui-area-chart { padding: 8px 12px 20px; min-height: 300px; }
.dashboard-chart-full .dashboard-area-chart { min-height: 300px; padding-inline: 8px 12px; }
.ui-area-chart-grid { stroke: var(--border); stroke-width: 1; }
.ui-area-chart-y-label,
.ui-area-chart-x-label { fill: var(--muted-foreground); font-size: 12px; }
.ui-area-chart-legend { padding-left: 24px; padding-bottom: 4px; gap: 20px; }

.users-list-card,
.data-card { overflow: visible; padding: 0; border: 0; border-radius: 8px; background: transparent; box-shadow: none; }
.data-card .list-bulk-form { display: flex; flex-direction: column; margin: 0; padding: 0; gap: 0; }
.data-card .list-bulk-form .table-wrap,
.list-table-section .table-wrap { overflow-x: auto; margin: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--card); }
.data-card .list-table thead tr { border-bottom: 1px solid var(--border); }
.data-card .list-table tbody tr { border-bottom: 1px solid var(--border); }
.data-card .list-table tbody tr:last-child { border-bottom: 0; }
.data-card .list-table tbody tr:has(input[name="ids[]"]:checked),
.data-card .list-table tbody tr.is-row-selected { background: color-mix(in srgb, var(--brand-soft) 72%, var(--card)); }
.list-table-section .list-table tbody tr:has(input[name="ids[]"]:checked) { background: color-mix(in srgb, var(--brand-soft) 72%, var(--card)); }
.data-card .list-table thead th { height: 40px; padding: 0 16px; color: var(--foreground); background: var(--card); font-size: 12px; font-weight: 600; }
.data-card .list-table tbody td { padding: 12px 16px; font-size: 13px; font-weight: 400; color: var(--muted-foreground); }
.data-card .list-table .primary-cell > a,
.data-card .list-table .primary-cell > strong { font-size: 13px; font-weight: 500; color: var(--foreground); }
.data-card td.text-right { overflow: visible; position: relative; }
.data-card .pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.data-card .pagination .pages { margin-left: auto; flex-wrap: wrap; }
.data-card .pagination-total,
.data-card .pagination-state { flex: 0 0 auto; white-space: nowrap; }
.data-card > .table-wrap { margin: 0; border: 1px solid var(--border); border-radius: 6px; overflow-x: auto; max-width: 100%; }
.list-page-stack > .data-card,
.list-page-stack > .list-table-section { min-width: 0; max-width: 100%; }
.data-card .list-table td.text-right,
.list-table-section .list-table td.text-right { overflow: visible; position: relative; }

.row-actions { position: relative; z-index: 2; }
.row-actions > summary { width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 6px; color: var(--foreground); background: transparent; box-shadow: none; }
.row-actions > summary:hover,
.row-actions[open] > summary { color: var(--foreground); background: var(--accent); }
.row-actions-panel { z-index: 80; top: calc(100% + 4px); right: 0; width: auto; min-width: 168px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--popover); box-shadow: var(--shadow-lg); }
.row-actions-panel a,
.row-actions-panel button { padding: 8px 10px; border-radius: 6px; color: var(--foreground); font-size: 14px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.row-actions-panel a:hover,
.row-actions-panel button:hover { color: var(--foreground); background: var(--accent); }
.row-actions-panel .ui-icon { width: 16px; height: 16px; color: var(--muted-foreground); }
.list-table tbody tr:nth-last-child(-n+2) .row-actions-panel { top: auto; bottom: calc(100% + 4px); }

.topbar-actions .header-icon-button { width: 36px; height: 36px; border: 0; border-radius: 999px; color: var(--foreground); background: transparent; box-shadow: none; }
.topbar-actions .header-icon-button:hover { color: var(--foreground); background: var(--accent); }
.topbar-actions .header-icon-button.is-active { color: var(--brand-dark); background: var(--brand-soft); }
.config-drawer > summary.header-icon-button { border-radius: 999px; }
.profile-menu-top > summary { display: inline-flex; align-items: center; padding: 2px; border-radius: 999px; cursor: pointer; }
.profile-menu-top > summary:hover { background: var(--accent); }
.profile-menu-top .avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 999px; }

.docs-hero-banner { margin-bottom: 20px; padding: 28px 32px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%); box-shadow: 0 18px 40px rgba(37,99,235,.18); }
.docs-hero-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .82; }
.docs-hero-copy h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.03em; }
.docs-hero-copy > p { margin: 0 0 16px; opacity: .92; }
.docs-hero-meta { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; line-height: 1.6; }
.docs-hero-meta code { padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.14); }
.docs-tab-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.docs-tab { min-height: 36px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: #fff; font-size: 14px; font-weight: 500; }
.docs-tab.is-active { border-color: #bfdbfe; color: var(--brand-dark); background: var(--brand-soft); }
.docs-handbook-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.docs-handbook-nav { position: sticky; top: 24px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-xs); }
.docs-nav-label { margin: 0 0 10px; padding: 0 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.docs-handbook-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.docs-part-banner { padding: 24px 28px; color: #fff; background: linear-gradient(135deg, #1d4ed8, #2563eb); }
.docs-part-banner-dark { background: linear-gradient(135deg, #0f172a, #1e293b); }
.docs-part-banner h2 { margin: 8px 0 6px; font-size: 24px; letter-spacing: -.02em; }
.docs-part-banner p { margin: 0; opacity: .88; line-height: 1.6; }
.docs-part-tag { display: inline-block; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.docs-section-block { padding: 22px 28px 28px; }
.docs-section-title { margin: 0 0 14px; padding-left: 12px; border-left: 4px solid var(--brand); font-size: 18px; font-weight: 600; }
.public-docs-body { background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 180px, #f8fafc 100%); }
.public-docs-main { width: min(1180px, 100%); margin: 0 auto; padding: 28px 24px 72px; }
.theme-dark .list-select-all-box { background: #0f172a; border-color: #475569; }
.theme-dark .docs-handbook-nav, .theme-dark .docs-handbook-panel { background: #111c2f; border-color: #334155; }
.theme-dark .docs-tab { background: #111c2f; border-color: #334155; color: #e2e8f0; }

@media (max-width: 1180px) {
  .team-switcher-menu { top: calc(100% + 8px); }
}

@media (max-width: 1050px) and (min-width: 601px) {
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-form { grid-template-columns: 1fr; }
  .member-form .field-full, .member-form .form-actions { grid-column: auto; }
  .dashboard-detail-grid { grid-template-columns: 1fr; }
  .dashboard-overview-grid { grid-template-columns: 1fr; }
  .dashboard-analytics-grid { grid-template-columns: 1fr; }
  .docs-handbook-layout { grid-template-columns: 1fr; }
  .docs-handbook-nav { position: static; }
  .api-docs-layout { grid-template-columns: 1fr; }
  .dashboard-reports-grid { grid-template-columns: 1fr; }
  .dashboard-overview-secondary { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .content { padding-inline: 16px; }
  .app-controls-main { grid-template-columns: 1fr auto; }
  .app-grid { grid-template-columns: 1fr; }
  .form-card { padding: 20px; }
  .dashboard-detail-grid { grid-template-columns: 1fr; }
  .dashboard-overview-grid { grid-template-columns: 1fr; }
  .dashboard-analytics-grid { grid-template-columns: 1fr; }
  .api-docs-layout { grid-template-columns: 1fr; }
  .dashboard-reports-grid { grid-template-columns: 1fr; }
  .dashboard-overview-secondary { grid-template-columns: 1fr; }
  .dashboard-chart { padding-inline: 12px; gap: 8px; }
  .form-card .avatar-upload { align-items: flex-start; flex-direction: column; }
  .settings-form .settings-avatar-upload { grid-template-columns: 1fr; justify-items: start; gap: 12px; }
  .danger-zone-panel { align-items: flex-start; flex-direction: column; }
  .pagination-total { display: none; }
  .pagination .pages { width: 100%; overflow-x: auto; }
  .list-page-header-inline { flex-wrap: wrap; }
}

/* SidebarInset — shadcn: m-2 ms-0 rounded-xl shadow-sm; collapsed → ms-2 */
.shell { display: flex; min-height: 100vh; padding: 0; gap: 0; background: var(--sidebar-bg); align-items: stretch; }
.shell > .sidebar { flex: 0 0 256px; width: 256px; min-width: 256px; padding: 8px; border-radius: 0; box-shadow: none; background: var(--sidebar-bg); box-sizing: border-box; position: relative; align-self: stretch; }
.shell > .workspace,
.shell > .workspace-inset { flex: 1 1 auto; min-width: 0; margin: 8px 8px 8px var(--sidebar-inset-gap, 0); min-height: calc(100vh - 16px); overflow: visible; border-radius: 12px; box-shadow: var(--shadow-inset-panel); background: var(--background); }
.shell > .workspace-inset > .topbar { border-bottom: 0; box-shadow: none; background: var(--background); }
.shell > .workspace-inset > .topbar .topbar-trigger { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--foreground); background: var(--background); box-shadow: var(--shadow-xs); cursor: pointer; text-decoration: none; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.shell > .workspace-inset > .topbar .topbar-trigger:hover { color: var(--foreground); border-color: var(--border); background: var(--accent); }
.shell > .workspace-inset > .topbar .topbar-trigger .ui-icon { width: 16px; height: 16px; }
.shell > .workspace-inset > .content { max-width: 80rem; padding: 24px 16px 32px; }
.shell.is-sidebar-collapsed > .sidebar { flex: 0 0 64px; width: 64px; min-width: 64px; padding-inline: 8px; }
.shell.is-sidebar-collapsed > .workspace,
.shell.is-sidebar-collapsed > .workspace-inset { margin: 8px; }

/* Sheet drawer（shadcn Sheet） */
.ui-sheet-drawer { position: relative; display: inline-flex; vertical-align: middle; max-width: 100%; }
.ui-sheet-drawer > summary { list-style: none; cursor: pointer; }
.ui-sheet-drawer > summary::-webkit-details-marker { display: none; }
.ui-sheet-drawer > summary.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.ui-sheet-overlay { display: none; position: fixed; inset: 0; z-index: 220; background: rgba(15, 23, 42, .45); text-decoration: none; }
.ui-sheet-panel { position: fixed; z-index: 221; top: 0; right: 0; width: min(420px, 100vw); height: 100vh; max-height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid var(--border); background: var(--background); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .18s ease; }
.ui-sheet-panel.ui-sheet-panel-wide { width: min(520px, 100vw); }
.ui-sheet-panel.ui-sheet-panel-debug { width: min(600px, 100vw); }
.ui-sheet-drawer[open] .ui-sheet-overlay { display: block; }
.ui-sheet-drawer[open] .ui-sheet-panel { transform: translateX(0); }
.ui-sheet-header { flex-shrink: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 12px; border-bottom: 1px solid var(--line); }
.ui-sheet-header-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ui-sheet-header-title-row strong { font-size: 16px; font-weight: 600; line-height: 1.35; }
.ui-sheet-header-title-row .badge { flex-shrink: 0; }
.ui-sheet-header-status-group { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ui-sheet-header-status-form { margin: 0; display: inline-flex; max-width: 100%; }
.debug-status-select.badge {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 22px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px 12px;
}
.debug-status-select.badge:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.ui-sheet-header-end { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ui-sheet-header-actions { display: flex; align-items: center; gap: 8px; }
.ui-sheet-header-actions .ui-sheet-header-form { margin: 0; }
.ui-sheet-header-copy p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.ui-sheet-close { position: relative; z-index: 222; width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: var(--radius-sm); color: var(--muted-foreground); background: transparent; text-decoration: none; font-size: 20px; line-height: 1; pointer-events: auto; }
.ui-sheet-close:hover { color: var(--foreground); background: var(--accent); }
.ui-sheet-body { min-height: 0; padding: 20px; overflow-y: auto; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
.ui-sheet-footer { flex-shrink: 0; margin-top: auto; padding: 16px 20px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.console-modals-portal > .ui-sheet-drawer { position: fixed; inset: 0; z-index: 220; display: block; max-width: none; pointer-events: none; }
.console-modals-portal > .ui-sheet-drawer[open] .ui-sheet-overlay,
.console-modals-portal > .ui-sheet-drawer[open] .ui-sheet-panel,
.console-modals-portal > .ui-sheet-drawer[open] .ui-sheet-header,
.console-modals-portal > .ui-sheet-drawer[open] .ui-sheet-close,
.console-modals-portal > .ui-sheet-drawer[open] .ui-sheet-body,
.console-modals-portal > .ui-sheet-drawer[open] .ui-sheet-footer { pointer-events: auto; }
.ui-sheet-panel { z-index: 221; }
.member-form:not(:has([name="account_kind"] option[value="debug"]:checked)) [data-debug-project-panel] { display: none !important; }
.ui-sheet-panel.ui-sheet-panel-member { width: min(520px, 100vw); }

/* 行内确认（避免 details 嵌套） */
.ui-alert-inline { display: block; width: 100%; }
.ui-alert-backdrop { display: none; position: fixed; inset: 0; z-index: 240; background: rgba(15, 23, 42, .45); cursor: default; }
.ui-alert-toggle:not(:checked) ~ .ui-alert-dialog-panel { display: none; }
.ui-alert-toggle:checked ~ .ui-alert-backdrop { display: block; }
.ui-alert-toggle:checked ~ .ui-alert-dialog-panel { display: block; position: fixed; z-index: 250; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100vw - 32px)); padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--popover); box-shadow: var(--shadow-lg); }
.ui-alert-toggle:checked ~ .ui-alert-trigger { display: none; }
.ui-alert-dialog-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.ui-alert-dialog-header strong { display: block; font-size: 14px; font-weight: 600; }
.ui-alert-dialog-header p { margin: 6px 0 0; color: var(--muted-foreground); font-size: 13px; line-height: 1.5; }
.row-actions-panel .ui-alert-inline > .ui-alert-trigger { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; color: var(--foreground); background: transparent; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.row-actions-panel .ui-alert-inline > .ui-alert-trigger.row-action-danger { color: var(--red); }
.row-actions-panel .ui-alert-inline > .ui-alert-trigger:hover { background: var(--accent); }

/* Dashboard 分析/报表卡片 */
.dashboard-analytics-card,
.dashboard-reports-wide { overflow: hidden; }
.dashboard-analytics-card-head { padding: 24px 24px 0; border-bottom: 0; align-items: baseline; }
.dashboard-analytics-card--chart .dashboard-analytics-card-head { padding-inline: 16px; }
.dashboard-analytics-card-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.dashboard-analytics-card .card-body { flex: 1 1 auto; display: flex; flex-direction: column; padding-top: 16px; padding-bottom: 20px; overflow: hidden; min-height: 280px; }
.dashboard-analytics-card--chart .card-body { padding-inline: 8px; }
.dashboard-risk-area-chart.ui-area-chart {
  flex: 1 1 auto;
  min-height: 220px;
  margin-top: 0;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dashboard-risk-area-chart .ui-area-chart-svg {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 200px;
  height: auto;
  max-height: 320px;
  overflow: hidden;
}
.dashboard-risk-area-chart .ui-area-chart-legend {
  flex: 0 0 auto;
  margin-top: 10px;
  padding-left: 8px;
  padding-bottom: 0;
}
.dashboard-risk-area-chart .ui-area-chart-y-label { font-size: 10px; }
.dashboard-risk-area-chart .ui-area-chart-x-label { font-size: 10px; }
.field-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.5; }

/* 列表表格 hover（对照 shadcn tasks hover:bg-muted/50） */
.list-table-section .list-table tbody tr { border-bottom: 1px solid var(--border); transition: background-color .15s ease; }
.list-table-section .list-table tbody tr:last-child { border-bottom: 0; }
.list-table-section .list-table tbody tr:hover,
.list-table-section .list-table tbody tr:focus-within { background: color-mix(in srgb, var(--muted-foreground) 5%, var(--card)); }
.list-table-section .list-table tbody td { padding: 12px 16px; }
.list-table-section .list-table thead th { height: 40px; padding: 0 16px; color: var(--muted-foreground); font-size: 13px; font-weight: 500; }
.list-table-section .table-wrap .list-table tbody td { padding: 12px 16px; }
.list-table-section .table-wrap .list-table thead th { padding: 0 16px; }
.list-table-section .row-actions-panel { min-width: 160px; }
.team-switcher-logo:not(.team-switcher-logo--brand) img { width: 100%; height: 100%; object-fit: contain; }
.team-switcher-logo.team-switcher-logo--brand img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; object-position: left center; filter: none; }

/* ── Shadcn alignment polish (final pass: token + micro-detail only) ── */
.button { min-height: 36px; padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-xs); transform: none; transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }
.button:hover { transform: none; }
.button-primary { color: var(--primary-foreground); background: var(--primary); border-color: transparent; box-shadow: var(--shadow-xs); }
.button-primary:hover { background: color-mix(in srgb, var(--primary) 90%, #000); border-color: transparent; transform: none; }
.button-outline,
.button-secondary { border-color: var(--border); background: var(--background); color: var(--foreground); box-shadow: var(--shadow-xs); }
.button-outline:hover,
.button-secondary:hover { background: var(--accent); border-color: var(--border); color: var(--foreground); }
.button-small { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.button .ui-icon { width: 16px; height: 16px; flex-shrink: 0; }
.list-table-toolbar .button,
.list-table-toolbar summary.button { min-height: var(--toolbar-control-height, 32px); padding: 0 12px; font-size: 13px; border-radius: 6px; }
.list-table-toolbar .input,
.list-table-toolbar .select { min-height: var(--toolbar-control-height, 32px); padding: 0 10px; font-size: 13px; }
.input, .select, .textarea { min-height: 36px; padding: 8px 12px; border-radius: 6px; border-color: var(--input); font-size: 14px; line-height: 1.5; background: var(--background); box-shadow: var(--shadow-xs); }
.input::placeholder,
.textarea::placeholder { color: color-mix(in srgb, var(--muted-foreground) 85%, transparent); }
.theme-dark .input,
.theme-dark .select,
.theme-dark .textarea { background: color-mix(in srgb, var(--input) 28%, transparent); }
.card:not(.data-card):not(.toolbar):not(.toolbar-inline) { border-radius: 8px; box-shadow: var(--shadow-sm); }
.card-head { padding: 20px 24px 0; border-color: var(--border); }
.card-body { padding: 20px 24px 24px; }
.ui-label { font-size: 13px; font-weight: 500; color: var(--foreground); }
.field-hint,
.settings-form .field-hint { color: var(--muted-foreground); font-size: 12px; }
.link { color: var(--primary); font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.badge { min-height: 20px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; letter-spacing: 0; }
.ui-icon-button { width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 6px; color: var(--muted-foreground); background: transparent; box-shadow: none; }
.ui-icon-button:hover { color: var(--foreground); background: var(--accent); border-color: transparent; }
.ui-tabs { padding: 3px; border-radius: 8px; background: var(--secondary); color: var(--muted-foreground); }
.ui-tab { min-height: 32px; padding: 4px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.ui-tab.is-active { border-color: transparent; background: var(--background); color: var(--foreground); box-shadow: var(--shadow-xs); font-weight: 500; }
.data-card .list-table tbody td { padding: 12px 8px; }
.data-card .list-table thead th { height: 40px; padding: 0 8px; font-size: 13px; font-weight: 500; color: var(--muted-foreground); letter-spacing: 0; }
.data-card .list-table tbody tr:hover,
.data-card .list-table tbody tr:focus-within { background: color-mix(in srgb, var(--muted-foreground) 5%, var(--card)); }
.list-table .primary-cell > a,
.list-table .primary-cell > strong { font-weight: 500; color: var(--foreground); }
.list-table .primary-cell > a:hover { color: var(--primary); }
.row-actions { position: relative; z-index: 2; }
.row-actions > summary { width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 6px; color: var(--foreground); background: transparent; box-shadow: none; }
.row-actions > summary:hover,
.row-actions[open] > summary { color: var(--foreground); background: var(--accent); }
.row-actions-panel { z-index: 80; top: calc(100% + 4px); right: 0; width: auto; min-width: 168px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--popover); box-shadow: var(--shadow-lg); }
.row-actions-panel a,
.row-actions-panel button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; color: var(--foreground); background: transparent; font-size: 14px; font-weight: 500; text-align: left; }
.row-actions-panel a:hover,
.row-actions-panel button:hover { color: var(--foreground); background: var(--accent); }
.theme-dark .row-actions-panel a:hover,
.theme-dark .row-actions-panel button:hover { background: var(--accent); color: var(--foreground); border-color: transparent; }
.pagination { gap: 8px; color: var(--muted-foreground); }
.pagination-total { font-size: 13px; }
.pagination .button { min-height: 32px; border-radius: 6px; }
.ui-sheet-header,
.ui-sheet-footer { border-color: var(--border); }
.ui-alert-dialog-panel { border-radius: 8px; }
.file-input { font-size: 13px; color: var(--muted-foreground); }
.file-input::file-selector-button { margin-right: 10px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--background); color: var(--foreground); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-xs); cursor: pointer; }
.file-input::file-selector-button:hover { background: var(--accent); }
.settings-form .settings-avatar-upload,
.settings-form .field-avatar-upload { border-color: var(--border); border-radius: 10px; }
.theme-dark .settings-form .settings-avatar-upload,
.theme-dark .settings-form .field-avatar-upload { border-color: var(--border); background: color-mix(in srgb, var(--secondary) 40%, transparent); }
.theme-dark .asset-field-preview { border-color: var(--border); background: var(--secondary); }
.content-page-head { margin-bottom: 24px; }
.empty { padding: 48px 16px; color: var(--muted-foreground); font-size: 14px; }
.muted,
.cell-muted { color: var(--muted-foreground); font-size: 13px; }
.list-table td:not(.list-select-col) input[type="checkbox"] { width: 16px; height: 16px; border-radius: 4px; accent-color: var(--primary); }
.list-create-button { min-height: 36px; padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.list-create-button.button-small,
.page-head-actions .button-small,
.content-page-head-actions .button-small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 6px;
}
.button:focus-visible,
.input:focus-visible,
.select:focus-visible,
.ui-icon-button:focus-visible,
.row-actions > summary:focus-visible { outline: 2px solid color-mix(in srgb, var(--foreground) 20%, transparent); outline-offset: 2px; }

/* Shell chrome — topbar / sidebar / dashboard cards */
.command-trigger { width: auto; min-width: 168px; max-width: 220px; min-height: 36px; padding: 0 10px 0 12px; border-color: var(--border); border-radius: 9999px; color: var(--muted-foreground); background: var(--background); font-size: 13px; box-shadow: none; }
.command-trigger:hover { border-color: color-mix(in srgb, var(--border) 80%, var(--foreground)); color: var(--muted-foreground); background: var(--accent); }
.command-trigger-kbd { border-color: var(--border); color: var(--muted-foreground); background: var(--secondary); }
.command-search-icon { color: inherit; }
.command-panel { top: calc(100% + 6px); padding: 6px; border-color: var(--border); border-radius: 8px; background: var(--popover); box-shadow: var(--shadow-lg); }
.command-heading,
.command-foot { padding: 6px 8px; color: var(--muted-foreground); font-size: 12px; font-weight: 500; }
.command-input { margin-bottom: 4px; padding: 8px 10px; border-color: var(--border); border-radius: 6px; color: var(--muted-foreground); background: var(--secondary); font-size: 13px; }
.command-panel > a { padding: 8px 10px; border-radius: 6px; color: var(--foreground); font-size: 13px; font-weight: 500; }
.command-panel > a:hover { color: var(--foreground); background: var(--accent); }
.command-panel > a small { color: var(--muted-foreground); font-size: 11px; }
.command-divider,
.profile-divider { background: var(--border); }
.header-icon-button { width: 32px; height: 32px; border-radius: 6px; color: var(--foreground); }
.header-icon-button:hover { color: var(--foreground); background: var(--accent); }
.profile-menu-top summary:hover { background: var(--accent); }
.profile-top-name { color: var(--foreground); font-size: 13px; font-weight: 500; }
.profile-panel { padding: 6px; border-color: var(--border); border-radius: 8px; background: var(--popover); box-shadow: var(--shadow-lg); }
.profile-panel a,
.profile-panel button { padding: 8px 10px; border-radius: 6px; color: var(--foreground); font-size: 13px; font-weight: 500; }
.profile-panel a:hover,
.profile-panel button:hover { color: var(--foreground); background: var(--accent); }
.profile-panel-user strong { color: var(--foreground); }
.profile-panel-user small { color: var(--muted-foreground); }
.profile-copy strong { color: var(--foreground); }
.profile-copy span { color: var(--muted-foreground); }
.mobile-nav-panel { border-color: var(--border); border-radius: 8px; background: var(--popover); box-shadow: var(--shadow-lg); }
.mobile-nav-panel a { border-radius: 6px; color: var(--foreground); font-size: 13px; }
.mobile-nav-panel a:hover { color: var(--foreground); background: var(--accent); }
.nav-label { color: var(--muted-foreground); font-size: 12px; font-weight: 500; }
.nav a { color: var(--sidebar-foreground); }
.nav a.active { color: var(--sidebar-foreground); background: var(--sidebar-accent); box-shadow: none; font-weight: 500; }
.nav-group[open] > .nav-group-summary,
.nav-group.is-active > .nav-group-summary { color: var(--sidebar-foreground); background: var(--sidebar-accent); font-weight: 500; box-shadow: none; }
.nav-group-items a.active { color: var(--sidebar-foreground); background: var(--sidebar-accent); font-weight: 500; }
.theme-dark .nav a.active,
.theme-dark .nav-group[open] > .nav-group-summary,
.theme-dark .nav-group.is-active > .nav-group-summary,
.theme-dark .nav-group-items a.active { background: var(--sidebar-accent); color: var(--sidebar-foreground); border-color: transparent; }
.metric,
.card.metric { border-radius: 8px; }
.dashboard-chart-card .card-head,
.dashboard-analytics-card-head { padding: 24px 24px 0; border-bottom: 0; }
.form-card .field > small,
.form-grid .field > small { display: block; margin: 6px 0 0; color: var(--muted-foreground); font-size: 12px; line-height: 1.5; }
.ui-sheet-footer .button-primary { min-height: 36px; padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; color: #fafafa; background: #18181b; border: 1px solid #18181b; box-shadow: var(--shadow-xs); transform: none; }
.ui-sheet-footer .button-primary:hover { color: #fafafa; background: #27272a; border-color: #27272a; transform: none; }
.theme-dark .ui-sheet-footer .button-primary { color: #18181b; background: #fafafa; border-color: #fafafa; }
.theme-dark .ui-sheet-footer .button-primary:hover { color: #18181b; background: #e4e4e7; border-color: #e4e4e7; }
.config-drawer-panel { border-radius: 8px; }
.theme-settings-dot.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }

/* ── 用户定稿 flat 面：polish 不得加回阴影 ── */
.data-card,
.users-list-card,
.list-table-section,
.card.toolbar,
.toolbar,
.toolbar-inline,
.toolbar.card,
.settings-content-section .theme-settings-panel { box-shadow: none; }
.data-card,
.users-list-card { border: 0; border-radius: 0; background: transparent; padding: 0; }
.list-table-toolbar .input,
.list-table-toolbar .select,
.list-table-toolbar .button,
.list-table-toolbar summary.button,
.list-table-toolbar .button-outline,
.list-table-toolbar .button-primary,
.list-page-toolbar-form .input,
.list-page-toolbar-form .select,
.list-page-toolbar-form .button,
.list-page-toolbar-form summary.button,
.list-page-toolbar-form .button-outline,
.list-page-toolbar-form .button-primary,
.input-compact,
.select-compact { box-shadow: none; }
.settings-form .settings-avatar-upload .file-input,
.settings-form .input-readonly,
.command-input-live .input,
.command-input-live .input:focus,
.command-trigger,
.button-ghost,
.button-link,
.row-actions > summary,
.topbar,
.sidebar { box-shadow: none; }
/* SidebarInset 阴影：与 shadcn 一致，直接写在 .shell > .workspace-inset（见 :root --shadow-inset-panel） */
.form-card.card,
.card.metric,
.metric,
.notice,
.app-card { box-shadow: var(--shadow-sm); }
.ui-sheet-panel,
.row-actions-panel,
.command-panel,
.profile-panel,
.team-switcher-menu,
.config-drawer-panel { box-shadow: var(--shadow-lg); }

/* ── 定稿覆盖（须在 polish 层之后）── */

/* SidebarInset：阴影写在元素本身；侧栏勿设 z-index，否则会盖住向左扩散的左缘阴影 */
.shell > main.workspace.workspace-inset,
main.workspace.workspace-inset { box-shadow: var(--shadow-inset-panel); }

/* 列表 / 页头搜索框：为左侧图标留 gutter */
.search-field .input,
.list-table-toolbar .search-field .input,
.list-page-toolbar-form .search-field .input { padding-left: 38px; padding-right: 12px; }

/* 报表页：周期选择与 CSV 导出同一行 */
.dashboard-report-toolbar.toolbar { flex-wrap: nowrap; align-items: center; padding: 12px 16px; gap: 12px 16px; }
.dashboard-report-toolbar .dashboard-period-form,
.dashboard-report-toolbar.toolbar form { width: auto; flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; }
.dashboard-report-toolbar-actions { flex: 0 0 auto; margin-left: auto; white-space: nowrap; }

/* 应用集成等：标题与筛选同一行 */
.content-page-head--split.content-page-head--toolbar { flex-wrap: nowrap; align-items: flex-start; }
.content-page-head--split.content-page-head--toolbar .content-page-head-main { flex: 0 0 auto; }
.content-page-head--split.content-page-head--toolbar .content-page-head-actions { flex: 1 1 auto; min-width: 0; justify-content: flex-end; align-self: center; }
.content-page-head--split.content-page-head--toolbar .list-page-toolbar-form .filter-select,
.content-page-head--split.content-page-head--toolbar .list-page-toolbar-form .list-filter-submit,
.content-page-head--split.content-page-head--toolbar .list-page-toolbar-form .search-field { flex-shrink: 0; }

/* 分析页 mini sparkline */
.dashboard-analytics-card .trend-row .mini-bars,
.trend-row .mini-bars {
  position: relative;
  height: 48px;
  margin-top: 0;
  padding: 0 1px 1px;
  gap: 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  align-items: flex-end;
}
.dashboard-analytics-card .trend-row .mini-bars::after,
.trend-row .mini-bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: color-mix(in srgb, var(--border) 85%, transparent);
  pointer-events: none;
}
.dashboard-analytics-card .trend-row .mini-bars span,
.trend-row .mini-bars span {
  position: relative;
  z-index: 1;
  min-width: 3px;
  max-width: none;
  border-radius: 4px 4px 1px 1px;
  background: color-mix(in srgb, var(--primary) 72%, var(--foreground));
  opacity: .82;
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
}
.trend-row-link:hover .mini-bars span { opacity: 1; background: var(--primary); transform: translateY(-1px); }

/* 30 天风险窗口：分类图标 + 色条 */
.risk-window-row {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}
.risk-window-row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.risk-window-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.risk-window-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 10%, var(--card));
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border));
}
.risk-window-icon .ui-icon { width: 18px; height: 18px; stroke-width: 2; }
.risk-window-copy { flex: 1 1 auto; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.risk-window-label { font-size: 14px; color: var(--foreground); }
.risk-window-value { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.risk-window-bars { height: 44px; padding: 0 2px 2px; gap: 4px; }
.risk-window-row--project .risk-window-icon { color: #2563eb; background: color-mix(in srgb, #2563eb 10%, var(--card)); border-color: color-mix(in srgb, #2563eb 18%, var(--border)); }
.risk-window-row--project .risk-window-bars span { background: color-mix(in srgb, #2563eb 78%, var(--foreground)); }
.risk-window-row--maintenance .risk-window-icon { color: #d97706; background: color-mix(in srgb, #d97706 10%, var(--card)); border-color: color-mix(in srgb, #d97706 18%, var(--border)); }
.risk-window-row--maintenance .risk-window-bars span { background: color-mix(in srgb, #d97706 78%, var(--foreground)); }
.risk-window-row--contract .risk-window-icon { color: #7c3aed; background: color-mix(in srgb, #7c3aed 10%, var(--card)); border-color: color-mix(in srgb, #7c3aed 18%, var(--border)); }
.risk-window-row--contract .risk-window-bars span { background: color-mix(in srgb, #7c3aed 78%, var(--foreground)); }
.risk-window-row--ssl .risk-window-icon { color: #059669; background: color-mix(in srgb, #059669 10%, var(--card)); border-color: color-mix(in srgb, #059669 18%, var(--border)); }
.risk-window-row--ssl .risk-window-bars span { background: color-mix(in srgb, #059669 78%, var(--foreground)); }
.risk-window-row.trend-row-link { color: inherit; text-decoration: none; transition: transform .15s ease; }
.risk-window-row.trend-row-link:hover .risk-window-label { color: var(--brand); }
.risk-window-row.trend-row-link:hover .risk-window-icon { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.risk-window-row.trend-row-link:hover .risk-window-bars span { opacity: 1; transform: translateY(-2px); }

.messages-page-tabs.ui-tabs { margin-bottom: 0; }
.messages-broadcast-stack { display: grid; gap: 24px; }
.messages-list-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.messages-list-head .content-page-head-main { display: grid; gap: 10px; }
.messages-kind-segment { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--secondary); }
.messages-kind-segment-item { position: relative; min-height: 32px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 6px; color: var(--foreground); font-size: 13px; font-weight: 500; transition: background .15s ease, box-shadow .15s ease; }
.messages-kind-segment-item:hover { background: color-mix(in srgb, var(--background) 70%, transparent); }
.messages-kind-segment-item.is-active { color: var(--foreground); background: var(--background); box-shadow: var(--shadow-xs); }
.messages-kind-badge { min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--destructive); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; }
.messages-compose-card .card-head h2,
.messages-sent-card .card-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.messages-compose-card .card-head p,
.messages-sent-card .card-head .lead { margin: 4px 0 0; font-size: 13px; }
.messages-sent-card .card-head.content-page-head--toolbar { align-items: flex-start; gap: 16px; }
.messages-sent-excerpt { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.project-app-bindings-table .project-app-binding-form { margin: 0; }
.project-app-bindings-table { table-layout: fixed; width: 100%; }
.project-app-bindings-table th:nth-child(1),
.project-app-bindings-table td:nth-child(1) { width: 18%; }
.project-app-bindings-table th:nth-child(2),
.project-app-bindings-table td:nth-child(2) { width: 34%; }
.project-app-bindings-table th:nth-child(3),
.project-app-bindings-table td:nth-child(3) { width: 12%; }
.project-app-bindings-table th:nth-child(4),
.project-app-bindings-table td:nth-child(4) { width: 18%; }
.project-app-bindings-table th:nth-child(5),
.project-app-bindings-table td:nth-child(5) { width: 12%; }
.project-app-bindings-table .select { width: 100%; max-width: 100%; min-width: 0; }
.project-app-bindings-foot { margin: 12px 0 0; padding: 0 4px; font-size: 13px; }
.project-app-bind-panel h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.project-app-bind-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.project-app-bind-picker li { margin: 0; }
.dashboard-period-form .select,
.dashboard-period-form .select-compact { width: auto; min-width: 108px; max-width: 132px; min-height: 32px; height: 32px; padding: 0 28px 0 10px; font-size: 13px; }
.dashboard-period-form .button-small { min-height: 32px; }
.dashboard-chart-full .dashboard-area-chart .ui-area-chart-svg { width: 100%; height: auto; min-height: 300px; max-height: 360px; }

.application-detail-page { min-width: 0; }
.application-profiles-section { min-width: 0; max-width: 100%; }
.application-profiles-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.application-profiles-head p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.application-config-field[hidden] { display: none !important; }
.application-profiles-table { table-layout: fixed; width: 100%; }
.application-profiles-table .primary-cell.application-profile-name strong { display: inline; font-weight: 600; }
.application-profiles-table th:nth-child(1),
.application-profiles-table td:nth-child(1) { width: 22%; }
.application-profiles-table th:nth-child(2),
.application-profiles-table td:nth-child(2) { width: 14%; }
.application-profiles-table th:nth-child(3),
.application-profiles-table td:nth-child(3) { width: 14%; }
.application-profiles-table th:nth-child(4),
.application-profiles-table td:nth-child(4) { width: 28%; }
.application-profiles-table th:nth-child(5),
.application-profiles-table td:nth-child(5) { width: 8%; }
.application-profiles-table th:nth-child(6),
.application-profiles-table td:nth-child(6) { width: 10%; }
.application-profile-identity { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.application-profile-status { vertical-align: top; }
.application-profiles-section .empty-state { padding: 24px 0; }
.application-sms-templates-wrap { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.application-sms-templates-table { margin: 0; }
.application-sms-templates-table th:nth-child(1),
.application-sms-templates-table td:nth-child(1) { width: 28%; }
.application-sms-templates-table th:nth-child(2),
.application-sms-templates-table td:nth-child(2) { width: 34%; }
.application-sms-templates-table th:nth-child(3),
.application-sms-templates-table td:nth-child(3) { width: 38%; }
.application-sms-templates-actions { margin-top: 10px; }
.application-sms-default-template { margin-top: 12px; }
.project-notify-api-hints { margin-top: 12px; }
.project-notify-api-hints .code { font-size: 12px; }
.project-notifications-panel .form-section-heading { margin: 0 0 8px; font-size: 14px; }

@media (max-width: 720px) {
  .content-page-head--split.content-page-head--toolbar { flex-wrap: wrap; align-items: flex-start; }
  .content-page-head--split.content-page-head--toolbar .content-page-head-actions { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
  .dashboard-report-toolbar.toolbar { flex-wrap: wrap; }
  .dashboard-report-toolbar-actions { margin-left: 0; width: 100%; }
}

/* KPI / 图表卡：polish 层之后恢复 shadow-sm */
.card:not(.data-card):not(.toolbar):not(.toolbar-inline),
.card.metric,
a.card.metric.metric-link,
.dashboard-chart-card,
.dashboard-analytics-card,
.dashboard-reports-wide,
.form-card.card,
.notice,
.app-card { box-shadow: var(--shadow-sm); }
a.card.metric.metric-link:hover,
.metric-link:hover { box-shadow: var(--shadow-md); }

/* 列表表格：容器（按场景） */
.list-table-section:not(.card) .table-wrap,
.list-table-section:not(.card) .list-bulk-form .table-wrap {
  border-radius: 8px;
  box-shadow: var(--shadow-xs);
}
.list-table-section.card .table-wrap,
.list-table-section.card .list-bulk-form .table-wrap {
  border-radius: 0 0 8px 8px;
  box-shadow: none;
}
.data-card .table-wrap,
.data-card .list-bulk-form .table-wrap,
.card > .table-wrap,
.card-body .table-wrap,
.detail-panel-card .table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  background: var(--card);
}
.card > .table-wrap {
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  box-shadow: none;
}
.detail-panel-card > .card-body .table-wrap {
  border-radius: 8px;
}

/* 列表表格 typography（全局 .table-wrap .list-table） */
.table-wrap .list-table,
.list-bulk-form .table-wrap .list-table {
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.table-wrap .list-table thead th,
.list-bulk-form .table-wrap .list-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--border) 86%, transparent);
}
.table-wrap .list-table thead th.text-right,
.list-bulk-form .table-wrap .list-table thead th.text-right {
  text-align: right;
}
.table-wrap .list-table tbody td,
.list-bulk-form .table-wrap .list-table tbody td {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-foreground);
}
.table-wrap .list-table .primary-cell > a,
.table-wrap .list-table .primary-cell > strong,
.list-bulk-form .table-wrap .list-table .primary-cell > a,
.list-bulk-form .table-wrap .list-table .primary-cell > strong {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--foreground);
}
.table-wrap .list-table .primary-cell > a,
.list-bulk-form .table-wrap .list-table .primary-cell > a {
  text-decoration: none;
  transition: color .12s ease;
}
.table-wrap .list-table .primary-cell > a:hover,
.list-bulk-form .table-wrap .list-table .primary-cell > a:hover {
  color: var(--primary);
}
.table-wrap .list-table .primary-cell .muted,
.table-wrap .list-table .primary-cell > span.muted,
.list-bulk-form .table-wrap .list-table .primary-cell .muted,
.list-bulk-form .table-wrap .list-table .primary-cell > span.muted {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--muted-foreground);
}
.table-wrap .list-table td.muted,
.list-bulk-form .table-wrap .list-table td.muted {
  color: var(--muted-foreground);
}
.table-wrap .list-table td .muted small,
.table-wrap .list-table .primary-cell .muted small {
  font-size: inherit;
}
.table-wrap .list-table tbody td.nowrap,
.list-bulk-form .table-wrap .list-table tbody td.nowrap {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.table-wrap .list-table .code,
.list-bulk-form .table-wrap .list-table .code {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted-foreground);
}
.table-wrap .list-table .badge,
.list-bulk-form .table-wrap .list-table .badge {
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  vertical-align: middle;
}
.table-wrap .list-table tbody td.list-select-col,
.list-bulk-form .table-wrap .list-table tbody td.list-select-col {
  width: 44px;
  padding-inline: 16px 10px;
  text-align: center;
  vertical-align: middle;
}
.table-wrap .list-table thead th.list-select-col,
.list-bulk-form .table-wrap .list-table thead th.list-select-col {
  width: 44px;
  padding-inline: 16px 10px;
  text-align: center;
}
.table-wrap .list-table tbody td.text-right,
.list-bulk-form .table-wrap .list-table tbody td.text-right {
  padding-right: 12px;
  text-align: right;
  vertical-align: middle;
}
.table-wrap .list-table tbody td.list-select-col input[type="checkbox"],
.list-bulk-form .table-wrap .list-table tbody td.list-select-col input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
}
.table-wrap .list-table tbody tr,
.list-bulk-form .table-wrap .list-table tbody tr {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 92%, transparent);
  transition: background-color .12s ease;
}
.table-wrap .list-table tbody tr:last-child,
.list-bulk-form .table-wrap .list-table tbody tr:last-child {
  border-bottom: 0;
}
.table-wrap .list-table tbody tr:hover,
.table-wrap .list-table tbody tr:focus-within,
.list-bulk-form .table-wrap .list-table tbody tr:hover,
.list-bulk-form .table-wrap .list-table tbody tr:focus-within {
  background: color-mix(in srgb, var(--muted-foreground) 3%, var(--card));
}
.table-wrap .list-table tbody tr:has(input[name="ids[]"]:checked),
.list-bulk-form .table-wrap .list-table tbody tr:has(input[name="ids[]"]:checked),
.table-wrap .list-table tbody tr.is-row-selected,
.list-bulk-form .table-wrap .list-table tbody tr.is-row-selected {
  background: color-mix(in srgb, var(--accent) 50%, var(--card));
}
.table-wrap .list-table tbody tr .row-actions > summary,
.list-bulk-form .table-wrap .list-table tbody tr .row-actions > summary {
  opacity: .5;
  transition: opacity .12s ease, background .12s ease;
}
.table-wrap .list-table tbody tr:hover .row-actions > summary,
.table-wrap .list-table tbody tr:focus-within .row-actions > summary,
.table-wrap .list-table tbody tr .row-actions[open] > summary,
.list-bulk-form .table-wrap .list-table tbody tr:hover .row-actions > summary,
.list-bulk-form .table-wrap .list-table tbody tr:focus-within .row-actions > summary,
.list-bulk-form .table-wrap .list-table tbody tr .row-actions[open] > summary {
  opacity: 1;
}
.messages-feed-table td { vertical-align: top; }
.messages-feed-table .primary-cell > strong,
.messages-feed-table td.primary-cell > strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
}

/* 详情页卡片：标题 / 副标题 / 空态 / 内嵌表格 */
.detail-panel-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.detail-panel-card > .card-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  gap: 12px 16px;
}
.detail-panel-card > .card-head.card-head-inline {
  align-items: center;
}
.detail-panel-card > .card-head .card-head-main {
  min-width: 0;
  flex: 1 1 auto;
}
.detail-panel-card > .card-head h2,
.detail-panel-card .detail-panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.35;
  color: var(--foreground);
}
.detail-panel-card > .card-head .card-description,
.detail-panel-card .card-description {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted-foreground);
}
.detail-panel-card > .card-body {
  padding: 20px 24px 24px;
}
.detail-panel-card > .card-head + .card-body {
  padding-top: 16px;
}
.detail-panel-card > .card-body:only-child {
  padding-top: 20px;
}
.card-empty {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted-foreground);
}
.card-empty .link {
  font-weight: 500;
}
.card-body-foot {
  margin-top: 16px;
}
.detail-panel-card .empty.compact-empty {
  padding: 8px 0 4px;
}
.detail-panel-card .empty.compact-empty h3 {
  margin: 8px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}
.detail-panel-card .empty.compact-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.contract-detail-meta {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.contract-detail-meta-card .card-body,
.contract-detail-remark-card .card-body {
  height: 100%;
}
.detail-meta-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.detail-meta-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.detail-meta-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.detail-meta-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  line-height: 1.5;
}
.detail-meta-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.5;
  word-break: break-word;
}
.detail-meta-code {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}
.detail-remark {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.contract-attachment-list thead th {
  padding: 12px 16px 16px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  vertical-align: bottom;
}
.contract-attachment-list tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}
.contract-attachment-list tbody tr:last-child td {
  border-bottom: 0;
}
.contract-renewal-files-table tbody tr.is-renewal-summary td {
  background: color-mix(in srgb, var(--secondary) 72%, var(--card));
}
.contract-renewal-attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.contract-renewal-attachment-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}
.contract-renewal-attachment-list .contract-attachment-filename {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contract-renewal-attachments-cell { vertical-align: top; }
.asset-upload-status.is-error { color: var(--destructive, #dc2626); }
.asset-upload-status.is-success { color: color-mix(in srgb, var(--primary) 82%, var(--foreground)); }
.login-logo img.login-logo-default { filter: none; }
.theme-dark .login-logo img.login-logo-default {
  filter: brightness(0) invert(1);
}
@media (max-width: 900px) {
  .contract-detail-meta {
    grid-template-columns: 1fr;
  }
}
