:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #dde4ec;
  --border-strong: #cbd5e1;
  --text: #172033;
  --muted: #64748b;
  --primary: #087f8c;
  --primary-dark: #07646e;
  --primary-soft: #e8f7f8;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --warning: #a15c00;
  --warning-soft: #fff8e6;
  --success: #18794e;
  --success-soft: #edf9f2;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

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

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(8, 127, 140, 0.18);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 12% 10%, rgba(14, 165, 164, 0.2), transparent 35%),
    radial-gradient(circle at 88% 90%, rgba(37, 99, 235, 0.12), transparent 35%),
    #eff5f7;
}

.login-shell {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(15, 50, 60, 0.16);
}

.login-intro {
  min-height: 550px;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  background: linear-gradient(145deg, #073f48, #087f8c 68%, #0f9ca5);
}

.login-intro h1 { margin: 12px 0 20px; max-width: 520px; font-size: clamp(32px, 5vw, 50px); line-height: 1.12; }
.login-intro p { max-width: 560px; margin: 0; color: rgba(255,255,255,.82); font-size: 16px; line-height: 1.8; }
.eyebrow { font-size: 13px !important; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }

.brand-mark {
  width: 50px;
  height: 50px;
  display: inline-grid;
  place-items: center;
  border-radius: 15px;
  color: #073f48;
  background: #d9fbf8;
  font-weight: 900;
  letter-spacing: -.04em;
}

.brand-mark.small { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }

.feature-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.feature-list span { border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 8px 12px; color: rgba(255,255,255,.9); font-size: 13px; }

.login-card { padding: 58px 48px; display: flex; flex-direction: column; justify-content: center; gap: 20px; background: white; }
.login-card h2 { margin: 16px 0 8px; font-size: 28px; }
.login-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.login-card label, .field { display: grid; gap: 8px; }
.login-card label span, .field > span { font-size: 13px; font-weight: 700; color: #334155; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: white;
  color: var(--text);
  padding: 10px 12px;
}

textarea { min-height: 88px; resize: vertical; }

.demo-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff5df;
  color: #8a5700;
  font-size: 12px;
  font-weight: 700;
}

.demo-pill.compact { padding: 5px 9px; }
.form-error { min-height: 20px; color: var(--danger) !important; font-size: 13px; }
.login-note { text-align: center; font-size: 12px !important; }

.original-login-shell {
  width: min(448px, 100%);
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.original-login-card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
}

.original-login-card h1 {
  margin: 16px 0 8px;
  font-size: 25px;
}

.original-login-pill {
  color: #155e75;
  background: #ecfeff;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: #334155;
  background: white;
  font-weight: 700;
  font-size: 13px;
}

