:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #dce4ef;
  --text: #152947;
  --muted: #6b7b91;
  --brand: #1457b7;
  --brand-2: #2f7df4;
  --blue: #1457b7;
  --danger: #d92d20;
  --shadow: 0 18px 42px rgba(27, 46, 79, .08);
  --soft-shadow: 0 8px 22px rgba(27, 46, 79, .07);
}

* { letter-spacing: 0; }
body {
  background: linear-gradient(135deg, #f7faff 0%, var(--bg) 52%, #eef5fb 100%);
  color: var(--text);
}

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

.app-main {
  min-width: 0;
  padding: 8px 4px 48px;
}

.right-rail {
  position: sticky;
  top: 24px;
  align-self: start;
  height: calc(100vh - 48px);
}

.rail-card {
  height: 100%;
  background: rgba(255,255,255,.91);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(214, 225, 239, .96);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rail-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  padding: 4px 4px 16px;
  border-bottom: 1px solid var(--line);
}
.rail-brand strong { display: block; line-height: 1.05; }
.rail-brand small { color: var(--muted); }

.brand-logo-mini {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d9e8fb;
  box-shadow: 0 8px 18px rgba(20, 87, 183, .12);
}

.account-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 16px 0 4px;
  padding: 12px;
  border-radius: 8px;
  background: #eef5ff;
  border: 1px solid #d9e8fb;
}
.account-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #d4a72c, var(--brand));
}
.account-avatar-image {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d9e8fb;
  box-shadow: 0 8px 18px rgba(20, 87, 183, .12);
}
.account-card strong,
.account-card small,
.account-kicker {
  display: block;
  min-width: 0;
}
.account-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-card small {
  color: var(--muted);
  font-size: 12px;
}
.account-kicker {
  color: #6b7b91;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  margin-bottom: 1px;
}
.rail-section-label {
  color: #7b8aa0;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 13px 8px 7px;
}

.rail-nav {
  display: grid;
  gap: 4px;
  padding: 0;
}
.rail-nav a {
  color: #304055;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
}
.rail-nav a:hover {
  background: #eef4fb;
  color: var(--brand);
}
.rail-nav a.active {
  background: #e8f1ff;
  border-color: #c8dcfb;
  color: var(--brand);
  box-shadow: inset 3px 0 0 var(--brand);
}
.rail-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}
.rail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #526276;
  font-size: 13px;
  font-weight: 700;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.rail-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, .12);
}

.mobile-topbar { display: none; }
.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: .9fr 1fr;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.auth-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(20,87,183,.96), rgba(47,125,244,.84)),
    linear-gradient(135deg, #1457b7, #2f7df4);
}
.auth-brand strong,
.auth-brand small {
  display: block;
}
.auth-brand strong {
  font-size: 24px;
  line-height: 1.05;
}
.auth-brand small {
  opacity: .84;
}
.auth-panel {
  padding: 42px;
}
.auth-panel h1 {
  margin: 4px 0 8px;
  font-size: 36px;
  font-weight: 800;
}
.auth-panel p {
  color: var(--muted);
  margin-bottom: 24px;
}
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 700;
}
.auth-links a {
  color: var(--brand);
  text-decoration: none;
}
.auth-links a:hover {
  text-decoration: underline;
}

