/* Shared light theme for the shell, data tables, forms and dialogs. */
:root {
  color-scheme: light;
  --td-brand-color: #0052d9;
  --td-brand-color-hover: #366ef4;
  --td-brand-color-active: #003cab;
  --td-brand-color-light: #ecf2fe;
  --td-bg-color-page: #f3f3f3;
  --td-bg-color-container: #fff;
  --td-bg-color-secondarycontainer: #f3f3f3;
  --td-bg-color-container-hover: #f3f3f3;
  --td-component-stroke: #dcdcdc;
  --td-component-border: #e7e7e7;
  --td-text-color-primary: #1d2129;
  --td-text-color-secondary: #595f69;
  --td-text-color-placeholder: #767c85;
  --td-success-color: #008858;
  --td-warning-color: #a65700;
  --td-error-color: #c9353f;
  --ink: var(--td-text-color-primary);
  --text: var(--td-text-color-primary);
  --muted: var(--td-text-color-secondary);
  --line: var(--td-component-border);
  --rail: 224px;
  --header-height: 56px;
  --radius: 6px;
  font: 14px/1.6 Inter, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--td-bg-color-page);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box }
html, body { margin: 0; min-height: 100% }
body { background: var(--td-bg-color-page) }
button, input, select, textarea { font: inherit }
button, a, select { touch-action: manipulation }
button { cursor: pointer; color: inherit }
button:disabled { cursor: default; opacity: .55 }
a { color: var(--td-brand-color); text-decoration: none }
a:hover { color: var(--td-brand-color-hover) }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--td-brand-color);
  outline-offset: 2px;
}
::selection { background: #c6d9ff }
h1, h2, h3, p { margin-top: 0 }
h1, h2, h3, strong, b { color: var(--ink) }
h1 { font-size: 24px; line-height: 1.45; font-weight: 620 }
h2 { margin: 0; font-size: 17px; line-height: 1.5; font-weight: 600 }
h3 { margin: 16px 0 8px; font-size: 15px; font-weight: 600 }
small, .muted { color: var(--muted) }
.icon { display: inline-block; vertical-align: middle; flex: none }
input, select, textarea {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--td-component-stroke);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  line-height: 20px;
  padding: 5px 10px;
}
input:not([type=checkbox]):not([type=radio]), select { min-height: 32px }
textarea { resize: vertical }
input:hover, select:hover, textarea:hover { border-color: #a6a6a6 }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--td-brand-color);
  box-shadow: 0 0 0 2px #0052d922;
}
input::placeholder, textarea::placeholder { color: var(--td-text-color-placeholder) }
input[type=checkbox], input[type=radio] { accent-color: var(--td-brand-color) }
select { cursor: pointer }
select[multiple] { cursor: default }
input[type=file] { padding: 3px 6px }
input::file-selector-button {
  margin-right: 8px; padding: 3px 9px;
  border: 0; border-radius: 3px; background: #eff2f7; color: #373e4b;
  font: inherit; cursor: pointer;
}

