:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #192641;
  background: #f1f5fa;
  font-size: 16px;
  line-height: 1.5;
  --muted: #53637b;
  --line: #dbe4ef;
  --blue: #2359cf;
  --dark: #101d35;
  --surface: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2.25rem); line-height: 1.22; letter-spacing: -.035em; }
h2 { font-size: 1.08rem; }
a { color: var(--blue); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button {
  border: 1px solid #cbd7e7;
  color: #253957;
  background: #fff;
  border-radius: 8px;
  min-height: 40px;
  padding: 7px 13px;
  cursor: pointer;
  font-weight: 650;
  white-space: nowrap;
  font-size: .9rem;
}
button:hover { background: #edf3fc; border-color: #a7badd; }
button:disabled { cursor: wait; opacity: .58; }
:focus-visible { outline: 3px solid #58a0fa; outline-offset: 3px; }
.primary, .danger { color: white; padding-inline: 17px; }
.primary { background: var(--blue); border-color: var(--blue); }
.primary:hover { background: #1845ad; border-color: #1845ad; }
.danger { background: #ad3040; border-color: #ad3040; }
.danger:hover { background: #8e1d32; border-color: #8e1d32; }
.muted { color: var(--muted); }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 16px;
  background: var(--dark); color: #f7faff;
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.08rem; font-weight: 760; letter-spacing: -.015em; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; background: #3970ec; color: white; font-weight: 800;
}
.sidebar .brand { padding-inline: 8px; margin-bottom: 34px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav button {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 9px 12px;
  min-height: 44px; border-color: transparent; background: transparent; color: #c1cce0;
}
.sidebar nav button span { font-size: 1.22rem; line-height: 1; width: 20px; text-align: center; }
.sidebar nav button:hover, .sidebar nav [aria-current="page"] { color: white; background: #243c67; }
.sidebar nav [aria-current="page"] { box-shadow: inset 3px 0 #719aff; }
.sidebar-footer { margin-top: auto; padding: 16px 8px 0; color: #b9c8de; font-size: .81rem; border-top: 1px solid #30405c; }
.sidebar-dot { display: inline-block; width: 7px; height: 7px; margin-inline-end: 6px; border-radius: 50%; background: #7ba3ff; }
.main-shell { min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; min-height: 64px;
  gap: 16px; padding: 8px 32px; background: white; border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: .93rem; font-weight: 660; }
.operator { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.avatar { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: #e8efff; color: #284fa9; }
.text-button, .link-button, .danger-text {
  color: #2358b8; background: transparent; border-color: transparent;
}
.danger-text { color: #a22b41; }
.main-content { max-width: 1440px; margin-inline: auto; padding: 34px 32px 54px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading p { margin-top: 8px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 21px; }
.metric {
  display: grid; justify-items: start; gap: 6px; text-align: start; padding: 16px 18px;
  min-height: 126px; border: 1px solid var(--line); border-radius: 12px; white-space: normal;
}
.metric strong { font-size: 2rem; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: #182c50; }
.metric small { color: var(--muted); font-size: .82rem; font-weight: 450; }
.panel { background: white; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 18px; overflow: hidden; }
.section-heading, .table-tools { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; min-height: 58px; }
.table-tools { border-bottom: 1px solid var(--line); }
.table-tools input { width: min(100%, 300px); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: start; }
th, td { padding: 12px 17px; text-align: start; vertical-align: middle; }
th { color: #4b5f7a; background: #f7f9fd; white-space: nowrap; font-size: .84rem; font-weight: 650; }
td { border-top: 1px solid #e8edf5; font-size: .9rem; }
.cell-title, .cell-detail { display: block; overflow-wrap: anywhere; }
.cell-detail { margin-top: 3px; color: var(--muted); font-size: .82rem; }
.row-actions { display: flex; gap: 3px; }
.row-actions button { padding-inline: 9px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 30px; padding: 4px 9px; font-size: .82rem; font-weight: 650; background: #ebf0f6; color: #435573; white-space: nowrap; }
.pill span { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.pill.green { background: #e6f5ec; color: #226047; }
.pill.amber { background: #fff2d9; color: #825011; }
.pill.blue { background: #e9f0ff; color: #2850a1; }
.empty { display: grid; place-items: center; min-height: 108px; padding: 20px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); }
.notice, .error { font-size: .9rem; padding: 10px 13px; border-radius: 8px; overflow-wrap: anywhere; }
.notice { border: 1px solid #cbdffb; background: #eaf2ff; color: #19468e; }
.error { border: 1px solid #ffd2d8; background: #fff0f3; color: #94283a; }
#status { margin-bottom: 19px; }
.login-shell {
  display: grid; min-height: 100vh; place-items: center; padding: 22px;
  background: radial-gradient(ellipse at 12% 15%, #e2edff, transparent 54%), #f2f6fc;
}
.login-card { width: min(100%, 460px); padding: clamp(22px, 6vw, 36px); background: white; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 20px 60px #23426912; }
.login-card .brand { margin-bottom: 22px; }
.login-card h1 { font-size: 1.6rem; margin-bottom: 10px; }
.login-card .form, .login-card .notice, .login-card > button { margin-top: 20px; width: 100%; }
.instructions { padding-inline-start: 25px; display: grid; gap: 9px; }
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
label { display: grid; gap: 6px; font-weight: 620; font-size: .89rem; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; color: #192641; background: white; border: 1px solid #c9d6e8; border-radius: 8px; font-weight: 430; }
select {
  appearance: none; padding-inline-end: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #506685 50%), linear-gradient(135deg, #506685 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
textarea { min-height: 95px; resize: vertical; }
dialog { width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 14px; color: #192641; padding: 20px; box-shadow: 0 18px 70px #08132855; }
dialog::backdrop { background: #09163675; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.icon-button { font-size: 1.4rem; padding: 0; width: 36px; min-height: 36px; color: #52657e; border-color: transparent; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 4px; }
@media (max-width: 1030px) {
  .workspace { grid-template-columns: 178px minmax(0, 1fr); }
  .main-content, .topbar { padding-inline: 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .workspace { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; }
  .sidebar .brand { padding-inline: 4px; margin-bottom: 10px; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; padding: 4px; }
  .sidebar nav button { gap: 5px; padding: 6px 8px; font-size: .83rem; min-height: 37px; }
  .sidebar nav button span, .sidebar-footer { display: none; }
  .topbar { min-height: 56px; padding-inline: 14px; }
  .main-content { padding: 20px 13px 34px; }
  .page-heading { align-items: start; gap: 12px; }
  .page-heading p { font-size: .89rem; }
  .metrics { gap: 9px; }
  .metric { padding: 12px; min-height: 105px; }
  th, td { padding-inline: 12px; }
}