.button:hover { background: #f8fafc; }
.button.primary { border-color: var(--primary); background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-dark); }
.button.danger { border-color: #efc2bd; background: var(--danger-soft); color: var(--danger); }
.button.subtle { border-color: rgba(8,127,140,.2); background: rgba(255,255,255,.75); color: var(--primary-dark); }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.full { width: 100%; min-height: 44px; }
.small-button { min-height: 32px; padding: 6px 10px; font-size: 12px; }

.topbar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.topbar-inner { max-width: 1280px; min-height: 62px; margin: 0 auto; padding: 0 26px; display: flex; align-items: center; gap: 24px; }
.brand-button { min-width: 220px; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.brand-button strong, .brand-button small { display: block; }
.brand-button strong { font-size: 14px; }
.brand-button small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.main-nav { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 4px; overflow-x: auto; }
.nav-item { position: relative; min-height: 38px; white-space: nowrap; border: 0; border-radius: 7px; padding: 8px 12px; background: transparent; color: #556276; font-size: 13px; font-weight: 700; }
.nav-item:hover { color: var(--text); background: #f8fafc; }
.nav-item.active { color: #155e75; background: #ecfeff; }
.nav-item.active::after { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.demo-banner { max-width: 1280px; margin: 18px auto 0; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #cce7e8; border-radius: 8px; background: var(--primary-soft); color: #275b62; }
.demo-banner div { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; }
.demo-banner strong { color: #064e57; }

.main-content { max-width: 1280px; min-height: calc(100vh - 140px); margin: 0 auto; padding: 24px 26px 70px; }
.main-content:focus { outline: none; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-header h1 { margin: 0; font-size: 29px; letter-spacing: -.025em; }
.page-header p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.breadcrumb { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: #64748b; font-size: 12px; }
.breadcrumb button { padding: 0; border: 0; color: #0e7490; background: transparent; font-weight: 700; }
.breadcrumb button:hover { color: #155e75; text-decoration: underline; }
.breadcrumb span { color: #94a3b8; }
.breadcrumb strong { color: #64748b; font-weight: 600; }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 22px; }
.subnav button, .subnav span { min-height: 36px; display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 6px; padding: 7px 12px; color: #475569; background: white; font-size: 13px; font-weight: 700; }
.subnav button.active { border-color: #0e7490; color: white; background: #0e7490; }
.subnav span { border-color: var(--border); color: #94a3b8; background: #f1f5f9; }

.grid { display: grid; gap: 16px; }
.grid.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 2px 7px rgba(15,23,42,.035); }
.card-body { padding: 18px; }
.card-header { padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); }
.card-header h2, .card-header h3 { margin: 0; font-size: 15px; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.metric-card { padding: 20px; }
.metric-card .label { color: var(--muted); font-size: 13px; }
.metric-card .value { margin-top: 10px; font-size: 31px; font-weight: 800; letter-spacing: -.03em; }
.metric-card .foot { margin-top: 8px; color: var(--muted); font-size: 12px; }
.metric-card.attention { border-color: #f2d6a0; background: #fffcf4; }

.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.health-column { display: grid; gap: 20px; align-content: start; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.summary-tile { min-height: 118px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--border); border-radius: 7px; text-align: left; }
.summary-tile strong { font-size: 12px; }
.summary-tile .summary-value { margin-top: 8px; font-size: 30px; font-weight: 700; }
.summary-tile small { margin-top: 5px; color: #475569; line-height: 1.5; }
.summary-tile.green { border-color: #86efac; color: #166534; background: #f0fdf4; }
.summary-tile.cyan { border-color: #67e8f9; color: #155e75; background: #ecfeff; }
.summary-tile.amber { border-color: #fcd34d; color: #92400e; background: #fffbeb; }
.summary-tile.red { border-color: #fca5a5; color: #991b1b; background: #fef2f2; }
.summary-tile.slate { border-color: #cbd5e1; color: #334155; background: #f1f5f9; }
.chart-list { display: grid; gap: 14px; }
.chart-row { width: 100%; padding: 4px; border: 0; border-radius: 6px; color: inherit; background: transparent; text-align: left; }
.chart-row:hover { background: #f8fafc; }
.chart-label { display: flex; justify-content: space-between; gap: 12px; color: #334155; font-size: 13px; }
.bar-track { height: 8px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #f1f5f9; }
.bar-fill { height: 100%; min-width: 0; border-radius: inherit; }
.bar-fill.green { background: #16a34a; }
.bar-fill.cyan { background: #0891b2; }
.bar-fill.amber { background: #f59e0b; }
.bar-fill.red { background: #dc2626; }
.bar-fill.slate { background: #94a3b8; }
.donut-layout { display: grid; grid-template-columns: 150px minmax(0,1fr); align-items: center; gap: 16px; }
.donut { width: 144px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; }
.donut-center { width: 80px; height: 80px; display: grid; place-items: center; align-content: center; border-radius: 50%; background: white; box-shadow: 0 2px 7px rgba(15,23,42,.08); }
.donut-center strong { font-size: 24px; }
.donut-center span { color: var(--muted); font-size: 11px; }
.legend { display: grid; gap: 9px; }
.legend button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0; border: 0; color: #334155; background: transparent; font-size: 13px; text-align: left; }
.legend-name { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-dot.green { background: #16a34a; }.legend-dot.cyan { background: #0891b2; }.legend-dot.amber { background: #f59e0b; }.legend-dot.red { background: #dc2626; }.legend-dot.slate { background: #94a3b8; }

.toolbar { margin-bottom: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-box { flex: 1 1 260px; position: relative; }
.search-box input { padding-left: 36px; }
.search-box::before { content: "⌕"; position: absolute; left: 12px; top: 8px; z-index: 1; color: var(--muted); font-size: 19px; }
.toolbar select { width: auto; min-width: 145px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 13px; border-bottom: 1px solid var(--border); color: #64748b; background: #f8fafc; text-align: left; white-space: nowrap; font-size: 12px; }
td { padding: 13px; border-bottom: 1px solid #edf1f5; vertical-align: top; }
tbody tr:hover { background: #fbfdff; }
tbody tr:last-child td { border-bottom: 0; }
.cell-title { font-weight: 700; color: #1e293b; }
.cell-sub { margin-top: 4px; color: var(--muted); font-size: 11px; }
.actions-cell { display: flex; gap: 6px; white-space: nowrap; }
.link-button { padding: 0; border: 0; color: var(--primary-dark); background: transparent; font-size: 12px; font-weight: 700; }
.link-button.danger { color: var(--danger); }

.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; background: #eef2f6; color: #475569; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status.success { background: var(--success-soft); color: var(--success); }
.status.warning { background: var(--warning-soft); color: var(--warning); }
.status.danger { background: var(--danger-soft); color: var(--danger); }
.status.info { background: var(--primary-soft); color: var(--primary-dark); }

.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.quick-action { min-height: 95px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); color: inherit; text-align: left; }
.quick-action:hover { border-color: #a8dadd; background: #f0fbfb; }
.quick-action strong { font-size: 14px; }
.quick-action span { color: var(--muted); font-size: 12px; }

.workbench-header { margin-bottom: 22px; }
.workbench-header p { margin: 0 0 8px; color: #0e7490; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.workbench-header h1 { margin: 0; font-size: 30px; letter-spacing: -.025em; }
.workbench-header div { margin-top: 8px; color: var(--muted); font-size: 14px; }
.workbench-search { margin-bottom: 18px; }
.workbench-search form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.workbench-card { padding: 20px; }
.workbench-section-title { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.workbench-section-title h2 { margin: 0; font-size: 17px; }
.workbench-section-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.workbench-task-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.compact-action { min-height: 66px; justify-content: center; }

.export-note { flex-basis: 100%; margin: 2px 0 0; color: var(--muted); font-size: 11px; text-align: right; }
.range-tabs { margin-bottom: 16px; display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.range-tabs button { margin-bottom: -1px; padding: 10px 18px; border: 0; border-bottom: 2px solid transparent; color: #64748b; background: transparent; font-size: 13px; font-weight: 700; }
.range-tabs button:hover { color: #155e75; background: #f8fafc; }
.range-tabs button.active { border-bottom-color: #0e7490; color: #155e75; }
.filter-card { margin-bottom: 16px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: white; }
.filter-grid { display: grid; gap: 14px; }
.filter-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.filter-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-grid .span-2 { grid-column: span 2; }
.filter-help { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.filter-actions { margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }
.notice { margin: 0 0 16px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; color: #475569; background: #f8fafc; font-size: 12px; line-height: 1.6; }
.warning-notice { border-color: #f2d6a0; color: #8a5700; background: #fffbeb; }
.info-notice { border-color: #bae6fd; color: #155e75; background: #f0f9ff; }
.table-card { overflow: hidden; }
.status-stack { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }

.kit-primary-filter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); gap: 20px; align-items: end; }
.kit-primary-filter fieldset { margin: 0; padding: 0; border: 0; }
.kit-primary-filter legend { color: #334155; font-size: 13px; font-weight: 700; }
.kit-primary-filter fieldset p { margin: 5px 0 9px; color: var(--muted); font-size: 11px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-pills button { min-height: 34px; padding: 7px 11px; border: 1px solid var(--border-strong); border-radius: 999px; color: #475569; background: white; font-size: 12px; font-weight: 700; }
.filter-pills button.active { border-color: #0e7490; color: #155e75; background: #ecfeff; }
.advanced-filter { margin-top: 16px; border-top: 1px solid var(--border); }
.advanced-filter > summary { padding: 14px 0 2px; color: #334155; cursor: pointer; font-size: 13px; font-weight: 700; }
.advanced-filter > summary span { margin-left: 8px; color: var(--muted); font-size: 11px; font-weight: 400; }
.advanced-filter[open] > summary { margin-bottom: 14px; }
.current-view { margin: 0 0 12px; color: #475569; font-size: 12px; }

.event-list { overflow: hidden; }
.event-summary { padding: 17px 18px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; border-bottom: 1px solid #edf1f5; }
.event-summary:last-child { border-bottom: 0; }
.event-summary-body { min-width: 0; }
.event-title { color: #1e293b; font-size: 14px; font-weight: 800; }
.event-target { margin-top: 5px; color: #475569; font-size: 12px; }
.event-summary-body > p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.event-details { margin-top: 10px; color: #475569; font-size: 12px; }
.event-details summary { cursor: pointer; color: #0e7490; font-weight: 700; }
.event-details dl { margin: 10px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px 16px; }
.event-details dl div { min-width: 0; }
.event-details dt { color: var(--muted); font-size: 11px; }
.event-details dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.event-summary-actions { display: flex; gap: 7px; }

.result-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.result-heading h2 { margin: 0; font-size: 16px; }
.result-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.result-heading > span { color: var(--muted); font-size: 12px; }
.search-result-list { margin-top: 10px; display: grid; }
.search-result { padding: 13px 2px; display: grid; gap: 6px; border: 0; border-bottom: 1px solid #edf1f5; color: inherit; background: transparent; text-align: left; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: #f8fafc; }
.search-result > span:not(.status-stack) { color: var(--muted); font-size: 12px; }
.task-nav { margin-top: 0; }
.task-sections { display: grid; gap: 18px; }
.task-card-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.task-card { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.task-card.processing { border-color: #bae6fd; background: #f0f9ff; }
.task-card.asset, .task-card.kit { border-color: #fde68a; background: #fffbeb; }
.task-card p { margin: 6px 0 12px; color: #64748b; font-size: 12px; line-height: 1.6; }

.detail-header { padding-bottom: 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.detail-header h1 { margin: 12px 0 0; font-size: 29px; letter-spacing: -.025em; }
.detail-header p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.back-link { padding: 0; border: 0; color: #0e7490; background: transparent; font-size: 13px; font-weight: 700; }
.back-link:hover { text-decoration: underline; }
.detail-status-row { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 7px; }
.action-panel { margin-top: 18px; padding: 17px; }
.action-panel > .status-stack { margin-top: 13px; }
.detail-section { margin-top: 20px; }
.detail-section > h2 { margin: 0 0 11px; font-size: 16px; }
.detail-grid { margin: 0; display: grid; gap: 9px; }
.detail-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.detail-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.detail-item { padding: 11px 12px; border: 1px solid var(--border); border-radius: 7px; background: white; }
.detail-item dt { color: var(--muted); font-size: 11px; }
.detail-item dd { margin: 5px 0 0; color: #1e293b; font-size: 13px; font-weight: 700; line-height: 1.5; }
.change-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.change-item { padding: 12px; border: 1px solid var(--border); border-radius: 7px; background: white; }
.change-item > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.change-item p { margin: 7px 0 0; color: #475569; font-size: 12px; }
.change-item p:last-child strong { color: #0e7490; }
.detail-footer-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }

.task-list { display: grid; gap: 10px; }
.task-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-muted); }
.task-item strong { display: block; font-size: 13px; }
.task-item span { color: var(--muted); font-size: 12px; }
.count { min-width: 34px; height: 28px; display: inline-grid; place-items: center; border-radius: 999px; background: white; color: var(--primary-dark); font-weight: 800; box-shadow: inset 0 0 0 1px var(--border); }

.empty { padding: 50px 20px; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 7px; color: #334155; }
.section-gap { margin-top: 18px; }
.muted { color: var(--muted); }

.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 12px; bottom: 14px; width: 2px; background: #dce8eb; }
.timeline-item { position: relative; padding: 0 0 22px 42px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: 6px; top: 4px; width: 16px; height: 16px; border: 4px solid #dff5f4; border-radius: 50%; background: var(--primary); }
.timeline-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 13px; }
.timeline-meta { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.timeline-note { margin-top: 8px; padding: 9px 11px; border-radius: 7px; background: #f8fafc; color: #475569; font-size: 12px; }

.modal-root { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .48); }
.modal { width: min(760px, 100%); max-height: min(850px, calc(100vh - 48px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 15px; background: white; box-shadow: var(--shadow); }
.modal.narrow { width: min(520px, 100%); }
.modal-header { padding: 20px 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 20px; }
.modal-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: white; font-size: 18px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-footer { padding: 15px 22px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); background: #fbfcfe; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.field.full { grid-column: 1 / -1; }
.field small { color: var(--muted); font-size: 11px; line-height: 1.5; }

.data-zone { padding: 22px; border: 1px dashed #9fc8cc; border-radius: 12px; background: #f8fdfd; }
.data-zone h3 { margin: 0 0 8px; font-size: 16px; }
.data-zone p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.data-zone .buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.file-input { display: none; }
.data-guide { margin: 16px 0 0; padding-left: 20px; color: #475569; font-size: 13px; line-height: 1.8; }
.data-guide code { padding: 2px 5px; border-radius: 4px; background: #eef2f6; }

.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: grid; gap: 8px; }
.toast { min-width: 240px; max-width: 380px; padding: 13px 15px; border: 1px solid #c7e3df; border-radius: 9px; background: #f1fbf8; color: #175d4a; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .22s ease-out; }
.toast.error { border-color: #efc2bd; background: var(--danger-soft); color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1040px) {
  .grid.metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .quick-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .health-grid { grid-template-columns: 1fr; }
  .filter-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench-task-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-grid.three, .change-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .login-screen { padding: 14px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: auto; padding: 34px 26px; }
  .login-intro h1 { font-size: 31px; }
  .feature-list { display: none; }
  .login-card { padding: 32px 26px; }
  .topbar-inner { flex-wrap: wrap; gap: 8px 18px; padding-top: 10px; padding-bottom: 10px; }
  .main-nav { order: 3; width: 100%; min-height: 42px; justify-content: flex-start; }
  .nav-item { padding: 8px 12px; }
  .topbar-inner, .demo-banner, .main-content { padding-left: 16px; padding-right: 16px; }
  .brand-button { min-width: 0; flex: 1; }
  .topbar-actions .demo-pill { display: none; }
  .demo-banner { margin: 12px 12px 0; align-items: flex-start; flex-direction: column; }
  .page-header { align-items: stretch; flex-direction: column; }
  .header-actions { justify-content: flex-start; }
  .grid.metrics, .grid.two, .grid.three, .quick-actions { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .donut-layout { grid-template-columns: 1fr; }
  .donut { margin: 0 auto; }
  .form-grid { grid-template-columns: 1fr; }
  .workbench-search form, .workbench-task-grid, .kit-primary-filter, .filter-grid.six, .filter-grid.four, .filter-grid.three { grid-template-columns: 1fr; }
  .filter-grid .span-2 { grid-column: auto; }
  .filter-actions { justify-content: flex-start; }
  .event-summary { grid-template-columns: 1fr; }
  .event-summary-actions { justify-content: flex-start; }
  .event-details dl { grid-template-columns: 1fr; }
  .task-card-grid, .detail-grid.three, .detail-grid.two, .change-grid { grid-template-columns: 1fr; }
  .detail-header { flex-direction: column; }
  .field.full { grid-column: auto; }
  .modal-root { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
}
