:root {
  color-scheme: light;
  --ink: #172e2a;
  --muted: #61736e;
  --soft: #85948f;
  --line: #dce6e1;
  --canvas: #f4f7f5;
  --surface: #fff;
  --green: #22634f;
  --deep: #194d40;
  --wash: #e8f4ed;
  --sidebar: #142e28;
  --shadow: 0 1px 2px rgba(19, 52, 42, .05);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .53; }
a { color: var(--green); }
:focus-visible { outline: 2px solid #237f63; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 3vw, 36px); line-height: 1.22; letter-spacing: -.035em; }
h2 { font-size: 17px; line-height: 1.35; letter-spacing: -.012em; }
h3 { font-size: 14px; line-height: 1.4; }
p { line-height: 1.65; }
small { color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  border: 1px solid #ccdcd4; border-radius: 8px; padding: 9px 11px;
  color: var(--ink); background: #fff; min-height: 38px; width: 100%;
}
input[type=checkbox], input[type=radio] { accent-color: var(--green); }
textarea { min-height: 88px; resize: vertical; }
select { padding-right: 25px; }
::placeholder { color: #728680; }
[hidden] { display: none !important; }

.shell { min-height: 100dvh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  padding: 24px 14px 17px; background: var(--sidebar); color: #ecf5ee; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 11px 30px; }
.brand-mark {
  flex: 0 0 37px; height: 37px; border-radius: 10px; display: grid; place-items: center;
  background: #d9f0bc; color: #1d462f; font-size: 26px; line-height: 1; font-weight: 650;
}
.brand-name { font-size: 19px; font-weight: 750; line-height: 1.08; }
.brand-detail { color: #adcbc0; margin-top: 4px; font-size: 11px; letter-spacing: .055em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-link {
  display: flex; width: 100%; align-items: center; gap: 11px; text-align: left;
  background: none; border: 1px solid transparent; border-radius: 9px; color: #d5e5db;
  padding: 11px 11px; min-height: 43px; font-weight: 520;
}
.nav-link:hover { background: #203e35; }
.nav-link.active { background: #295143; color: #f6fbf4; border-color: #3d6b58; font-weight: 650; }
.nav-link .icon { color: #abc9bc; }
.nav-link.active .icon { color: #d9f0bc; }
.nav-link .nav-arrow { margin-left: auto; color: #a2c4b6; font-size: 16px; }
.sidebar-foot { margin-top: auto; padding-top: 22px; }
.sidebar-rule { border-top: 1px solid #365047; margin: 0 9px 10px; }
.environment { display: flex; align-items: center; gap: 7px; color: #bfd5c8; padding: 12px 11px 4px; font-size: 11px; letter-spacing: .05em; }
.dot { display: inline-block; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #a6d784; }
.topbar {
  height: 66px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 30px;
}
.top-context, .top-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-context label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-context label > span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.top-context select { max-width: 218px; background: #f6faf7; border-color: #e0eae4; min-height: 34px; font-weight: 600; }
.top-actions { justify-content: flex-end; }
.top-actions .button { min-height: 34px; padding: 6px 9px; white-space: nowrap; }
.top-date { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); white-space: nowrap; }
.top-user { display: inline-flex; align-items: center; gap: 7px; }
.user-avatar { display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: #e1f0e7; color: var(--deep); font-weight: 700; }
.icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: var(--icon-size); height: var(--icon-size); font-size: var(--icon-size); line-height: 1; font-family: system-ui, sans-serif; }
.mobile-menu, .drawer-close, .drawer-scrim { display: none; }
.main { width: 100%; max-width: 1650px; margin: 0 auto; padding: 31px 31px 55px; outline: none; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.page-header p { margin-top: 8px; font-size: 13px; color: var(--muted); max-width: 680px; }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 560; margin-bottom: 9px; }
.eyebrow button { border: 0; background: transparent; padding: 0; color: var(--green); }
.page-actions, .page-meta, .inline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.page-actions { flex-shrink: 0; justify-content: flex-end; }
.page-meta { margin-top: 11px; color: var(--muted); font-size: 12px; }
.page-tabs {
  display: flex; overflow: auto; gap: 4px; align-items: center; margin-bottom: 18px;
  background: #fff; padding: 5px; border: 1px solid var(--line); border-radius: 11px;
}
.page-tabs button {
  background: none; border: 1px solid transparent; border-radius: 7px; color: var(--muted);
  font-size: 13px; font-weight: 570; padding: 8px 15px; flex: 0 0 auto; min-height: 36px;
}
.page-tabs button:hover { background: #f3f7f4; color: var(--ink); }
.page-tabs button.active { background: var(--wash); color: var(--deep); border-color: #d9ecdf; font-weight: 700; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px;
  border: 1px solid transparent; border-radius: 8px; padding: 8px 13px;
  font-weight: 640; font-size: 13px; line-height: 1.25; text-decoration: none;
}
.button-primary { background: var(--green); color: #fff; border-color: var(--green); box-shadow: var(--shadow); }
.button-primary:hover:not(:disabled) { background: var(--deep); }
.button-secondary { background: #fff; border-color: #d1dfd7; color: var(--ink); box-shadow: var(--shadow); }
.button-secondary:hover:not(:disabled) { background: #f0f7f2; border-color: #b5d3c3; }
.button-ghost { background: none; color: var(--green); }
.button-ghost:hover:not(:disabled) { background: #edf5ef; }
.button-danger { background: #ad402e; color: #fff; }
.button-danger:hover:not(:disabled) { background: #8c2f22; }
.text-link { border: 0; background: none; color: var(--green); font-weight: 680; padding: 2px 0; text-align: left; }
.text-link:hover { text-decoration: underline; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 3px 8px;
  border: 1px solid transparent; border-radius: 20px; font-size: 11px; line-height: 1.25; font-weight: 640;
}
.badge::before { content: ""; background: currentColor; opacity: .65; width: 5px; height: 5px; border-radius: 50%; }
.badge-neutral { background: #eef2ef; color: #4d655b; border-color: #e3ebe5; }
.badge-teal { background: #e5f4e9; color: #23664d; border-color: #d7eddf; }
.badge-blue { background: #eaf2fa; color: #305e86; border-color: #dce8f4; }
.badge-amber { background: #fff3df; color: #875718; border-color: #f5e6c9; }
.badge-red { background: #fbecea; color: #9e4537; border-color: #f5dad6; }

.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 13px; min-width: 0; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 17px 19px 0; }
.panel-header p { margin-top: 4px; font-size: 12px; color: var(--muted); }
.panel-body { min-width: 0; padding: 16px 19px 19px; }
.panel + .panel { margin-top: 15px; }
.stack { display: flex; flex-direction: column; gap: 15px; }
.stack > .panel + .panel, .grid-2 > .panel + .panel, .grid-3 > .panel + .panel { margin-top: 0; }
.grid-2, .grid-3, .form-grid { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.strong { font-weight: 660; }
.muted { color: var(--muted); }
.subtle { background: #f6faf7; border: 1px solid #e4eee7; border-radius: 9px; padding: 11px 12px; }
.callout { background: #eaf5ee; border: 1px solid #d3e8da; border-radius: 10px; padding: 11px 14px; color: #275641; line-height: 1.6; }
.callout.amber { background: #fff7e8; border-color: #f0dfbb; color: #794f15; }
.callout.red { background: #fcf0ed; border-color: #f1d6d0; color: #8f392d; }
.callout.blue { background: #edf4fb; border-color: #dae7f4; color: #315674; }
.table-wrap { overflow: auto; border: 1px solid #e2ebe5; border-radius: 9px; }
table { border-collapse: collapse; width: 100%; min-width: 435px; font-size: 13px; text-align: left; }
th, td { padding: 11px 12px; border-bottom: 1px solid #e9efeb; vertical-align: middle; }
th { background: #f4f8f5; color: #527067; font-size: 11px; font-weight: 680; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfdfc; }
td small { display: block; margin-top: 2px; font-size: 11px; }
.field { display: grid; gap: 6px; margin: 0; min-width: 0; align-content: start; }
.field > span { font-weight: 650; font-size: 12px; color: #3b564d; }
.field > small { font-size: 11px; line-height: 1.5; }
.field-full { grid-column: 1 / -1; }
.empty { text-align: center; display: grid; justify-items: center; gap: 8px; min-height: 140px; align-content: center; padding: 23px; }
.empty-icon { border-radius: 12px; width: 41px; height: 41px; display: grid; place-items: center; color: #527669; background: #eaf3ed; }
.empty p { color: var(--muted); font-size: 13px; max-width: 440px; }
.history { list-style: none; padding: 0 0 0 12px; margin: 0; }
.history li { border-left: 1px solid #dbe9df; padding: 0 0 15px 16px; position: relative; }
.history li::before { position: absolute; content: ""; width: 7px; height: 7px; background: #64a18a; border-radius: 50%; top: 5px; left: -4px; }
.history li:last-child { padding-bottom: 0; }
.history strong { font-size: 13px; }
.history time, .history p { color: var(--muted); font-size: 12px; }
.history p { margin-top: 4px; }

.workbench-top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 22px;
  margin-bottom: 16px; border: 1px solid #d8e8d9; border-radius: 13px; background: linear-gradient(105deg, #e8f4e9, #edf4e0);
}
.workbench-top h2 { font-size: 19px; margin-bottom: 5px; }
.workbench-top p { color: #4d6959; font-size: 13px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.kpi {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  min-height: 106px; gap: 10px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 14px 16px; box-shadow: var(--shadow);
}
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi strong { color: var(--ink); font-weight: 700; font-size: 29px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.kpi .icon { color: #508371; background: #eaf3ed; width: 25px; height: 25px; border-radius: 7px; }
.queue { display: grid; gap: 9px; }
.queue-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 9px; background: #f6faf7; border: 1px solid #e5eee7; }
.queue-item p { color: var(--muted); font-size: 12px; }
.workbench-columns { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(275px, .9fr); gap: 15px; }
.workbench-columns .panel + .panel { margin-top: 0; }
.code { font-variant-numeric: tabular-nums; font-size: 12px; letter-spacing: .02em; }

dialog { width: min(590px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); margin: auto; color: var(--ink);
  border: 1px solid var(--line); border-radius: 15px; padding: 0; box-shadow: 0 18px 75px #142e2838; }
dialog::backdrop { background: #10282172; }
.modal-header { padding: 19px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 20px; }
.modal-header p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.modal-header .button { margin: -3px -7px 0 0; align-self: start; }
.modal-body { padding: 19px 22px; display: grid; gap: 13px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 22px; border-top: 1px solid var(--line); background: #f8faf8; }
.modal-error { margin: 0 22px 14px; }
#toast { position: fixed; bottom: 25px; right: 24px; z-index: 10; max-width: min(430px, calc(100% - 48px)); }
.toast-message { color: #fff; background: #183d32; border: 1px solid #375e4e; box-shadow: 0 8px 25px #19362a26; border-radius: 10px; padding: 11px 16px; line-height: 1.5; }
.toast-message.error { background: #8f392d; border-color: #a74a3b; }

.login-shell {
  min-height: 100dvh; display: grid; grid-template-columns: minmax(300px, .95fr) minmax(340px, 1fr);
  background: #f4f7f5;
}
.login-brand {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(29px, 8vw, 120px); color: #f2f8f0; background: #15372e;
}
.login-brand::after {
  content: ""; z-index: -1; position: absolute; width: 42vw; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid #548371; right: -20vw; bottom: -22vw; box-shadow: 0 0 0 5vw #284c3f, 0 0 0 10vw #204338;
}
.login-wordmark { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; font-size: 22px; }
.login-wordmark .brand-mark { width: 37px; }
.login-brand h1 { font-size: clamp(30px, 4vw, 54px); }
.login-brand p { margin-top: 12px; color: #bcd5c9; }
.login-environment { display: inline-flex; align-items: center; align-self: flex-start; gap: 8px; margin-top: 29px; color: #d5e6db; font-size: 12px; }
.login-panel { display: grid; align-items: center; justify-items: center; padding: 27px; }
.login-panel form { display: grid; gap: 14px; width: min(100%, 390px); padding: 27px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.login-panel h2 { font-size: 25px; }
.login-panel p { color: var(--muted); margin: -7px 0 5px; }
.login-panel .button { margin-top: 6px; }

@media (max-width: 1120px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .topbar { padding: 0 20px; }
  .main { padding: 26px 22px 46px; }
  .top-date, .top-context label > span { display: none; }
  .workbench-columns { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .mobile-menu { display: block; flex: 0 0 auto; }
  .mobile-menu .button { padding: 6px; gap: 5px; white-space: nowrap; }
  .sidebar { position: fixed; z-index: 8; width: 215px; height: 100dvh; display: none; }
  .sidebar.open { display: flex; }
  .drawer-close { display: block; margin: 0 0 10px auto; color: #d5e5db; }
  .drawer-close:hover:not(:disabled) { background: #203e35; }
  .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 7; border: 0; background: #19362a6a; }
  .topbar { height: 57px; padding: 0 12px; }
  .top-context, .top-actions { gap: 6px; }
  .top-context { flex: 1 1 auto; }
  .top-actions { flex-shrink: 0; }
  .top-context select { max-width: 160px; }
  .main { padding: 19px 15px 40px; }
  .page-header { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 700px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-brand { padding: 25px 27px 28px; }
  .login-wordmark, .login-environment { margin: 0 0 12px; }
  .login-environment { margin: 16px 0 0; }
  .login-panel { align-items: start; }
  .top-actions .role-name { display: none; }
  .top-context select { font-size: 12px; }
}
@media (max-width: 560px) {
  .top-context .site-context, .top-actions .optional-action { display: none; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .workbench-top { align-items: flex-start; flex-direction: column; }
  .panel-header, .panel-body { padding-left: 12px; padding-right: 12px; }
  .page-actions { justify-content: flex-start; flex-shrink: 1; }
}
