:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  --bg: #f7f9fd;
  --panel: #ffffff;
  --ink: #101936;
  --muted: #697897;
  --soft: #f4f7fc;
  --line: #e1e7f2;
  --primary: #1267ff;
  --primary-dark: #0756df;
  --primary-weak: #edf4ff;
  --green: #0f8a5f;
  --green-weak: #e9f8f0;
  --orange: #b45309;
  --orange-weak: #fff4df;
  --red: #b42318;
  --red-weak: #fff0ed;
  --purple: #7457ff;
  --purple-weak: #f0edff;
  --nav: #ffffff;
  --nav-soft: #f3f6fb;
  --shadow: 0 14px 36px rgba(38, 71, 132, 0.08);
  --shadow-soft: 0 8px 22px rgba(38, 71, 132, 0.06);
}

* {
  box-sizing: border-box;
  scrollbar-color: rgba(92, 119, 160, .45) rgba(231, 237, 247, .72);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(231, 237, 247, .72);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(118, 143, 180, .72), rgba(74, 105, 151, .72));
  border: 2px solid rgba(247, 249, 253, .95);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(89, 119, 164, .88), rgba(51, 84, 134, .88));
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
}
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 48% -18%, #fff 0, #f9fbff 34%, transparent 62%),
    linear-gradient(180deg, #f8fbff 0, #f6f9fd 52%, #f7f9fd 100%);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--primary-weak);
  outline-offset: 2px;
}

.auth-page {
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.auth-brand, .logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, #2082ff, #075dff);
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(18, 103, 255, .2);
}

.auth-brand {
  min-height: 96px;
  padding: 0 clamp(28px, 5vw, 56px);
  border-bottom: 1px solid rgba(209, 219, 233, .72);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px);
}

.auth-brand strong, .logo strong {
  font-size: 22px;
  letter-spacing: .01em;
}

.auth-nav {
  margin-left: auto;
  display: flex;
  gap: 28px;
  align-items: center;
}

.auth-nav button, .auth-footer button {
  border: 0;
  background: transparent;
  color: #33415f;
  font-weight: 600;
}

.auth-shell {
  width: min(1070px, calc(100% - 48px));
  flex: 1;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, .82fr);
  gap: 0;
  align-items: center;
  justify-content: center;
  margin: 58px auto 40px;
}

.auth-card, .auth-aside, .panel, .stat, .hero-balance, .drawer, .hint-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-card {
  border-radius: 12px 0 0 12px;
  box-shadow: var(--shadow);
  border-color: #d9e4f2;
}

.auth-aside {
  border-left: 0;
  border-radius: 0 12px 12px 0;
  box-shadow: var(--shadow);
  border-color: #d9e4f2;
}

.auth-card {
  padding: clamp(36px, 5vw, 56px) clamp(34px, 5vw, 64px);
  min-height: 630px;
}

.auth-card h1 {
  margin: 0 0 26px;
  text-align: center;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: 0;
  line-height: 1.2;
}

.auth-card > .muted { display: none; }

.auth-aside {
  min-height: 590px;
  padding: 40px 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 52% 18%, rgba(18, 103, 255, .11), transparent 34%),
    linear-gradient(135deg, #f7fbff, #eef5ff);
}

.auth-aside h2 {
  font-size: 30px;
  margin: 28px 0 24px;
}

.auth-aside ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 20px;
}

.aside-badge {
  align-self: flex-start;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary-weak);
  color: var(--primary);
  font-weight: 700;
}

.eyebrow, .muted, small, .auth-card label, .page-title p, .stat span, .panel p, .hint-panel {
  color: var(--muted);
}

.auth-card label, .form-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.auth-card label { margin-top: 16px; }
.form-panel label { margin-bottom: 14px; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-weak);
}

.tabs, .segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.tabs { margin: 24px 0 8px; }

.tab, .segmented button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--muted);
  min-height: 40px;
  white-space: nowrap;
}

.tab.active, .segmented button.active {
  background: #111827;
  color: #fff;
}

.segmented {
  margin-bottom: 16px;
  overflow-x: auto;
}

.segmented.small {
  margin: 0;
  max-width: 360px;
}

.auth-links, .role-preview, .quick-row, .filters, .page-actions, .row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.auth-links {
  justify-content: space-between;
  margin-top: 14px;
}

.auth-links button, .role-preview button, .link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 4px;
  font-weight: 700;
}

