:root {
  --bg: #f5f8ff;
  --bg-accent:
    radial-gradient(circle at top left, rgba(127, 145, 255, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(84, 215, 184, 0.18), transparent 30%),
    radial-gradient(circle at bottom center, rgba(108, 200, 238, 0.14), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 48%, #eefaf5 100%);
  --surface: rgba(255, 255, 255, 0.8);
  --surface-muted: linear-gradient(180deg, rgba(248, 252, 255, 0.95) 0%, rgba(240, 250, 246, 0.94) 100%);
  --line: rgba(126, 153, 214, 0.16);
  --line-strong: rgba(109, 143, 212, 0.3);
  --text: #27405a;
  --muted: #6a7f9f;
  --muted-soft: #8ea0bc;
  --primary: #54d7b8;
  --primary-strong: #7f91ff;
  --primary-soft: rgba(84, 215, 184, 0.13);
  --primary-gradient: linear-gradient(135deg, #54d7b8 0%, #6cc8ee 52%, #7f91ff 100%);
  --success-bg: #edf9f2;
  --success-text: #2a8c63;
  --warning-bg: #fff6e8;
  --warning-text: #b07721;
  --danger-bg: #fff0f5;
  --danger-text: #ca5a87;
  --neutral-bg: #eef3ff;
  --neutral-text: #5f7190;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px rgba(104, 128, 187, 0.1);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-accent);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; }
code {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--neutral-bg);
  border: 1px solid var(--line);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 22px 20px;
  border-right: 1px solid rgba(127, 145, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(246, 250, 255, 0.96) 0%, rgba(239, 251, 247, 0.97) 100%),
    radial-gradient(circle at top, rgba(127, 145, 255, 0.12), transparent 42%);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.main-shell {
  padding: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel-soft {
  background: var(--surface-muted);
}

.panel-dark {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
}

.brand-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px 18px 22px;
  margin-bottom: 10px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(243, 249, 255, 0.96) 52%, rgba(237, 251, 246, 0.96) 100%);
}

.brand-mark-wrap {
  width: 100%;
  display: grid;
  place-items: center;
}

.brand-mark {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(236, 250, 245, 0.98) 100%);
  border: 1px solid rgba(127, 145, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 16px 34px rgba(113, 142, 216, 0.14);
}

.brand-mark svg {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 14px 26px rgba(92, 159, 214, 0.16));
}

.brand-copy {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.brand-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.2;
  text-align: center;
}

.brand-subtitle {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-card p,
.sidebar-help p,
.topbar p,
.metric-card small,
.entity-card p,
.mini-row p,
.inline-tip,
.empty-state,
.log-meta,
.log-card time,
.guide-item p,
.notice-banner span,
.alert-banner,
.search-pill,
.info-card span {
  color: var(--muted);
}

.overline {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #3a8f88;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.overline-dark {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.82);
}

.sidebar-label {
  margin: 22px 6px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #91a0c8;
  font-weight: 700;
}

.sidebar-label.muted { margin-top: 0; }

.sidebar-block,
.sidebar-help {
  padding: 18px;
}

.sidebar-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sidebar-meta-grid span,
.detail-grid span,
.metric-label,
.form-grid label span {
  display: block;
  color: var(--muted-soft);
  font-size: 12px;
  margin-bottom: 8px;
}

.sidebar-meta-grid strong,
.detail-grid strong,
.metric-card strong {
  font-size: 18px;
  color: var(--text);
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(127, 145, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(243, 249, 255, 0.88) 100%);
  transition: 180ms ease;
  box-shadow: 0 10px 24px rgba(96, 118, 172, 0.05);
}

.nav-link:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 30px rgba(96, 118, 172, 0.08);
}

.nav-link.active {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 18px 34px rgba(107, 137, 232, 0.24);
}

.nav-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  background: rgba(236, 245, 255, 0.92);
  color: #6488df;
  font-size: 16px;
  font-weight: 700;
}

.nav-link.active .nav-icon {
  background: rgba(255,255,255,0.2);
  color: #ffffff;
}

.nav-title {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.nav-link.active .nav-sub { color: rgba(255,255,255,0.8); }
.nav-sub { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; }

.sidebar-help { margin-top: 18px; }
.sidebar-help h3 { font-size: 18px; margin: 8px 0 10px; }
.sidebar-help p { line-height: 1.7; font-size: 14px; }

.topbar {
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.topbar h2 {
  margin-top: 10px;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.topbar p {
  margin-top: 12px;
  max-width: 720px;
  line-height: 1.7;
}

.topbar-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.search-pill {
  min-width: 240px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.alert-banner,
.notice-banner {
  margin-top: 0;
  margin-bottom: 16px;
  padding: 16px 20px;
  line-height: 1.7;
}

.notice-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-card,
.metric-card,
.alert-banner,
.notice-banner {
  background-clip: padding-box;
}

.metrics-grid {
  display: grid;
  gap: 16px;
  margin-top: 0;
}

.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four-up { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.metric-card {
  padding: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(244, 248, 255, 0.95) 48%, rgba(240, 251, 246, 0.95) 100%);
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 38px;
  letter-spacing: -0.04em;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  line-height: 1.6;
}

.split-layout {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.account-page-grid { grid-template-columns: 0.94fr 1.06fr; }
.task-page-grid { grid-template-columns: 0.95fr 1.25fr; }
.test-page-grid { grid-template-columns: 1fr 1fr; }

.section-card {
  padding: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.section-head-wrap {
  flex-wrap: wrap;
}

.section-head h3 {
  margin-top: 10px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.two-col-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-span { grid-column: 1 / -1; }
.hidden-field { display: none !important; }

label { display: block; }
input:not([type="hidden"]),
select,
textarea,
.input {
  width: 100%;
  max-width: none;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(127, 145, 255, 0.14);
  outline: none;
  transition: all 0.25s ease;
  box-shadow: 0 0 20px -18px rgba(108, 130, 214, 0.9);
  background: rgba(247, 250, 255, 0.92);
  color: var(--text);
}

input:not([type="hidden"]),
select {
  min-height: 46px;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input:not([type="hidden"]):hover,
select:hover,
textarea:hover,
.input:hover {
  border-color: rgba(127, 145, 255, 0.28);
  box-shadow: 0 0 20px -17px rgba(108, 130, 214, 0.95);
}

input:not([type="hidden"]):active,
select:active,
textarea:active,
.input:active {
  transform: scale(0.995);
}

input:not([type="hidden"]):focus,
select:focus,
textarea:focus,
.input:focus {
  border-color: rgba(108, 200, 238, 0.72);
  box-shadow: 0 0 0 4px rgba(127, 145, 255, 0.12);
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: var(--primary-gradient);
  color: #ffffff;
  cursor: pointer;
  transition: 180ms ease;
  box-shadow: 0 14px 28px rgba(70, 162, 176, 0.22);
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(70, 162, 176, 0.28);
}

button.secondary,
.secondary-link {
  background: rgba(244, 248, 255, 0.96);
  color: var(--text);
  border-color: rgba(127, 145, 255, 0.16);
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, #ff8aad 0%, #ff6f98 100%);
  color: #ffffff;
  border-color: transparent;
}

.inline-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-actions-stack {
  align-items: flex-start;
}

.inline-tip { font-size: 14px; line-height: 1.6; max-width: 560px; }

.chip,
.close-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.chip-soft { background: rgba(243, 248, 255, 0.95); color: var(--neutral-text); border-color: rgba(127, 145, 255, 0.14); }
.chip-good { background: var(--success-bg); color: var(--success-text); border-color: #d4eee0; }
.chip-warn { background: var(--warning-bg); color: var(--warning-text); border-color: #f3dfba; }
.chip-bad { background: var(--danger-bg); color: var(--danger-text); border-color: #f7d5df; }
.chip-neutral { background: var(--neutral-bg); color: var(--neutral-text); border-color: rgba(127, 145, 255, 0.14); }

.stack-list,
.card-list,
.log-list,
.guide-list { display: grid; gap: 14px; }
.compact-list { gap: 12px; }

.mini-row,
.entity-card,
.info-card,
.guide-item,
.log-card {
  border: 1px solid var(--line);
  background: var(--surface-muted);
  border-radius: 20px;
}

.mini-row,
.guide-item,
.log-card,
.entity-card,
.info-card {
  padding: 16px;
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.entity-top,
.log-top-row,
.action-row,
.chip-group {
  display: flex;
  gap: 10px;
}

.entity-top,
.log-top-row {
  justify-content: space-between;
  align-items: flex-start;
}

.entity-top-wrap { flex-wrap: wrap; }
.wrap-right { justify-content: flex-end; flex-wrap: wrap; }

.entity-card h4,
.guide-item strong,
.log-message {
  font-size: 18px;
}

.entity-card p,
.log-message,
.guide-item p {
  margin-top: 8px;
  line-height: 1.7;
}

.action-row {
  margin-top: 16px;
  flex-wrap: wrap;
}

.centered-submit-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.verify-action-row {
  justify-content: center;
}

.inline-form {
  margin: 0;
}

.account-list-stack {
  gap: 12px;
}

.account-card-row {
  background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(243,248,255,0.94) 50%, rgba(240,251,246,0.94) 100%);
}

.account-overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-grid > div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.94);
  border: 1px solid var(--line);
}

.message-stack {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.message-line {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.94);
  border: 1px solid var(--line);
  line-height: 1.6;
}

.error-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid #f6d4df;
  line-height: 1.6;
}

.log-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(245, 249, 255, 0.96) 100%);
}

.log-meta {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
}

.level-error { border-left: 4px solid #ff6d99; }
.level-warning { border-left: 4px solid #d7a04f; }
.level-success { border-left: 4px solid #4cb89a; }
.level-info { border-left: 4px solid #77a8ff; }

.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-card { padding: 18px; }
.compact-card .chip { margin-top: 14px; }

.info-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.info-card strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.empty-state {
  padding: 36px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.88) 0%, rgba(239, 251, 247, 0.88) 100%);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(39, 64, 90, 0.2);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-panel {
  width: min(560px, calc(100vw - 40px));
  padding: 22px;
}

.modal-head { margin-bottom: 16px; }
.close-link {
  background: #ffffff;
  color: var(--text);
}

.narrow-card {
  max-width: 760px;
}

.sticky-card {
  position: sticky;
  top: 24px;
  align-self: start;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .three-up,
  .four-up,
  .account-page-grid,
  .task-page-grid,
  .test-page-grid,
  .compact-grid,
  .account-overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sticky-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .main-shell,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .section-card,
  .metric-card,
  .brand-card,
  .sidebar-block,
  .sidebar-help {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 30px;
  }

  .topbar-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .search-pill {
    width: 100%;
    min-width: 0;
  }

  .three-up,
  .four-up,
  .account-page-grid,
  .task-page-grid,
  .test-page-grid,
  .compact-grid,
  .account-overview-grid,
  .form-grid,
  .sidebar-meta-grid,
  .info-card,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .mini-row,
  .section-head,
  .entity-top,
  .entity-top-wrap,
  .log-top-row,
  .nav-link {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-card {
    padding-bottom: 12px;
  }
}

/* v7 overrides */
body {
  background:
    radial-gradient(circle at top left, rgba(124, 204, 232, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(131, 171, 255, 0.16), transparent 32%),
    radial-gradient(circle at bottom center, rgba(121, 228, 194, 0.16), transparent 30%),
    linear-gradient(180deg, #f7fcff 0%, #eef8ff 52%, #eefbf5 100%);
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 16px;
}

.sidebar-main,
.sidebar-footer {
  display: grid;
  gap: 14px;
}

.brand-card {
  gap: 10px;
  padding: 18px 16px 16px;
  min-height: auto;
}

.brand-mark {
  width: 86px;
  height: 86px;
  border-radius: 26px;
}

.brand-mark svg {
  width: 64px;
  height: 64px;
}

.brand-title {
  font-size: 20px;
}

.sidebar-label {
  margin: 10px 6px 8px;
}

.nav-list {
  gap: 8px;
}

.nav-link {
  padding: 12px 14px;
  border-radius: 18px;
  gap: 10px;
}

.nav-icon {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 12px;
  font-size: 14px;
}

.nav-title {
  margin-bottom: 2px;
}

.nav-sub {
  font-size: 12px;
  line-height: 1.35;
}

.sidebar-user {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-user strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.logout-button {
  min-height: 42px;
  padding: 0 14px;
}

.metrics-grid {
  gap: 12px;
}

.compact-metrics-grid {
  margin-bottom: 4px;
}

.compact-metric-card,
.metric-card {
  padding: 16px 18px;
  border-radius: 22px;
}

.compact-metric-card strong,
.metric-card strong {
  margin-top: 2px;
  font-size: 31px;
}

.compact-metric-card small,
.metric-card small {
  margin-top: 4px;
  line-height: 1.5;
}

.section-card {
  padding: 20px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h3 {
  margin-top: 8px;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.icon-button {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 16px;
  font-size: 24px;
  line-height: 1;
}

.add-account-button {
  margin-left: 6px;
}

.account-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: stretch;
  align-items: stretch;
  gap: 14px;
}

.account-card-tile {
  background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(242,248,255,0.95) 50%, rgba(240,252,247,0.96) 100%);
}

.account-meta-row {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.account-card-tile .action-row {
  margin-top: 14px;
}

.account-card-tile .action-row form {
  flex: 1 1 140px;
}

.account-card-tile .action-row button {
  width: 100%;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(39, 64, 90, 0.26);
  z-index: 50;
}

.modal-backdrop.open {
  display: grid;
}

.modal-panel {
  width: min(560px, calc(100vw - 40px));
  padding: 22px;
}

.close-link {
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.toast-stack {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 10px;
  z-index: 120;
  width: min(92vw, 520px);
}

.toast {
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(71, 97, 146, 0.18);
  border: 1px solid rgba(126, 153, 214, 0.16);
  backdrop-filter: blur(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-success {
  background: rgba(237, 249, 242, 0.96);
  color: #1f7d58;
}

.toast-error {
  background: rgba(255, 240, 245, 0.97);
  color: #bd4777;
}

.toast-warning {
  background: rgba(255, 247, 230, 0.97);
  color: #a56d14;
}

.toast-info {
  background: rgba(239, 244, 255, 0.97);
  color: #4a6898;
}

.toast-hide {
  opacity: 0;
  transform: translateY(-6px);
}

.footer-link {
  margin-top: auto;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 920px);
}

.login-card {
  padding: 28px;
}

.login-brand {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.login-brand h1 {
  margin-top: 10px;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.login-brand p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.login-form {
  max-width: 420px;
}

.full-width {
  width: 100%;
}

.login-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.6;
}

.security-card {
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .sidebar {
    display: grid;
    gap: 14px;
    justify-content: stretch;
  }

  .sidebar-user {
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .section-actions,
  .account-meta-row,
  .sidebar-user {
    justify-content: flex-start;
  }

  .login-brand {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }
}


/* v10 login + footer refinements */
.login-shell {
  width: min(100%, 520px);
}

.login-card {
  padding: 38px 34px 34px;
}

.login-brand-simple {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 16px;
  margin-bottom: 28px;
}

.login-brand-mark {
  width: 104px;
  height: 104px;
  border-radius: 30px;
}

.login-brand-simple h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.centered-form {
  max-width: 100%;
}

.sidebar {
  overflow-y: auto;
}

.sidebar-main {
  min-height: 0;
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding-top: 4px;
  background: linear-gradient(180deg, rgba(246, 250, 255, 0) 0%, rgba(242, 250, 250, 0.92) 18%, rgba(242, 250, 250, 0.98) 100%);
}

.footer-menu {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
}

.footer-user-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 2px;
}

.footer-user-meta strong {
  font-size: 15px;
}

.footer-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(127, 145, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(243, 249, 255, 0.9) 100%);
  box-shadow: 0 8px 18px rgba(96, 118, 172, 0.05);
  transition: 180ms ease;
}

.footer-menu-item:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 24px rgba(96, 118, 172, 0.08);
}

.footer-menu-item.active {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
}

.footer-menu-item.active .nav-icon {
  background: rgba(255,255,255,0.2);
  color: #ffffff;
}

.footer-menu-form {
  margin: 0;
}

.footer-button {
  cursor: pointer;
  color: var(--text);
}

.footer-button .nav-sub,
.footer-button .nav-title {
  text-align: left;
}

.footer-button .nav-icon {
  border: none;
}

@media (max-width: 760px) {
  .login-card {
    padding: 30px 22px 24px;
  }

  .login-brand-simple h1 {
    font-size: 28px;
  }
}


/* v11 compact footer, mobile layout, centered login */
.nav-list {
  gap: 7px;
}

.nav-link {
  padding: 10px 12px;
  gap: 10px;
  border-radius: 16px;
}

.nav-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 10px;
  font-size: 13px;
}

.nav-title {
  font-size: 14px;
  margin-bottom: 1px;
}

.nav-sub {
  font-size: 11px;
  line-height: 1.28;
}

.sidebar-footer {
  position: relative;
  bottom: auto;
  margin-top: auto;
  padding-top: 8px;
  background: none;
}

.account-fab-wrap {
  position: relative;
}

.account-fab {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  font-size: 18px;
  box-shadow: 0 12px 28px rgba(70, 162, 176, 0.2);
}

.account-submenu {
  position: absolute;
  left: 0;
  bottom: 56px;
  display: none;
  min-width: 158px;
  padding: 8px;
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(90, 112, 168, 0.16);
  z-index: 40;
}

.account-fab-wrap.open .account-submenu {
  display: grid;
  gap: 6px;
}

.account-submenu-user {
  padding: 4px 6px 10px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid rgba(127, 145, 255, 0.12);
  margin-bottom: 2px;
}

.account-submenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--text);
  transition: 160ms ease;
}

.account-submenu-item:hover {
  background: rgba(243, 248, 255, 0.95);
}

.account-submenu-item.active {
  background: var(--primary-gradient);
  color: #ffffff;
}

.account-submenu-form {
  margin: 0;
}

.account-submenu-button {
  justify-content: flex-start;
  min-height: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.account-submenu-button:hover {
  transform: none;
  box-shadow: none;
}

.mini-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(236, 245, 255, 0.96);
  color: #6488df;
  font-size: 12px;
  font-weight: 700;
}

.account-submenu-item.active .mini-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.toast-stack {
  width: auto;
  max-width: calc(100vw - 24px);
  justify-items: center;
  padding: 0 12px;
}

.toast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  max-width: min(88vw, 380px);
  padding: 9px 13px;
  border-radius: 12px;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

.login-shell {
  width: min(100%, 420px);
  display: grid;
  place-items: center;
}

.login-card {
  width: 100%;
}

.centered-form {
  justify-items: center;
}

.centered-form > label,
.centered-form > .login-actions {
  width: 100%;
}

.login-actions {
  display: flex;
  justify-content: center;
}

.login-submit {
  width: min(100%, 240px);
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding: 12px;
    gap: 12px;
  }

  .brand-card {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: center;
    text-align: left;
    gap: 12px;
    padding: 14px;
  }

  .brand-mark-wrap {
    width: auto;
  }

  .brand-mark {
    width: 56px;
    height: 56px;
    padding: 8px;
    border-radius: 18px;
  }

  .brand-mark svg {
    width: 40px;
    height: 40px;
  }

  .brand-copy {
    justify-items: start;
    gap: 2px;
  }

  .brand-title {
    font-size: 18px;
  }

  .brand-subtitle {
    display: none;
  }

  .sidebar-label {
    margin: 6px 4px 2px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-link {
    min-height: 74px;
    padding: 10px 12px;
    align-items: center;
  }

  .nav-sub {
    display: none;
  }

  .main-shell {
    padding: 12px;
  }

  .section-card,
  .metric-card,
  .topbar {
    padding: 16px;
    border-radius: 18px;
  }

  .compact-metric-card strong,
  .metric-card strong {
    font-size: 28px;
  }

  .section-head {
    gap: 12px;
  }

  .section-actions {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .account-card-grid,
  .card-list,
  .jobs-list,
  .log-list {
    grid-template-columns: 1fr;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .action-row form,
  .action-row button,
  .action-row a {
    width: 100%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .chip-group {
    flex-wrap: wrap;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-panel {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 18px;
    border-radius: 20px;
  }

  .toast-stack {
    top: 12px;
  }

  .sidebar-footer {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 80;
    margin-top: 0;
    padding-top: 0;
  }

  .account-submenu {
    left: auto;
    right: 0;
    bottom: 56px;
  }

  .login-card {
    padding: 28px 20px 24px;
  }

  .login-submit {
    width: 100%;
  }
}


/* v12 refinements */
.sidebar {
  padding: 18px 18px 16px;
}

.brand-card {
  gap: 8px;
  padding: 14px 14px 12px;
  border-radius: 22px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  padding: 7px;
  border-radius: 20px;
}

.brand-mark svg {
  width: 46px;
  height: 46px;
}

.brand-copy {
  gap: 3px;
}

.brand-title {
  font-size: 17px;
}

.brand-subtitle {
  font-size: 11px;
  letter-spacing: 0.12em;
}

.sidebar-label {
  margin: 10px 6px 10px;
}

.nav-list {
  gap: 10px;
}

.nav-link {
  padding: 16px;
  gap: 12px;
  border-radius: 20px;
}

.nav-icon {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 14px;
  font-size: 16px;
}

.nav-title {
  margin-bottom: 6px;
}

.nav-sub {
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  justify-items: start;
  background: linear-gradient(180deg, rgba(246,250,255,0) 0%, rgba(242,249,251,0.88) 18%, rgba(242,249,251,0.96) 100%);
  padding-top: 8px;
}

.account-fab-wrap {
  position: relative;
}

.account-fab {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 999px;
  font-size: 18px;
  box-shadow: 0 10px 22px rgba(86, 166, 179, 0.22);
}

.account-submenu {
  min-width: 172px;
  right: auto;
  left: 0;
  bottom: calc(100% + 10px);
  padding: 10px;
  border-radius: 18px;
}

.account-submenu-user {
  font-size: 12px;
  padding: 0 4px 6px;
}

.account-submenu-item,
.account-submenu-button {
  min-height: 40px;
  border-radius: 12px;
}

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 46px;
  background-image:
    linear-gradient(180deg, rgba(247,250,255,0.98) 0%, rgba(241,249,246,0.98) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.25L7 9.25L11 5.25' stroke='%23687faa' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 16px) 50%;
  background-size: 100% 100%, 14px 14px;
}

select:focus {
  background-image:
    linear-gradient(180deg, rgba(247,250,255,1) 0%, rgba(241,249,246,1) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.25L7 9.25L11 5.25' stroke='%2354b7d7' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

select::-ms-expand {
  display: none;
}

select option {
  color: var(--text);
  background: #f7fbff;
}

.modal-form > .modal-submit-row,
.modal-submit-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 4px;
}

.modal-submit-button {
  min-width: 160px;
}

.account-manage-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.login-actions {
  width: 100%;
  display: flex;
  justify-content: center !important;
  align-items: center;
}

.login-submit {
  display: inline-flex;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .brand-card {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: start;
    text-align: left;
    padding: 12px;
    gap: 10px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .brand-mark svg {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-subtitle {
    display: none;
  }

  .nav-link {
    padding: 12px;
    min-height: 74px;
  }

  .account-submenu {
    left: auto;
    right: 0;
    min-width: 164px;
  }

  .account-manage-grid {
    grid-template-columns: 1fr;
  }

  .align-left-on-mobile {
    justify-content: center;
  }
}


.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--primary-gradient);
  box-shadow: 0 4px 12px rgba(90, 170, 205, 0.32);
  z-index: 200;
  opacity: 0;
  transition: width 0.28s ease, opacity 0.2s ease;
}

.page-progress.active {
  width: 100%;
  opacity: 1;
}

.clear-log-button {
  min-height: 40px;
  padding: 0 16px;
}

.form-grid > button:last-child:not(.icon-button):not(.account-fab),
.form-grid > .centered-submit-row:last-child {
  justify-self: center;
}

/* v14 custom select + account scroll preserve support */
select.native-select {
  display: none;
}

.custom-select-shell {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  min-height: 46px;
  padding: 12px 44px 12px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(127, 145, 255, 0.14);
  outline: none;
  transition: all 0.25s ease;
  box-shadow: 0 0 20px -18px rgba(108, 130, 214, 0.9);
  background:
    linear-gradient(180deg, rgba(247,250,255,0.98) 0%, rgba(241,249,246,0.98) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.25L7 9.25L11 5.25' stroke='%23687faa' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 16px) 50%;
  background-size: 100% 100%, 14px 14px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.custom-select-trigger:hover {
  border-color: rgba(127, 145, 255, 0.28);
  box-shadow: 0 0 20px -17px rgba(108, 130, 214, 0.95);
  transform: translateY(-1px);
}

.custom-select-trigger:focus,
.custom-select-shell.open .custom-select-trigger {
  border-color: rgba(108, 200, 238, 0.72);
  box-shadow: 0 0 0 4px rgba(127, 145, 255, 0.12);
}

.custom-select-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-shell.open .custom-select-trigger {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(127, 145, 255, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(243,249,255,0.98) 55%, rgba(239,251,246,0.98) 100%);
  box-shadow: 0 20px 40px rgba(90, 113, 166, 0.18);
  backdrop-filter: blur(18px);
  z-index: 60;
}

.custom-select-shell.open .custom-select-menu {
  display: grid;
  gap: 6px;
}

.custom-select-option {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  box-shadow: none;
}

.custom-select-option:hover,
.custom-select-option:focus {
  background: rgba(84, 215, 184, 0.1);
  border-color: rgba(84, 215, 184, 0.18);
  box-shadow: none;
  transform: none;
}

.custom-select-option.selected {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #ffffff;
}

.custom-select-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.custom-select-shell.is-disabled .custom-select-trigger {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .custom-select-menu {
    max-height: 220px;
  }
}