.pricing-page {
  max-width: 1220px;
  margin: 0 auto;
}
.pricing-hero {
  text-align: center;
  margin: 18px auto 28px;
  max-width: 860px;
}
.pricing-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.03;
  font-weight: 850;
  margin: 8px 0 14px;
}
.pricing-hero p {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 22px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.pricing-card {
  position: relative;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  padding: 22px;
}
.pricing-card.featured {
  border-color: #8bbcf8;
  box-shadow: 0 18px 44px rgba(20, 87, 183, .16);
}
.pricing-card h2 {
  font-weight: 850;
  margin: 0 0 8px;
}
.pricing-card p {
  color: var(--muted);
  min-height: 72px;
}
.plan-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #e8f1ff;
  color: var(--brand);
  border: 1px solid #c8dcfb;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}
.plan-price {
  font-size: 30px;
  font-weight: 850;
  color: var(--text);
}
.plan-price span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.plan-year {
  color: var(--brand);
  font-weight: 800;
  margin: 4px 0 16px;
}
.pricing-card ul {
  padding-left: 18px;
  margin: 0;
  color: #344054;
}
.pricing-card li {
  margin-bottom: 8px;
}
.payment-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 20px;
}
.payment-box h3 {
  margin: 2px 0 14px;
  font-weight: 850;
}
.bank-account {
  font-size: 30px;
  font-weight: 900;
  color: var(--brand);
  letter-spacing: 0;
}
.qr-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  place-items: center;
}
.qr-box img {
  width: min(280px, 100%);
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
.payment-detail {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.payment-detail span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.payment-detail strong {
  font-size: 18px;
}
.billing-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.current-plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 20px;
}
.current-plan-card h3 {
  margin: 2px 0 8px;
  font-size: 34px;
  font-weight: 900;
  color: var(--brand);
}
.mini-quota {
  min-height: 78px;
  border: 1px solid #d9e8fb;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.mini-quota span,
.mini-quota strong {
  display: block;
}
.mini-quota span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.mini-quota strong {
  margin-top: 5px;
  font-size: 18px;
}
.plan-role {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}
.page-head h1 {
  font-size: clamp(28px, 3.3vw, 42px);
  line-height: 1.05;
  margin: 4px 0 8px;
  font-weight: 800;
}
.page-head p {
  color: var(--muted);
  margin: 0;
  max-width: 760px;
}
.eyebrow {
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.surface, .table-shell {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  padding: 22px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-title h2 {
  font-size: 18px;
  margin: 0 0 4px;
  font-weight: 800;
}
.section-title p {
  margin: 0;
  color: var(--muted);
}

.mode-tabs {
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
}
.mode-tabs .nav-link {
  color: #475569;
  font-weight: 750;
  border-radius: 8px;
}
.mode-tabs .nav-link.active {
  background: var(--brand);
  color: #fff;
}

.form-label {
  color: #344054;
  font-weight: 750;
  margin-bottom: 6px;
}
.form-control, .form-select {
  border-color: #d8dee8;
  border-radius: 8px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 .2rem rgba(47, 125, 244, .15);
}
.rich-textarea { font-size: 16px; line-height: 1.55; }

.preview-panel {
  display: grid;
  gap: 14px;
}
.phone-frame {
  background: #fff;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  padding: 16px;
}
.phone-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.phone-header small { display: block; color: var(--muted); }
.preview-page-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d9e8fb;
}
.phone-copy {
  color: #475569;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.media-placeholder {
  margin-top: 14px;
  height: 180px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #64748b;
  background: repeating-linear-gradient(45deg, #f1f5f9 0, #f1f5f9 10px, #e8eef6 10px, #e8eef6 20px);
  border: 1px dashed #cbd5e1;
  font-weight: 750;
}
.hint-list {
  display: grid;
  gap: 8px;
  color: #516070;
  font-size: 14px;
}
.hint-list span {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.info-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.info-box h3 { font-size: 18px; font-weight: 800; }
.sticky-actions {
  position: sticky;
  bottom: 18px;
  display: flex;
  justify-content: flex-end;
  padding-top: 18px;
}

.metric {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--soft-shadow);
}
.metric span { display: block; color: var(--muted); font-size: 14px; font-weight: 750; }
.metric strong { display: block; font-size: 34px; line-height: 1.1; margin-top: 6px; }
.compact-metric {
  min-width: 190px;
  padding: 16px 18px;
}
.compact-metric strong {
  font-size: 28px;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.filter-bar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}
.table {
  margin: 0;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.table thead th {
  color: #526276;
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.table tbody td {
  padding-top: 14px;
  padding-bottom: 14px;
  border-color: #edf1f5;
  vertical-align: middle;
}

.truncate {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.monospace, pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre {
  max-width: 320px;
  max-height: 120px;
  white-space: pre-wrap;
  margin: 0;
  font-size: 12px;
}
.soft-alert { border-radius: 8px; }

.guide-timeline {
  display: grid;
  gap: 14px;
}
.guide-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.guide-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 850;
}
.guide-step h3,
.guide-card h3 {
  font-size: 18px;
  font-weight: 850;
  margin-bottom: 6px;
}
.guide-step p,
.guide-card p {
  color: #516070;
  margin-bottom: 8px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.guide-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}
.guide-checklist {
  display: grid;
  gap: 10px;
}
.guide-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font-weight: 650;
}
.guide-checklist input {
  margin-top: 4px;
}

.legal-page {
  max-width: 980px;
  margin: 0 auto;
}
.legal-hero {
  text-align: center;
  padding: 30px 12px 22px;
}
.legal-hero img {
  max-width: 260px;
  width: 60%;
  height: auto;
  margin-bottom: 12px;
}
.legal-hero h1 {
  font-weight: 900;
  margin: 8px 0;
}
.legal-hero p {
  color: var(--muted);
  margin: 0;
}
.legal-content h2 {
  font-size: 20px;
  font-weight: 850;
  margin-top: 24px;
}
.legal-content h2:first-child {
  margin-top: 0;
}
.legal-content p {
  color: #475569;
}

@media (max-width: 1100px) {
  .app-shell {
    display: block;
    padding: 14px;
  }
  .right-rail { display: none; }
  .mobile-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
  }
  .page-head {
    flex-direction: column;
  }
  .surface { padding: 16px; }
  .mode-tabs { display: flex; width: 100%; overflow-x: auto; }
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .auth-card {
    grid-template-columns: 1fr;
  }
  .auth-brand,
  .auth-panel {
    padding: 28px;
  }
  .auth-brand {
    min-height: 150px;
  }
  .action-bar {
    justify-content: stretch;
  }
  .action-bar .btn,
  .action-bar form {
    width: 100%;
  }
  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .pagination-actions {
    width: 100%;
    justify-content: space-between;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .guide-grid,
  .guide-step {
    grid-template-columns: 1fr;
  }
}