/* Fixed header and collapsible navigation. */
.topbar {
  position: fixed; z-index: 22; inset: 0 0 auto; height: var(--header-height);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 26px 0 22px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.top-left, .top-tools, .brand, .top-account, .search-toggle, .breadcrumb {
  display: flex; align-items: center;
}
.top-left { min-width: 0; gap: 6px }
.brand { min-width: 0; gap: 11px; color: var(--ink) }
.brand:hover { color: var(--ink) }
.brand-symbol {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px;
  border-radius: 7px; background: var(--td-brand-color); color: #fff;
}
.brand-symbol .icon { stroke-width: 1.75 }
.brand-name { white-space: nowrap; font-size: 17px; font-weight: 650; letter-spacing: .3px }
.top-tools { gap: 12px; flex: none }
.search-toggle {
  height: 32px; gap: 8px; min-width: 184px; padding: 0 9px;
  background: #f5f6f8; color: #636b77; border: 1px solid transparent; border-radius: 4px;
  font-size: 13px;
}
.search-toggle:hover { background: #eef1f6; border-color: #d4d9e1 }
.search-toggle kbd { margin-left: auto; padding: 0 4px; color: #717681; background: #fff; border: 1px solid #dcdfe5; border-radius: 3px; font: 11px/17px Inter, Arial, sans-serif }
.icon-btn, .top-account, .menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px; border: 0; border-radius: 4px; background: transparent;
}
.icon-btn:hover, .top-account:hover, .menu-btn:hover { background: #f2f3f5 }
.icon-btn { width: 32px; height: 32px }
.top-account { gap: 8px; font-size: 13px; white-space: nowrap; padding-block: 3px }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px;
  border-radius: 50%; background: #e3edff; color: #0052bb; font-size: 15px; font-weight: 600;
}
.avatar.small { width: 28px; height: 28px; font-size: 12px }
.top-sep { width: 1px; height: 18px; background: var(--line) }
.bell { position: relative }
.bell i { width: 7px; height: 7px; position: absolute; right: 5px; top: 4px; border: 1.5px solid #fff; border-radius: 50%; background: #e34d59 }
.menu-btn, .overlay { display: none }
#sidebar {
  position: fixed; z-index: 18; top: var(--header-height); bottom: 0; left: 0;
  display: flex; flex-direction: column; width: var(--rail);
  background: #fff; border-right: 1px solid var(--line);
}
#sidebar nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 21px 12px }
.nav-group + .nav-group { margin-top: 24px }
.nav-caption { padding: 0 12px 8px; font-size: 12px; color: #777e88 }
.nav-item {
  display: flex; align-items: center; gap: 12px; position: relative; min-height: 42px;
  padding: 8px 13px; margin: 2px 0; border-radius: 5px; color: #363d48; font-weight: 400;
}
.nav-item .icon { color: #66707e }
.nav-item:hover { color: var(--ink); background: #f3f4f6 }
.nav-item.selected { background: var(--td-brand-color-light); color: var(--td-brand-color); font-weight: 550 }
.nav-item.selected .icon { color: inherit }
.nav-footer { padding: 10px 12px; border-top: 1px solid var(--line) }
.collapse-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 36px;
  border: 0; border-radius: 4px; padding: 0 13px; color: var(--muted);
  background: none; font-size: 13px; white-space: nowrap;
}
.collapse-btn:hover { background: #f3f4f6; color: var(--ink) }
.workspace { min-height: 100vh; min-width: 0; margin-left: var(--rail); padding-top: var(--header-height) }
.workspace-inner { max-width: 1720px; margin: auto; padding: 18px 24px 36px }
.breadcrumb { gap: 9px; margin-bottom: 13px; font-size: 12px; line-height: 18px; color: #68707d }
.breadcrumb a { color: inherit }
.breadcrumb a:hover { color: var(--td-brand-color) }
.breadcrumb .icon { color: #9399a2 }
main#content { min-width: 0 }
.page-title { margin: 0 0 16px }
@media (min-width: 761px) {
  body.rail-compact { --rail: 64px }
  .rail-compact #sidebar nav { padding: 17px 8px }
  .rail-compact .nav-item { justify-content: center; padding-inline: 0 }
  .rail-compact .nav-item span, .rail-compact .nav-caption, .rail-compact .collapse-btn span { display: none }
  .rail-compact .nav-group + .nav-group { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px }
  .rail-compact .nav-footer { padding-inline: 8px }
  .rail-compact .collapse-btn { justify-content: center; padding-inline: 0 }
  .rail-compact .collapse-btn .icon { transform: rotate(180deg) }
}

/* Shared business components. */
.panel, .metric {
  min-width: 0; overflow: hidden; background: var(--td-bg-color-container);
  border-radius: var(--radius); border: 1px solid #e8e9ec;
}
.panel + .panel { margin-top: 16px }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 18px 20px 15px }
.panel-head h2 { font-size: 16px }
.panel-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted) }
.btn, button.secondary {
  display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 32px;
  padding: 4px 13px;
  border: 1px solid var(--td-component-stroke); border-radius: 4px;
  background: #fff; color: var(--ink); font-size: 14px; line-height: 22px;
}
.btn:hover, button.secondary:hover { color: var(--td-brand-color); border-color: var(--td-brand-color) }
.btn.primary { background: var(--td-brand-color); border-color: var(--td-brand-color); color: #fff }
.btn.primary:hover { background: var(--td-brand-color-hover); border-color: var(--td-brand-color-hover) }
.btn.primary:active { background: var(--td-brand-color-active); border-color: var(--td-brand-color-active) }
.btn.ghost, .text-btn, .link-button {
  display: inline-flex; align-items: center; gap: 3px;
  border: 0; background: none; color: var(--td-brand-color); font-size: 13px; padding: 3px 4px;
}
.btn.ghost:hover, .link-button:hover, .text-btn:hover { color: var(--td-brand-color-active); background: #f1f5ff; border-radius: 3px }
.btn.danger { border-color: #f0b8bd; color: var(--td-error-color) }
.btn.danger:hover { border-color: var(--td-error-color); background: #fff1f1 }
.badge {
  display: inline-flex; align-items: center; justify-content: center; padding: 1px 7px;
  background: #eeeef0; color: #575d68; border-radius: 3px;
  font-size: 12px; line-height: 20px; font-weight: 400; white-space: nowrap;
}
.badge.blue { color: var(--td-brand-color); background: #ecf2fe }
.badge.green { color: #00744b; background: #e3f5eb }
.badge.amber { color: #995402; background: #fff1df }
.badge.red { color: #bb303a; background: #fce8e8 }
.tabs {
  display: flex; flex-wrap: nowrap; align-items: stretch; max-width: 100%;
  overflow-x: auto; margin: 0 0 16px; padding: 0 8px; gap: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.tabs button, .tabs a {
  position: relative; min-height: 44px; flex: none; padding: 0 15px;
  border: 0; border-radius: 0; background: none; color: #545c66; font-size: 14px; white-space: nowrap;
}
.tabs button:hover, .tabs a:hover { background: #f6f8fc; color: var(--td-brand-color); border-radius: 0 }
.tabs button.active, .tabs a.active { background: #fff; color: var(--td-brand-color); font-weight: 550 }
.tabs .active::after { content: ""; position: absolute; bottom: 0; left: 14px; right: 14px; height: 2px; background: var(--td-brand-color) }
.tabs button:focus-visible, .tabs a:focus-visible { outline-offset: -3px }
.panel > .tabs { border-inline: 0; border-top: 0; border-radius: 0; margin-bottom: 0 }
.toolbar, .filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
.filters { padding: 8px 20px 16px }
.stack { display: grid; gap: 16px; min-width: 0 }
.stack > .panel, .stack > .tabs, .grid-2 > .panel { margin: 0 }
.grid-2, .metric-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px }
.metric-grid { grid-template-columns: repeat(auto-fit,minmax(130px,1fr)) }
.metric { padding: 16px }
.metric p { margin: 0 }
.metric strong, .metric b { display: block; font-size: 24px }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); padding: 12px 20px 20px; gap: 16px }
.detail-item { min-width: 0; overflow-wrap: anywhere }
.detail-item small, .detail-item > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px }
.detail-item strong { font-weight: 550 }
.table-wrap { min-width: 0; max-width: 100%; overflow: auto }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px }
th, td { padding: 11px 14px; line-height: 22px; vertical-align: middle; border-bottom: 1px solid var(--line) }
th { background: #f5f6f8; color: #606672; font-size: 13px; font-weight: 500; white-space: nowrap }
th:first-child, td:first-child { padding-left: 20px }
th:last-child, td:last-child { padding-right: 20px }
tbody tr:last-child td { border-bottom: 0 }
tbody tr:hover { background: #f8faff }
td .btn { font-size: 13px; min-height: 26px; line-height: 20px; padding: 2px 7px }
td .btn + .btn { margin-left: 3px }
.empty { text-align: center !important; color: var(--muted); padding: 30px 16px; font-size: 14px }

/* Forms and overlay surfaces share the same button, field and typography tokens. */
dialog {
  padding: 0; width: min(680px,calc(100vw - 32px)); max-height: min(86vh,900px);
  border: 0; border-radius: 8px; background: #fff; color: var(--ink);
  box-shadow: 0 12px 40px #242b3a26, 0 2px 8px #242b3a1a;
}
dialog[open] { display: flex; flex-direction: column }
dialog::backdrop { background: #12172064 }
.modal-head {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex: none;
  padding: 16px 20px 13px 24px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 18px }
.modal-body { min-width: 0; overflow-y: auto; padding: 20px 24px 24px }
.modal-body .detail-grid { padding-inline: 0 }
.modal-body .panel { margin: 10px 0 }
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px }
.form-row { display: flex; flex-direction: column; min-width: 0; gap: 6px }
.form-row > span { font-size: 14px; color: var(--ink); font-weight: 500 }
.form-row.wide { grid-column: 1/-1 }
.form-row small { font-size: 12px }
.form-row input[type=checkbox] { align-self: flex-start }
.required, .form-error, .error { color: var(--td-error-color) }
.form-error:not(:empty) { background: #fff0f0; border-radius: 4px; padding: 9px 12px; margin: 12px 0 }
.form-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line) }
.identity { display: flex; align-items: center; gap: 12px; margin-bottom: 22px }
.notice-list article { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line) }
.notice-list article:first-child { padding-top: 0 }
.notice-list article:last-child { border: 0 }
.notice-list article p { font-size: 14px; margin: 5px 0 }
.notice-list .dot { flex: none; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--td-brand-color) }
.search-field { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--td-component-stroke); border-radius: 4px }
.search-field:focus-within { border-color: var(--td-brand-color); box-shadow: 0 0 0 2px #0052d91b }
.search-field input { flex: 1; border: none; outline: none; box-shadow: none }
.search-hit { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left }
.search-hit:hover { background: #f6f8fc }
.search-hit > span:nth-child(2) { flex: 1; min-width: 0 }
.search-hit b, .search-hit small { display: block }
.search-hit small { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px }
#toasts { position: fixed; z-index: 31; top: 68px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; max-width: calc(100vw - 32px); pointer-events: none }
.toast { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 9px 16px; font-size: 14px; box-shadow: 0 4px 16px #131a2f24 }
dialog .toast { position: sticky; bottom: 12px; align-self: center; margin: 0 16px 12px }
.boot { margin: 14vh auto; text-align: center }
.login {
  display: grid; place-items: center; min-height: 100vh; padding: 20px;
  background: radial-gradient(ellipse at 85% 10%,#dce8ff,transparent 50%),#f5f7fb;
}
.login section { width: min(398px,100%); padding: 36px 32px; border: 1px solid #e5e8ee; background: #fff; border-radius: 8px; box-shadow: 0 8px 30px #243f6a0a }
.login .brand { margin-bottom: 28px }
.login .brand-name { font-size: 16px }
.login h1 { margin-bottom: 18px }
.login .form-row { margin: 14px 0 }
.login .primary { width: 100%; margin-top: 8px }

@media (min-width: 1550px) {
  .workspace-inner { padding: 20px 32px 40px }
}
@media (max-width: 760px) {
  :root { --header-height: 52px; --rail: 224px }
  .topbar { padding: 0 10px; gap: 4px }
  .menu-btn { display: inline-flex; flex: none }
  .brand { gap: 7px }
  .brand-symbol { width: 28px; height: 28px; border-radius: 5px }
  .brand-symbol .icon { width: 21px; height: 21px }
  .brand-name { font-size: 14px; letter-spacing: 0 }
  .top-tools { gap: 3px }
  .top-account { padding: 2px }
  .account-name, .top-account > .icon, .top-sep, .search-toggle span, .search-toggle kbd { display: none }
  .search-toggle { justify-content: center; width: 32px; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink) }
  .workspace { margin-left: 0 }
  .workspace-inner { padding: 15px 14px 26px }
  .breadcrumb { margin: 0 0 10px }
  #sidebar { transform: translateX(-100%); visibility: hidden }
  .nav-open #sidebar { transform: translateX(0); visibility: visible; box-shadow: 6px 0 22px #1525451a }
  .nav-open .overlay { display: block; position: fixed; inset: var(--header-height) 0 0; z-index: 16; background: #12172064 }
  .nav-footer { display: none }
  .nav-open { overflow: hidden }
  .page-title { font-size: 22px; margin-bottom: 12px }
  .panel-head { padding: 15px 14px 12px }
  .filters { padding: 6px 14px 14px }
  .tabs { padding: 0 3px }
  .tabs a, .tabs button { padding-inline: 11px }
  th:first-child, td:first-child { padding-left: 14px }
  th:last-child, td:last-child { padding-right: 14px }
  .grid-2, .form-grid { grid-template-columns: minmax(0,1fr) }
  .modal-body .table-wrap table:has(th:nth-child(5)) { min-width: 620px }
  .modal-head { padding: 12px 14px 12px 16px }
  .modal-body { padding: 16px }
  .detail-grid { grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); padding: 12px 14px }
}
@media (max-width: 420px) {
  .topbar .brand-name { font-size: 14px }
  .topbar .brand-name span { display: block; font-size: 10px; line-height: 12px; color: var(--muted); letter-spacing: .5px }
  .login .brand-name { white-space: normal }
}
