:root {
  color-scheme: light;
  --surface: #ffffff;
  --background: #f7f8fc;
  --line: #e7e9f0;
  --text: #222738;
  --muted: #646c80;
  --soft: #f5f6fa;
  --accent: #db2d4c;
  --accent-hover: #be1c3b;
  --accent-soft: #fff0f3;
  --accent-line: #f4c7d0;
  --green: #197451;
  --green-soft: #e9f7ef;
  --blue: #3556a6;
  --blue-soft: #eff3ff;
  --amber: #856014;
  --amber-soft: #fff4d9;
  --shadow: 0 2px 8px rgba(28, 35, 64, 0.035);
  font-family: "Inter", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--text);
  background: var(--background);
  font-size: 16px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
[v-cloak] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .61; cursor: wait; }
button, a { touch-action: manipulation; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1, h2, h3, p, dl { margin: 0; }
h1 { font-size: clamp(1.65rem, 3vw, 2.1rem); line-height: 1.22; letter-spacing: -.028em; font-weight: 750; }
h2 { font-size: 1.125rem; letter-spacing: -.012em; line-height: 1.35; }
h3 { font-size: 1rem; line-height: 1.4; }
label { display: grid; gap: 7px; font-size: .9rem; font-weight: 650; }
input, select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  color: var(--text); background: var(--surface); border: 1px solid #dce0ea; border-radius: 8px;
}
input::placeholder { color: #71798d; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); outline-offset: 0; }
input:disabled, select:disabled { background: var(--soft); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; min-height: auto; padding: 0; margin: 0; accent-color: var(--accent); }
select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, #646c80 50%), linear-gradient(135deg, #646c80 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
fieldset { padding: 0; min-width: 0; margin: 0; border: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 650; font-size: .9rem; }
.button {
  min-height: 41px; padding: 8px 15px; border: 1px solid transparent; border-radius: 8px;
  font-size: .875rem; font-weight: 700; display: inline-flex; gap: 7px; align-items: center;
  justify-content: center; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s;
}
.primary { color: #fff; background: var(--accent); }
.primary:hover:not(:disabled), .danger:hover:not(:disabled) { background: var(--accent-hover); }
.primary:disabled { cursor: not-allowed; }
.secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { background: var(--soft); border-color: #dce0ea; }
.quiet { color: var(--muted); background: transparent; }
.danger { background: var(--accent); color: #fff; }
.text-button { color: var(--accent-hover); padding: 0; border: 0; background: transparent; font-size: .875rem; font-weight: 680; text-decoration: none; }
.text-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.danger-text { color: #ad2441; }
.subdued { color: var(--muted); }
.muted { color: var(--muted); }
.self-start { justify-self: start; }
.full { width: 100%; }
.stack { display: grid; gap: 16px; }
.nowrap { white-space: nowrap; }
.mono, code { font-family: "IBM Plex Mono", "Consolas", monospace; }
.plus { display: inline-grid; place-items: center; font-size: 1.1rem; line-height: 1; font-weight: 550; margin-top: -1px; }
.error { color: #9d1c36; background: #fff0f3; border: 1px solid #f4cdd5; border-radius: 8px; padding: 10px 13px; font-size: .875rem; }
.warn-text { color: var(--amber); font-size: .875rem; }

.brand-mark {
  width: 40px; height: 40px; flex: none; border-radius: 11px; display: inline-grid; place-items: center;
  color: #fff; background: var(--accent); font-size: 1.1rem; font-weight: 750; box-shadow: 0 3px 7px #dd2d4a23;
}
.boot { display: grid; place-content: center; justify-items: center; min-height: 85vh; gap: 14px; color: var(--muted); }
.auth-page { min-height: 100dvh; display: grid; align-items: center; justify-items: center; padding: 36px 18px; }
.auth-shell { width: min(100%, 440px); }
.auth-brand { display: flex; gap: 12px; align-items: center; justify-content: center; margin-bottom: 25px; font-weight: 750; }
.auth-card { background: var(--surface); padding: clamp(22px, 6vw, 34px); border-radius: 17px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.7rem; }
.auth-card > .muted { margin-top: 8px; }
.auth-card form { margin-top: 24px; }
.auth-switch { margin-top: 20px; font-size: .875rem; }
.auth-switch .text-button { margin-left: 5px; }

.workspace { min-height: 100dvh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh;
  padding: 24px 16px 17px; background: var(--surface); border-right: 1px solid var(--line);
}
.sidebar-brand { display: flex; gap: 12px; align-items: center; margin: 0 6px 32px; white-space: nowrap; }
.sidebar-brand div { display: grid; gap: 1px; }
.sidebar-brand strong { font-size: 1rem; font-weight: 760; }
.sidebar-brand small, .top-user small, .account-name small { color: var(--muted); font-size: .8rem; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-label { padding: 0 11px; color: var(--muted); font-size: .8125rem; font-weight: 640; margin-bottom: 4px; }
.section-label { margin-top: 19px; }
.nav-item {
  width: 100%; display: flex; gap: 11px; min-height: 42px; align-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 8px; color: #4e576c;
  font-size: .9rem; font-weight: 680; padding: 8px 10px; text-align: left; text-decoration: none;
}
.nav-item:hover { background: var(--soft); color: var(--text); }
.nav-item.selected { background: var(--accent-soft); border-color: #f9e3e9; color: var(--accent-hover); }
.sidebar-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.external { font-size: .875rem; }
.content-main { min-width: 0; }
.topbar {
  min-height: 68px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 clamp(20px, 3.5vw, 46px);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.breadcrumb { display: flex; flex-flow: row wrap; align-items: center; gap: 11px; font-size: .875rem; }
.breadcrumb-root, .crumb-separator { color: var(--muted); }
.top-user { display: flex; gap: 10px; align-items: center; min-width: 0; }
.top-user-name { display: grid; line-height: 1.3; gap: 2px; font-size: .875rem; overflow-wrap: anywhere; }
.logout { min-height: 35px; padding: 4px 10px; margin-left: 5px; }
.main-wrap { width: min(100%, 1450px); margin: 0 auto; padding: 36px clamp(20px, 3.5vw, 46px) 45px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-heading p { color: var(--muted); margin-top: 7px; }
.add-button { min-height: 43px; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.metric { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 15px 17px; border-radius: 12px; min-height: 128px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #5b6579; font-weight: 680; font-size: .875rem; }
.metric-number { margin: 2px 0 4px; font-size: 1.8rem; line-height: 1.2; font-weight: 760; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.metric-number span { color: var(--muted); font-size: .86rem; font-weight: 650; letter-spacing: 0; }
.metric p { color: var(--muted); font-size: .8125rem; margin-top: 7px; }
.quota-track { width: 100%; height: 5px; background: #f3e8ec; border-radius: 5px; margin-top: 8px; }
.quota-track div { height: 100%; background: var(--accent); border-radius: inherit; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.panel-head {
  min-height: 77px; padding: 15px 18px; display: flex; justify-content: space-between;
  align-items: center; gap: 15px;
}
.panel-head p { color: var(--muted); margin-top: 4px; font-size: .8125rem; }
.panel-tools { display: flex; gap: 8px; align-items: center; }
.panel-message { margin: 0 18px 12px; }
.panel-foot { border-top: 1px solid var(--line); padding: 12px 18px; color: var(--muted); font-size: .8125rem; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 0 11px; border-radius: 8px; min-width: 0; color: var(--muted); }
.search input { border: 0; padding: 0; min-height: 39px; min-width: 0; width: clamp(68px, 13vw, 157px); font-size: .875rem; font-weight: 450; }
.search:focus-within { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.search input:focus { outline: none; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th { white-space: nowrap; padding: 11px 16px; font-size: .8125rem; font-weight: 690; background: #f8f9fc; color: #5a6479; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; }
tbody tr:nth-child(n+2) td { border-top: 1px solid var(--line); }
tbody tr:hover { background: #fcfcfe; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
.actions-head { text-align: right; }
.account-name { display: flex; align-items: center; gap: 10px; min-width: 137px; }
.account-name div { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; font-weight: 720; flex: none; font-size: .875rem; }
.user-avatar, .tone-rose { color: #9a2952; background: #fcebf1; }
.tone-lavender { color: #6446a0; background: #f1ebfc; }
.tone-jade { color: #236451; background: #e3f6ee; }
.tone-apricot { color: #8c4b28; background: #faeee2; }
.badge { width: max-content; display: inline-flex; gap: 5px; align-items: center; padding: 3px 8px; border-radius: 20px; font-size: .8125rem; font-weight: 660; line-height: 1.4; white-space: nowrap; }
.badge::before { display: inline-block; content: ''; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.badge-red { background: var(--accent-soft); color: #a92642; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-gray { background: var(--soft); color: #646c7d; }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; min-height: 32px; white-space: nowrap; }
.row-actions .text-button { font-size: .8125rem; }
.row-menu { display: inline-block; }
.row-menu summary { list-style: none; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-options { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.menu-item { border: 0; background: transparent; font-size: .8125rem; font-weight: 650; color: var(--muted); }
.menu-item:hover { text-decoration: underline; }
.menu-item.danger-text { color: #a92642; }
.icon-button {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; padding: 0;
  border: 1px solid transparent; color: #5c6478; background: transparent; font-weight: 680;
}
.icon-button:hover { background: var(--soft); color: var(--text); }
.empty-state { display: grid; place-items: center; gap: 7px; min-height: 220px; padding: 28px 16px; border-top: 1px solid var(--line); text-align: center; }
.empty-state p { color: var(--muted); }
.empty-state .button { margin-top: 5px; }
.info-strip { margin-top: 17px; padding: 13px 15px; border-radius: 10px; display: flex; align-items: flex-start; gap: 11px; background: #eef2ff; color: #434f72; }
.info-strip.compact { margin: 0; }
.info-strip strong { font-size: .875rem; }
.info-strip p { margin-top: 2px; font-size: .875rem; }
.info-icon { border: 1px solid #51649a; border-radius: 50%; flex: none; width: 17px; height: 17px; line-height: 15px; text-align: center; margin-top: 3px; font-size: .75rem; font-weight: 750; }
.two-column { display: grid; grid-template-columns: 1.13fr 1fr; gap: 16px; }
.padded { padding: 20px; }
.padded h2 { margin-bottom: 16px; }
.padded > .muted { font-size: .875rem; margin-top: 12px; }
.key-values { display: grid; }
.key-values > div { display: grid; align-items: baseline; grid-template-columns: minmax(82px, .4fr) 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.key-values dt { color: var(--muted); }
.key-values dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }

.modal {
  width: min(510px, calc(100% - 30px)); max-height: calc(100dvh - 28px); padding: 0;
  border: 1px solid #e1e5ee; border-radius: 15px; color: var(--text); background: var(--surface);
  box-shadow: 0 22px 80px #1d213d39; overscroll-behavior: contain;
}
.wide-modal { width: min(670px, calc(100% - 30px)); }
.modal::backdrop { background: #171c37a3; }
.modal-head { display: flex; justify-content: space-between; gap: 8px; padding: 18px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.modal-head h2 { font-size: 1.16rem; }
.modal-head p { color: var(--muted); font-size: .875rem; margin-top: 4px; }
.close-button { font-size: 1.45rem; line-height: 1; margin: -4px -4px -2px 0; }
.modal-body { padding: 18px 20px 20px; }
.modal-body > p:not(.error), .modal-body > .error { margin-bottom: 10px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.method-group { display: grid; gap: 8px; }
.method-option { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; cursor: pointer; }
.method-option.chosen { background: #fff6f8; border-color: var(--accent-line); }
.method-option span { display: grid; gap: 3px; }
.method-option small { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.login-status { background: #f8f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 13px; margin-bottom: 12px; }
.failure-status { background: #fff7f8; border-color: #f8dce2; }
.login-status h3 { margin-top: 8px; overflow-wrap: anywhere; }
.login-status p { color: var(--muted); font-size: .875rem; margin-top: 4px; }
.loading-line { color: var(--muted); }
.diagnostic-code { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; padding: 0 0 4px; font-size: .875rem; }
.diagnostic-code span { color: var(--muted); }
.diagnostic-code code { background: var(--soft); border-radius: 5px; padding: 3px 6px; overflow-wrap: anywhere; }
.diagnostic-values { margin-bottom: 14px; }
.qr-box { display: grid; justify-items: center; gap: 5px; padding: 10px; }
.qr-box img { width: min(215px, 100%); aspect-ratio: 1; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 7px; }
.evidence { margin: 12px 0; }
.evidence-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.evidence img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.sms-form { padding: 6px 0 9px; }
.consent { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .8125rem; font-weight: 500; }
.consent input { flex: none; margin-top: 2px; }
.history-list { display: grid; gap: 8px; }
.history-row { display: flex; justify-content: space-between; align-items: center; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; color: var(--text); text-align: left; gap: 10px; padding: 10px; }
.history-row:hover { background: var(--soft); }
.history-row span:first-child { display: grid; gap: 3px; overflow-wrap: anywhere; }
.history-row strong { font-size: .9rem; }
.history-row small { color: var(--muted); }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.code-output { font-family: "Consolas", monospace; resize: vertical; font-size: .875rem; }
.toast {
  position: fixed; z-index: 10; inset: auto 18px 18px auto; max-width: calc(100% - 36px);
  background: #203238; color: #fff; border-radius: 10px; box-shadow: 0 5px 17px #15252e42;
  display: flex; gap: 9px; align-items: center; padding: 11px 15px; font-size: .875rem;
}
.toast-error { background: #a12b41; }
.toast-mark { flex: none; border: 1px solid currentColor; width: 19px; height: 19px; display: inline-grid; place-items: center; border-radius: 50%; font-size: .75rem; font-weight: 800; }
.modal .toast { position: absolute; }

.icon { width: 18px; height: 18px; flex: none; display: inline-block; position: relative; color: inherit; }
.icon::before, .icon::after { content: ''; position: absolute; display: block; }
.icon-accounts::before { inset: 2px 1px; border: 1.5px solid currentColor; border-radius: 3px; }
.icon-accounts::after {
  width: 3px; height: 3px; border-radius: 50%; background: currentColor;
  left: 4.5px; top: 7.5px; box-shadow: 6px 0 0 -0.3px currentColor, 8px 0 0 -0.3px currentColor;
}
.icon-card::before { inset: 3px 1px; border: 1.5px solid currentColor; border-radius: 3px; }
.icon-card::after { left: 2px; right: 2px; border-top: 1.5px solid currentColor; top: 7px; }
.icon-users::before { width: 5px; height: 5px; left: 5px; top: 1px; border: 1.4px solid currentColor; border-radius: 50%; }
.icon-users::after { width: 11px; height: 5px; left: 2px; bottom: 1px; border: 1.4px solid currentColor; border-radius: 7px 7px 2px 2px; }
.icon-clock::before { inset: 2px; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-clock::after { width: 4px; height: 5px; top: 5px; left: 8px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.icon-globe::before { inset: 2px; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-globe::after { inset: 2px 5px; border: 1.3px solid currentColor; border-radius: 50%; }
.icon-search::before { width: 8px; height: 8px; top: 2px; left: 2px; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-search::after { width: 5px; height: 1.5px; top: 12px; left: 11px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.metric-icon, .empty-icon { width: 34px; height: 34px; border-radius: 9px; }
.metric-icon::before, .empty-icon::before { translate: 8px 8px; right: auto; bottom: auto; width: 14px; height: 12px; }
.metric-icon::after, .empty-icon::after { translate: 8px 8px; }
.metric-icon.icon-card::after { right: auto; width: 15px; }
.metric-icon.icon-clock::before { width: 13px; height: 13px; }
.metric-red { color: #bb2e52; background: var(--accent-soft); }
.metric-green { color: var(--green); background: var(--green-soft); }
.metric-amber { color: var(--amber); background: var(--amber-soft); }
.empty-icon { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 970px) {
  .workspace { grid-template-columns: 187px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .main-wrap { padding-inline: 22px; }
  .row-actions { gap: 8px; }
}
@media (max-width: 770px) {
  .workspace { display: block; }
  .sidebar { z-index: 1; position: sticky; width: 100%; height: auto; padding: 10px 13px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { margin: 0 0 8px; gap: 8px; }
  .sidebar-brand .brand-mark { width: 32px; height: 32px; border-radius: 8px; font-size: 1rem; }
  .sidebar-brand small, .nav-label, .sidebar-bottom { display: none; }
  .sidebar-nav { display: flex; overflow-x: auto; gap: 5px; padding-bottom: 2px; }
  .nav-item { width: auto; padding: 5px 8px; min-height: 37px; flex: none; font-size: .8125rem; gap: 5px; }
  .topbar { min-height: 53px; padding-inline: 15px; }
  .top-user .avatar { display: none; }
  .main-wrap { padding: 24px 15px 34px; }
  .page-heading { margin-bottom: 16px; }
  .page-heading p { font-size: .875rem; }
  .metrics { gap: 7px; margin-bottom: 16px; }
  .metric { padding: 10px 9px; min-height: 93px; }
  .metric-top { font-size: .8125rem; }
  .metric p { display: none; }
  .metric-icon { display: none; }
  .metric-number { margin-top: 8px; font-size: 1.55rem; }
  th, td { padding-inline: 10px; }
  th:first-child, td:first-child { padding-left: 12px; }
  th:last-child, td:last-child { padding-right: 12px; }
  .panel-head { padding-inline: 12px; }
  .two-column { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .top-user-name small, .breadcrumb-root, .crumb-separator { display: none; }
  .top-user { gap: 4px; }
  .page-heading { align-items: flex-start; }
  .page-heading .button { margin-top: 1px; padding-inline: 9px; }
  .search { padding-inline: 5px; }
  .panel-tools .button { padding-inline: 8px; }
  .panel-head { gap: 8px; }
  .form-columns { grid-template-columns: 1fr; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}.login-expiry { margin-top: 8px; font-size: .8125rem; }
.dialog-toast { margin: 0 20px 16px; font-size: .875rem; color: var(--green); background: var(--green-soft); border-radius: 8px; padding: 9px 12px; }
.dialog-toast-error { color: #9d1c36; background: #fff0f3; }
