:root {
  --navy: #11243e;
  --navy-soft: #1b3558;
  --blue: #1f65d6;
  --blue-soft: #eaf2ff;
  --ink: #172033;
  --muted: #667085;
  --line: #e7eaf0;
  --surface: #fff;
  --canvas: #f5f7fb;
  --danger: #d92d20;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
label { display: grid; gap: 7px; margin-bottom: 16px; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #cfd5df; border-radius: 8px; color: var(--ink); background: white; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgb(31 101 214 / 12%); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; color: #dce7f7; background: var(--navy); display: flex; flex-direction: column; }
.brand, .user-chip { display: flex; gap: 12px; align-items: center; }
.brand { padding: 0 10px 24px; color: white; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--navy); background: white; font-weight: 800; }
.brand strong, .brand small, .user-chip strong, .user-chip small { display: block; }
.brand small, .user-chip small { margin-top: 2px; color: #9eb0c9; font-size: 12px; }
nav { display: grid; gap: 5px; }
.nav-item { padding: 11px 12px; border-radius: 8px; font-size: 14px; }
.nav-item:hover { color: white; background: rgb(255 255 255 / 8%); }
.sidebar-footer { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid #2a4263; }
.user-chip { margin-bottom: 12px; font-size: 13px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: white; background: #2f6fce; font-weight: 700; }
.link-button { padding: 0; border: 0; color: #a9b8cd; background: transparent; cursor: pointer; }
.main-content { min-width: 0; padding: 34px 40px 56px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: 13px; font-weight: 700; }
h1 { margin: 0; font-size: 28px; }
h2 { margin: 0 0 18px; font-size: 17px; }
.page-subtitle, .help-text { color: var(--muted); }
.page-subtitle { margin: 8px 0 0; }
.help-text { font-size: 12px; line-height: 1.6; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 17px; border-radius: 8px; cursor: pointer; font-weight: 700; }
.primary-button { border: 0; color: white; background: var(--blue); }
.secondary-button { border: 1px solid #cfd5df; background: white; }
.full { width: 100%; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.metric-card { min-height: 116px; padding: 18px; }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin-top: 10px; font-size: 30px; }
.metric-card.urgent { border-color: #ffd5d2; background: #fff1f0; }
.metric-card.urgent strong { color: var(--danger); }
.panel { min-width: 0; padding: 22px; }
.panel + .panel { margin-top: 18px; }
.panel-heading { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .panel-heading p { margin: 0; }
.panel-heading p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.work-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.work-row strong, .work-row small { display: block; }
.work-row small, .work-row time, td small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.empty-state { padding: 54px 12px; text-align: center; }
.toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 10px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th { color: var(--muted); white-space: nowrap; }
.data-table td small { display: block; }
.table-link { color: var(--blue); font-weight: 700; }
.empty-cell { padding: 40px !important; color: var(--muted); text-align: center !important; }
.pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 700; }
.form-panel { max-width: 960px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.key-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.key-grid div { padding: 12px; border-radius: 8px; background: #f8faff; }
.key-grid span, .key-grid strong { display: block; }
.key-grid span { color: var(--muted); font-size: 12px; }
.key-grid strong { margin-top: 5px; }
.timeline { margin: 0; padding-left: 22px; }
.timeline li { padding: 0 0 20px 8px; }
.timeline time, .timeline strong, .timeline small { display: block; }
.timeline time, .timeline small { color: var(--muted); font-size: 12px; }
.timeline strong { margin-top: 5px; }
.message { margin-bottom: 16px; padding: 12px 14px; border-radius: 8px; background: var(--blue-soft); }
.message.error { color: #8f1912; background: #fff1f0; }
.auth-page { min-height: 100vh; background: linear-gradient(135deg, #eef4fc, #f8f9fb 55%, #edf1f7); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 430px); padding: 34px; border: 1px solid rgb(17 36 62 / 8%); border-radius: 16px; background: white; box-shadow: 0 18px 55px rgb(17 36 62 / 10%); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-brand .brand-mark { color: white; background: var(--navy); }
.auth-card h1 { font-size: 23px; }
.auth-card .intro { margin-bottom: 24px; color: var(--muted); }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .sidebar-footer { margin-top: 18px; }
  .detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .main-content { padding: 24px 18px 40px; }
  .page-header { flex-direction: column; }
  .metric-grid, .form-grid, .key-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
}