.role-preview {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.role-preview span {
  color: var(--muted);
  font-size: 13px;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  min-height: 42px;
  min-width: 92px;
  font-weight: 700;
  transition: background .16s ease, border-color .16s ease;
  white-space: nowrap;
}

.btn:hover { filter: brightness(.99); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary, .ghost {
  background: var(--soft);
  color: #24324a;
  border: 1px solid #dce5ef;
}
.btn.danger {
  background: var(--red-weak);
  color: var(--red);
  border: 1px solid #fed7ca;
}
.auth-card > .btn {
  width: 100%;
  margin-top: 20px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #24324a;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: var(--nav);
  color: #fff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo small {
  display: block;
  color: #9fb0c7;
  margin-top: 3px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
  overflow-y: auto;
  padding-right: 3px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.nav-item span {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
  flex: 0 0 auto;
}

.nav-item b {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item.active, .nav-item:hover {
  background: var(--primary);
  color: #fff;
}

.role-box {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--nav-soft);
}

.role-box span {
  color: #9fb0c7;
  font-size: 13px;
}

.role-box strong {
  display: block;
  margin-top: 5px;
}

.role-box small {
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}

.workspace {
  min-width: 0;
  background:
    radial-gradient(circle at 50% -18%, rgba(255, 255, 255, .95) 0, rgba(247, 250, 255, .72) 42%, transparent 65%),
    #f7f9fd;
}

.topbar {
  height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(16px, 3vw, 30px);
  position: sticky;
  top: 0;
  z-index: 8;
}

.top-shortcuts {
  min-width: 0;
  margin-right: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-shortcuts::-webkit-scrollbar { display: none; }

.top-shortcut {
  min-height: 36px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #445470;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.top-shortcut:hover {
  border-color: #d8e2f1;
  background: #f6f9fe;
  color: var(--primary);
}

.top-shortcut.active {
  border-color: #cfe0ff;
  background: var(--primary-weak);
  color: var(--primary);
}

.top-shortcut .app-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: transparent;
  color: currentColor;
}

.top-shortcut .app-icon svg {
  width: 16px;
  height: 16px;
}

.top-actions {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}

.avatar {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 40px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-menu {
  position: absolute;
  right: 0;
  top: 48px;
  width: 178px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  gap: 4px;
  z-index: 12;
}

.profile-menu button {
  border: 0;
  background: transparent;
  padding: 10px;
  text-align: left;
  border-radius: 6px;
}

.profile-menu button:hover { background: #f1f5f9; }

.menu-btn { display: none; }
.content { padding: clamp(18px, 3vw, 30px); }

.page-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-title h1 {
  margin: 0 0 7px;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: 0;
}

.page-title p {
  margin: 0;
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.grid.two { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); }
.grid.two.uneven { grid-template-columns: minmax(360px, 1fr) minmax(260px, 360px); align-items: start; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat {
  padding: 20px;
  min-height: 112px;
}

.stat strong {
  display: block;
  font-size: clamp(22px, 2.5vw, 28px);
  margin-top: 12px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.stat em {
  display: block;
  color: var(--green);
  font-style: normal;
  margin-top: 8px;
}

.stat.warning em { color: var(--orange); }
.stat.success strong { color: var(--green); }

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.panel h3 { margin: 0 0 10px; }

.section-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-head h2 { margin: 0; }

.hero-balance {
  padding: clamp(22px, 3vw, 30px);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.hero-balance strong {
  display: block;
  font-size: clamp(34px, 5vw, 50px);
  margin: 8px 0;
  letter-spacing: 0;
}

.page-quick { margin-bottom: 18px; }
.key-card, .download {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.key-card code, .config-list code, .profile-layout code {
  display: block;
  margin-top: 8px;
  padding: 13px;
  border-radius: 8px;
  background: #f4f7fb;
  color: #1e293b;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.tool-guide { margin-top: 16px; }
.config-list {
  display: grid;
  gap: 12px;
}

.config-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.config-list small {
  display: block;
  margin: 5px 0 8px;
  color: var(--muted);
}

.config-list pre {
  margin: 8px 0 10px;
  padding: 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.notice, .success, .warning {
  border-radius: 8px;
  padding: 13px 14px;
  margin: 12px 0 0;
}

.notice { background: #eef6ff; color: #1d4ed8; }
.success { background: var(--green-weak); color: var(--green); }
.warning { background: var(--orange-weak); color: var(--orange); }

.inline-state {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 13px;
}

.inline-state.success,
.selection-bar em.success {
  background: var(--green-weak);
  color: var(--green);
}

.inline-state.warning,
.selection-bar em.warning {
  background: var(--orange-weak);
  color: var(--orange);
}
.hint-panel { padding: 14px 16px; margin-bottom: 18px; }

.stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

.steps {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.steps span {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-weight: 800;
}

.steps b { display: block; margin-bottom: 3px; }
.steps p { margin: 0; }
.steps.compact { gap: 12px; }

.filters { margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 160px; flex: 1 1 160px; }

.advanced-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: center;
  gap: 10px;
  margin: -4px 0 16px;
  padding: 14px;
  border: 1px solid #dce6f5;
  border-radius: 8px;
  background: #f8fbff;
}

.advanced-filters input,
.advanced-filters select {
  width: 100%;
  min-width: 0;
  margin: 0;
  background: #fff;
}

.column-settings {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -4px 0 16px;
  padding: 12px 14px;
  border: 1px solid #dce6f5;
  border-radius: 8px;
  background: #fff;
}

.column-settings label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdff;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.column-settings input {
  width: auto;
  min-width: 0;
  margin: 0;
  flex: 0 0 auto;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e5edf5;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}

th {
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  background: #f7f9fc;
}

th, td {
  border-bottom: 1px solid #e5edf5;
  padding: 13px 12px;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbff; }

.row-actions { flex-wrap: nowrap; }
.clickable-row { cursor: pointer; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.detail-grid.compact { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfdff;
  display: grid;
  gap: 5px;
}

.detail-item span {
  color: var(--muted);
  font-size: 12px;
}

.detail-item b {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.inner-panel {
  margin-top: 14px;
  box-shadow: none;
}

.usage-analytics {
  display: grid;
  gap: 14px;
}

.usage-analytics-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: center;
}

.usage-analytics-toolbar input,
.usage-analytics-toolbar select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.usage-analytics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.usage-analytics-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.usage-analytics-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  text-align: left;
}

.usage-analytics-tabs button span {
  font-size: 13px;
  color: var(--ink);
}

.usage-analytics-tabs button em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.usage-analytics-tabs button.active {
  border-color: rgba(37, 99, 235, .35);
  background: #eef5ff;
}

.usage-analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.usage-analytics-summary > div,
.usage-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  display: grid;
  gap: 4px;
}

.usage-analytics-summary strong,
.usage-metric strong {
  font-size: 17px;
  color: var(--ink);
}

.usage-analytics-summary span,
.usage-metric span,
.usage-analytics-note {
  color: var(--muted);
  font-size: 12px;
}

.usage-analytics-note {
  margin: 0;
}

.ledger-usage-panel {
  display: grid;
  gap: 16px;
}

.ledger-usage-panel .section-head {
  align-items: center;
  gap: 14px;
}

.ledger-usage-panel .quick-row {
  width: auto;
  justify-content: flex-end;
}

.ledger-usage-range {
  width: 118px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
}

.usage-analytics-summary-ledger {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ledger-usage-table {
  gap: 12px;
}

.ledger-usage-chart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: stretch;
}

.ledger-usage-chart-main,
.ledger-chart-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ledger-usage-chart-main {
  padding: 16px;
}

.ledger-usage-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.ledger-usage-chart-head h3,
.ledger-chart-card h4 {
  margin: 0;
  font-size: 16px;
}

.ledger-usage-chart-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ledger-chart-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--primary-weak);
  color: var(--primary);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.ledger-usage-chart-frame {
  position: relative;
  min-height: 260px;
  padding: 26px 10px 42px 56px;
  overflow-x: auto;
}

.ledger-chart-grid {
  position: absolute;
  inset: 26px 10px 42px 56px;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  pointer-events: none;
}

.ledger-chart-grid span {
  border-top: 1px solid #edf2f8;
}

.ledger-chart-bars {
  position: relative;
  z-index: 1;
  min-width: max(100%, calc(var(--ledger-chart-columns, 1) * 58px));
  height: 210px;
  display: grid;
  grid-template-columns: repeat(var(--ledger-chart-columns, 1), minmax(28px, 1fr));
  gap: 18px;
  align-items: end;
}

.ledger-chart-bar {
  height: 100%;
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 8px;
}

.ledger-chart-bar i {
  width: 100%;
  max-width: 34px;
  min-height: 10px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, rgba(18, 103, 255, .82), rgba(90, 178, 255, .32));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.ledger-chart-bar small {
  position: absolute;
  bottom: 8px;
  transform: translateY(32px);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.ledger-chart-scale {
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 38px;
  width: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.ledger-usage-chart-side {
  display: grid;
  gap: 14px;
}

.ledger-chart-card {
  padding: 14px;
}

.ledger-chart-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ledger-chart-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 10px;
  border-radius: 8px;
  background: #fbfdff;
  border: 1px solid #eef3fa;
}

.ledger-chart-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 700;
}

.ledger-chart-list b {
  color: var(--primary);
  font-size: 13px;
}

.ledger-chart-list small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.ledger-chart-empty {
  margin: 0;
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  flex-wrap: wrap;
}

.pager button, .pager select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 9px 12px;
}

.pager label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.pager input { width: 74px; padding: 9px 10px; }

.drawer {
  position: fixed;
  right: 18px;
  top: 88px;
  width: min(360px, calc(100vw - 36px));
  max-height: calc(100vh - 106px);
  overflow: auto;
  padding: 20px;
  z-index: 11;
  box-shadow: var(--shadow);
}

.drawer-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.chart {
  height: 240px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: end;
  gap: clamp(8px, 2vw, 18px);
  padding: 14px 14px 0;
}

.chart i {
  flex: 1;
  min-width: 12px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #2563eb, #7dd3fc);
}

.profile-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-tabs {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.profile-tabs button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 11px;
  border-radius: 7px;
}

.profile-tabs button.active {
  background: #111827;
  color: #fff;
}

.settings { display: grid; }

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  gap: 18px;
}

.setting-row:last-child { border-bottom: 0; }
.setting-row input { width: auto; transform: scale(1.2); flex: 0 0 auto; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #24324a;
}

.toggle input { width: auto; }

details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

details:last-child { padding-bottom: 0; }
summary { cursor: pointer; font-weight: 700; }

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-button {
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tag-button .tag {
  cursor: pointer;
}

.tag-button:focus-visible {
  outline: 3px solid rgba(18, 103, 255, .2);
  outline-offset: 3px;
  border-radius: 999px;
}

.tag.success { background: var(--green-weak); color: var(--green); }
.tag.warning { background: var(--orange-weak); color: var(--orange); }
.tag.info { background: var(--primary-weak); color: var(--primary); }
.tag.dark { background: #111827; color: #fff; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  align-items: center;
  justify-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .38);
  z-index: 30;
  overflow: auto;
  overscroll-behavior: contain;
}

.modal {
  width: min(520px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
  margin: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}

.modal h2 {
  margin: 0;
  font-size: 20px;
}

.modal p { color: var(--muted); }

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, .35);
  z-index: 9;
}

@media (max-width: 1180px) {
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .sidebar { padding: 18px; }
  .grid.two, .grid.two.uneven { grid-template-columns: 1fr; }
  .key-card, .download, .hero-balance { align-items: flex-start; flex-direction: column; }
  .page-title { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 860px) {
  .auth-page { padding: 18px; }
  .auth-shell { grid-template-columns: 1fr; align-content: center; }
  .auth-aside { min-height: auto; }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(290px, calc(100vw - 56px));
    transform: translateX(-102%);
    transition: transform .18s ease;
    z-index: 10;
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .app-shell.nav-open .scrim { display: block; }
  .menu-btn { display: inline-grid; }
  .topbar { height: 64px; }
  .top-shortcuts { max-width: calc(100vw - 190px); }
  .top-shortcut { padding: 7px 9px; }
  .content { padding: 18px; }
  .grid.three, .grid.four { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-tabs { display: flex; overflow-x: auto; }
  .profile-tabs button { white-space: nowrap; }
  .filters { display: grid; grid-template-columns: 1fr; }
  .filters input, .filters select, .filters .btn { width: 100%; }
  .row-actions { flex-wrap: wrap; }
  .ledger-usage-chart { grid-template-columns: 1fr; }
  .usage-analytics-summary-ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .auth-aside { display: none; }
  .auth-card { padding: 22px; }
  .auth-links { align-items: flex-start; flex-direction: column; }
  .role-preview { align-items: flex-start; flex-direction: column; }
  .top-actions .icon-btn { display: none; }
  .avatar { padding: 9px 11px; }
  .hero-balance strong { font-size: 34px; }
  .stat { min-height: auto; }
  .quick-row { width: 100%; }
  .quick-row .btn { flex: 1 1 150px; }
  .segmented { width: 100%; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .pager { justify-content: flex-start; }
  .focus-tabs { grid-template-columns: 1fr; }
  .ledger-usage-panel .quick-row { justify-content: flex-start; }
  .ledger-usage-range { width: 100%; }
  .usage-analytics-summary-ledger { grid-template-columns: 1fr; }
  .ledger-usage-chart-frame { padding-left: 48px; }
  .ledger-chart-grid { left: 48px; }
}

/* Prototype polish layer: closer to the generated visual direction. */
.app-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
  flex: 0 0 auto;
}

.app-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.app-icon.green { background: var(--green-weak); color: var(--green); }
.app-icon.purple { background: var(--purple-weak); color: var(--purple); }
.app-icon.orange { background: var(--orange-weak); color: var(--orange); }
.app-icon.blue { background: var(--primary-weak); color: var(--primary); }

.brand-mark svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke-width: 2.35;
}

.auth-card {
  z-index: 1;
}

.auth-aside {
  transform: translateX(-1px);
}

.auth-card .tabs {
  margin: 22px 0 20px;
  padding: 0;
  gap: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.auth-card .tab {
  min-height: 42px;
  border-radius: 0;
  font-size: 17px;
  color: #64728e;
  background: transparent;
}

.auth-card .tab.active {
  background: transparent;
  color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.field-label {
  font-weight: 700;
  color: #17233d;
}

.input-shell {
  min-height: 50px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.input-shell:focus-within {
  border-color: rgba(18, 103, 255, .52);
  box-shadow: 0 0 0 4px rgba(18, 103, 255, .08);
}

.input-shell input {
  height: 48px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.input-shell .app-icon {
  width: 22px;
  height: 22px;
  background: transparent;
  color: #99a8bf;
}

.input-shell .app-icon svg {
  width: 18px;
  height: 18px;
}

.input-shell .input-trail {
  margin-left: 4px;
}

.password-toggle {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8494ad;
  display: grid;
  place-items: center;
  padding: 0;
}

.password-toggle:hover,
.password-toggle.active {
  background: #eef5ff;
  color: var(--primary);
}

.password-toggle .input-trail {
  margin-left: 0;
}

.form-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
}

.form-meta button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}

.check-row {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  margin: 0 !important;
  font-weight: 500;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.auth-card > .btn {
  min-height: 50px;
  box-shadow: 0 14px 28px rgba(18, 103, 255, .18);
}

.auth-links {
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  margin-top: 18px;
}

.role-preview {
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
  padding-top: 20px;
}

.role-preview button {
  padding: 4px 0;
}

.security-visual {
  position: relative;
  width: 290px;
  height: 190px;
  margin: 0 auto 10px;
}

.security-visual::before {
  content: "";
  position: absolute;
  inset: 18px 34px 20px 72px;
  border-radius: 999px;
  background: rgba(18, 103, 255, .11);
}

.visual-card {
  position: absolute;
  right: 18px;
  top: 30px;
  width: 148px;
  height: 108px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 38px rgba(75, 115, 180, .16);
}

.visual-card::before,
.visual-card::after {
  content: "";
  position: absolute;
  left: 58px;
  height: 8px;
  border-radius: 999px;
  background: #dce8fb;
}

.visual-card::before { top: 32px; width: 70px; }
.visual-card::after { top: 62px; width: 92px; }

.visual-shield {
  position: absolute;
  left: 30px;
  top: 50px;
  width: 76px;
  height: 86px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 96% 18%, 90% 70%, 50% 100%, 10% 70%, 4% 18%);
  background: linear-gradient(180deg, #6aa9ff, #0f6eff);
  color: #fff;
  font-size: 42px;
  font-weight: 800;
  z-index: 2;
}

.visual-lock {
  position: absolute;
  left: 94px;
  top: 104px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .95);
  color: #8db3f5;
  font-size: 14px;
  box-shadow: 0 14px 28px rgba(75, 115, 180, .16);
  z-index: 3;
}

.aside-list {
  display: grid;
  gap: 22px;
}

.aside-list > div {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 15px;
  align-items: start;
}

.aside-list b {
  display: block;
  color: var(--ink);
  font-size: 17px;
  margin-bottom: 4px;
}

.aside-list small {
  display: block;
  line-height: 1.7;
}

.auth-footer {
  display: grid;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 0 0 28px;
  color: var(--muted);
}

.auth-footer div {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.auth-footer small {
  font-size: 13px;
}

.app-shell { grid-template-columns: 288px minmax(0, 1fr); }
.sidebar {
  background: #fff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 28px 24px;
  box-shadow: 8px 0 30px rgba(38, 71, 132, .025);
}

.sidebar nav {
  gap: 10px;
}

.logo small { color: var(--muted); }
.nav-item {
  min-height: 54px;
  gap: 14px;
  color: #2f3d59;
  padding: 14px 16px;
}

.nav-item span,
.nav-item .app-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  color: #50607c;
}

.nav-item .app-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.85;
}

.nav-item.active,
.nav-item:hover {
  background: var(--primary-weak);
  color: var(--primary);
}

.nav-item.active .app-icon,
.nav-item:hover .app-icon {
  background: transparent;
  color: var(--primary);
}

.role-box {
  background: var(--nav-soft);
  color: #33415f;
}

.role-box span,
.role-box small {
  color: var(--muted);
}

.topbar {
  height: 66px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
}

.top-actions .icon-btn {
  border-radius: 10px;
}

.icon-btn .app-icon {
  width: 22px;
  height: 22px;
  background: transparent;
}

.icon-btn .app-icon svg {
  width: 18px;
  height: 18px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.avatar span {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}

.content {
  max-width: 1540px;
  margin: 0 auto;
  padding: clamp(34px, 3.8vw, 52px) clamp(28px, 3.8vw, 54px);
}

.panel,
.stat,
.hero-balance {
  box-shadow: var(--shadow-soft);
}

.panel,
.stat,
.hero-balance,
.action-strip button {
  border-color: #dde7f5;
  box-shadow: 0 8px 22px rgba(38, 71, 132, .045);
}

.btn.primary {
  box-shadow: 0 10px 22px rgba(18, 103, 255, .18);
}

.btn.secondary {
  background: #f7f9fd;
}

.stat {
  min-height: 136px;
  padding: 24px 28px;
  position: relative;
  transition: box-shadow .16s ease, border-color .16s ease;
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  text-align: left;
  font: inherit;
}

.stat:hover,
.panel:hover,
.hero-balance:hover,
.action-strip button:hover {
  border-color: #ccd9eb;
  box-shadow: 0 12px 28px rgba(38, 71, 132, .07);
}

.stat > span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #2f3d59;
  font-weight: 700;
}

.stat strong {
  display: block;
  position: relative;
  font-size: clamp(30px, 2.65vw, 40px);
  line-height: 1;
  margin-top: 8px;
  padding-top: 22px;
  white-space: nowrap;
}

.stat strong .unit {
  font-size: .58em;
  font-weight: 700;
}

.stat-corner-unit {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f1f6ff;
  color: #627391;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.stat-number {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat.clickable {
  cursor: pointer;
}

.stat.clickable:hover {
  background: #fbfdff;
}

.stat.clickable:focus-visible {
  outline: 3px solid rgba(18, 103, 255, .22);
  outline-offset: 3px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 20px;
}

.hero-balance {
  padding: 0;
  display: grid;
  grid-template-columns: minmax(320px, .58fr) 1fr;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  margin-bottom: 20px;
}

.balance-main {
  padding: 52px 52px;
  background:
    radial-gradient(circle at 12% 0, rgba(255, 255, 255, .62), transparent 38%),
    linear-gradient(135deg, rgba(18, 103, 255, .105), rgba(18, 103, 255, .025));
}

.balance-main > span {
  display: block;
  color: #2f3d59;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}

.balance-main strong {
  display: block;
  font-size: clamp(54px, 7vw, 76px);
  line-height: .95;
  color: var(--primary);
  letter-spacing: 0;
}

.balance-main strong span {
  margin-left: 10px;
  font-size: clamp(20px, 2.5vw, 28px);
  color: var(--primary);
  font-weight: 500;
}

.balance-main p {
  margin: 14px 0 0;
  color: var(--muted);
}

.balance-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  padding: 42px 24px;
}

.balance-metrics div {
  min-width: 0;
  padding: 0 clamp(16px, 2vw, 30px);
  border-left: 1px solid var(--line);
}

.balance-metrics span {
  display: block;
  color: #2f3d59;
  font-weight: 700;
  margin-bottom: 12px;
}

.balance-metrics b {
  display: block;
  font-size: clamp(23px, 1.85vw, 31px);
  line-height: 1.1;
  font-weight: 600;
  white-space: nowrap;
}

.balance-metrics small {
  display: block;
  margin-top: 9px;
}

.action-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.action-strip button {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  text-align: left;
  color: var(--ink);
}

.action-strip button:hover {
  border-color: #cbd8ea;
}

.action-strip b {
  display: block;
  font-size: 17px;
}

.action-strip .app-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.action-strip .app-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.action-strip small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.steps-panel .steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.steps-panel .steps li {
  position: relative;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
}

.steps-panel .steps li + li::before {
  content: "→";
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #9aabc4;
  font-size: 26px;
  font-weight: 300;
}

.steps-panel .steps span {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 22px;
  font-weight: 600;
}

.steps-panel .steps b {
  font-size: 17px;
}

.steps-panel .steps p {
  color: var(--muted);
}

.chart.trend-chart {
  position: relative;
  height: 320px;
  display: block;
  border: 0;
  padding: 44px 54px 52px 54px;
  overflow: hidden;
}

.chart-grid {
  position: absolute;
  left: 54px;
  right: 54px;
  top: 54px;
  bottom: 66px;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
}

.chart-grid span {
  border-top: 1px solid #e8eef7;
}

.chart-bars {
  position: absolute;
  left: 70px;
  right: 70px;
  top: 54px;
  bottom: 66px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 38px;
  align-items: end;
}

.chart-bars i {
  position: relative;
  display: block;
  min-width: 28px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(18, 103, 255, .20), rgba(18, 103, 255, .08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.chart-bars small {
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #6c7b99;
}

.trend-line {
  position: absolute;
  left: 70px;
  right: 70px;
  top: 54px;
  bottom: 66px;
  width: calc(100% - 140px);
  height: calc(100% - 120px);
  overflow: visible;
}

.trend-line polyline {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
}

.trend-line circle {
  fill: #fff;
  stroke: var(--primary);
  stroke-width: 3;
}

.chart-scale {
  position: absolute;
  top: 48px;
  bottom: 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #71809d;
  font-size: 12px;
}

.chart-scale.left { left: 0; }
.chart-scale.right {
  right: 0;
  text-align: right;
}

.chart-legend {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 34px;
  color: #687995;
  font-size: 13px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chart-legend i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(18, 103, 255, .16);
}

.chart-legend b {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  align-items: stretch;
}

.overview-layout.lower {
  align-items: start;
}

.focus-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.focus-head {
  align-items: flex-start;
}

.focus-head h2 {
  margin-bottom: 4px;
}

.focus-head p {
  margin: 0;
}

.focus-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  flex: 0 0 auto;
}

.btn.mini {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}

.focus-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid #dce6f5;
  border-radius: 8px;
  background: #f7faff;
}

.focus-tabs button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #445470;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  font-weight: 800;
  white-space: nowrap;
}

.focus-tabs button:hover {
  border-color: #c9d8ec;
  background: #fff;
}

.focus-tabs button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(18, 103, 255, .18);
}

.focus-tabs em {
  min-width: 23px;
  height: 23px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(18, 103, 255, .10);
  color: var(--primary);
  font-style: normal;
  font-size: 12px;
}

.focus-tabs button.active em {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

.focus-summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid #e1eaf6;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff, #f6f9ff);
}

.focus-summary strong {
  font-size: 15px;
}

.focus-summary span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.focus-panel .table-wrap {
  border-color: #dce6f5;
}

.focus-panel table {
  min-width: 880px;
}

.focus-panel th,
.focus-panel td {
  padding: 12px 10px;
}

.trend-panel .chart {
  height: 320px;
}

.ops-panel .stack .btn {
  width: 100%;
}

.range-tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.range-tabs button {
  border: 0;
  background: #fff;
  padding: 9px 18px;
  color: var(--muted);
}

.range-tabs button.active {
  background: var(--primary);
  color: #fff;
}

table {
  border-collapse: collapse;
}

tbody tr:hover {
  background: rgba(18, 103, 255, .025);
}

.status-list {
  display: grid;
  gap: 12px;
}

.status-list div {
  min-height: 42px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.pool-panel {
  display: grid;
  gap: 18px;
}

.pool-toolbar,
.pool-control-row,
.pool-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.pool-tabs,
.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #dce6f5;
  border-radius: 8px;
  background: #f7faff;
}

.pool-tabs button,
.view-switch button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #445470;
  padding: 7px 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pool-tabs button:hover,
.view-switch button:hover {
  border-color: #c9d8ec;
  background: #fff;
}

.pool-tabs button.active,
.view-switch button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(18, 103, 255, .16);
}

.pool-filters {
  margin: 0;
  flex: 1 1 560px;
}

.selection-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #dce6f5;
  border-radius: 8px;
  background: #f8fbff;
  color: #42516b;
}

.selection-bar > span,
.selection-bar > em {
  color: var(--muted);
  font-size: 13px;
}

.selection-bar > em {
  font-style: normal;
  color: var(--primary);
}

.selection-mode {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid #d7e4f3;
  border-radius: 8px;
  background: #fff;
}

.selection-mode button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 5px 10px;
  color: #52627d;
  font-weight: 800;
}

.selection-mode button.active {
  background: var(--primary);
  color: #fff;
}

.select-all-row {
  gap: 7px;
  margin: 0;
  color: #334155;
  font-weight: 700;
}

.pool-compact-list {
  display: grid;
  gap: 8px;
}

.pool-compact-row {
  display: grid;
  grid-template-columns: 34px minmax(220px, 1.35fr) minmax(120px, .75fr) 48px minmax(116px, .75fr) minmax(116px, .75fr) 88px auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e3ebf6;
  border-radius: 8px;
  background: #fff;
}

.pool-compact-row.selected,
.pool-account-card.selected {
  border-color: #8cb8ff;
  background: #f8fbff;
}

.pool-select {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  margin: 0;
  cursor: pointer;
}

.pool-select input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.pool-compact-row:hover,
.pool-account-card:hover {
  border-color: #cbdcf1;
  box-shadow: 0 10px 24px rgba(31, 56, 88, .07);
}

.pool-account-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pool-account-main strong,
.pool-account-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pool-account-main span,
.pool-account-card span,
.pool-meta,
.quota-bar span {
  color: var(--muted);
  font-size: 12px;
}

.quota-meter {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 108px;
  height: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3fb;
  border: 1px solid #dae5f2;
}

.quota-meter i {
  height: 100%;
  border-radius: inherit;
  background: #7aa7ff;
}

.quota-meter.empty i { background: #cbd5e1; }
.quota-meter.low i { background: #f59e0b; }
.quota-meter.mid i { background: #2f7eff; }
.quota-meter.high i { background: #16a34a; }

.quota-meter b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #1f2a44;
}

.pool-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pool-account-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e3ebf6;
  border-radius: 8px;
  background: #fff;
}

.pool-account-card header {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.pool-account-card header div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pool-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pool-meta b {
  color: var(--primary);
}

.pool-meta em {
  font-style: normal;
  color: #334155;
}

.quota-bars {
  display: grid;
  gap: 10px;
}

.quota-bar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.quota-bar .quota-meter {
  width: 100%;
}

.modal-lg {
  width: min(720px, 100%);
}

.modal-xl {
  width: min(980px, 100%);
}

.account-profile-modal {
  display: grid;
  gap: 14px;
}

.account-profile-tabs {
  margin: 0;
}

.inner-panel {
  box-shadow: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid textarea {
  min-height: 96px;
  resize: vertical;
}

.add-account-modal {
  display: grid;
  gap: 16px;
}

.add-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid #dce6f5;
  border-radius: 8px;
  background: #f7faff;
}

.add-tabs button {
  flex: 1;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #445470;
  font-weight: 800;
}

.add-tabs button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(18, 103, 255, .16);
}

.add-panel {
  display: grid;
  gap: 14px;
}

.add-panel p {
  margin: 0;
}

.oauth-hint,
.sync-summary {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dce6f5;
  border-radius: 8px;
  background: #f8fbff;
}

.oauth-actions,
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.oauth-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.format-example {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.format-example summary {
  cursor: pointer;
  font-weight: 800;
}

.format-example pre {
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
}

.credential-input {
  min-height: 150px;
  resize: vertical;
}

.import-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.import-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid #dce6f5;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.import-option span {
  display: grid;
  gap: 5px;
}

.import-option small {
  color: var(--muted);
}

.promo-panel {
  display: grid;
  gap: 16px;
}

.promo-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.promo-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.promo-advanced {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .metric-row,
  .action-strip,
  .balance-metrics,
  .steps-panel .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-balance,
  .overview-layout {
    grid-template-columns: 1fr;
  }

  .pool-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pool-compact-row {
    grid-template-columns: 34px minmax(220px, 1.4fr) minmax(120px, .8fr) 48px minmax(110px, .7fr) minmax(110px, .7fr);
  }

  .pool-compact-row > .tag,
  .pool-compact-row > .row-actions {
    justify-self: start;
  }

  .focus-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .promo-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .balance-metrics div {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px;
  }
}

@media (max-width: 1360px) {
  .balance-metrics b {
    font-size: 24px;
    white-space: normal;
  }

  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .auth-brand {
    min-height: 76px;
    padding: 0 18px;
  }

  .auth-nav { display: none; }
  .auth-shell {
    width: min(520px, calc(100% - 32px));
    margin: 28px auto;
  }

  .auth-card {
    border-radius: 12px;
  }

  .auth-aside { display: none; }
  .metric-row,
  .action-strip,
  .balance-metrics,
  .steps-panel .steps {
    grid-template-columns: 1fr;
  }

  .steps-panel .steps li + li::before {
    display: none;
  }

  .pool-toolbar,
  .pool-control-row,
  .pool-subhead {
    align-items: stretch;
    flex-direction: column;
  }

  .pool-tabs,
  .view-switch {
    width: 100%;
    overflow-x: auto;
  }

  .pool-tabs button,
  .view-switch button {
    flex: 1 0 auto;
  }

  .pool-card-grid,
  .pool-compact-row,
  .import-options,
  .promo-summary,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .pool-compact-row {
    align-items: start;
  }

  .selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-bar .quick-row,
  .selection-mode,
  .oauth-link-row {
    width: 100%;
  }

  .selection-mode button,
  .oauth-link-row .btn {
    flex: 1;
  }

  .focus-tools {
    width: 100%;
    justify-content: space-between;
  }

  .focus-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .focus-summary span {
    text-align: left;
  }
}
