/* ==========================================================================
   Kite Pay — design system
   Friendly, illustration-led, blue. Light + dark.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root,
[data-theme="light"] {
  --bg:           #F1F4FB;
  --surface:      #FFFFFF;
  --surface-alt:  #F8FAFE;
  --raised:       #FFFFFF;
  --border:       #E4E8F3;
  --border-strong:#D2D8E8;
  --divider:      #EEF1F8;

  --primary:      #1B4DFF;
  --primary-hover:#1639CC;
  --primary-soft: #E6ECFF;
  --primary-ink:  #0B1F66;

  --coral:        #FF6B5A;
  --coral-soft:   #FFE7E3;
  --mint:         #10C79C;
  --mint-soft:    #DEF7EF;
  --saffron:      #F8B500;
  --saffron-soft: #FFF1CC;
  --violet:       #8B5CF6;
  --violet-soft:  #EDE7FF;

  --ink:          #0B1437;
  --text:         #1B2347;
  --text-muted:   #5A6485;
  --text-faint:   #8B95B2;
  --text-inverse: #FFFFFF;

  --success:      #10C79C;
  --warning:      #F8B500;
  --danger:       #EF4565;
  --info:         #1B4DFF;

  --shadow-sm: 0 1px 2px rgba(11,20,55,.04), 0 1px 1px rgba(11,20,55,.03);
  --shadow-md: 0 4px 10px -2px rgba(11,20,55,.08), 0 2px 4px -1px rgba(11,20,55,.04);
  --shadow-lg: 0 18px 40px -12px rgba(11,20,55,.12), 0 8px 18px -8px rgba(11,20,55,.08);
  --shadow-glow: 0 12px 28px -10px rgba(27,77,255,.45);
}

[data-theme="dark"] {
  --bg:           #070A1A;
  --surface:      #101533;
  --surface-alt:  #0B1029;
  --raised:       #171D3F;
  --border:       #262D52;
  --border-strong:#323A66;
  --divider:      #1C2245;

  --primary:      #6F8CFF;
  --primary-hover:#869EFF;
  --primary-soft: #1B2354;
  --primary-ink:  #C9D5FF;

  --coral:        #FF8B7E;
  --coral-soft:   #3C1F1C;
  --mint:         #39E0B6;
  --mint-soft:    #0F3329;
  --saffron:      #FFCC4D;
  --saffron-soft: #3A2C0A;
  --violet:       #A78BFA;
  --violet-soft:  #251D4A;

  --ink:          #F4F6FB;
  --text:         #E6EAF6;
  --text-muted:   #A5AECF;
  --text-faint:   #6F7AA0;
  --text-inverse: #0B1437;

  --success:      #39E0B6;
  --warning:      #FFCC4D;
  --danger:       #FF6F8B;
  --info:         #6F8CFF;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 16px -4px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 50px -16px rgba(0,0,0,.6);
  --shadow-glow: 0 14px 34px -10px rgba(111,140,255,.55);
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg:           #070A1A;
    --surface:      #101533;
    --surface-alt:  #0B1029;
    --raised:       #171D3F;
    --border:       #262D52;
    --border-strong:#323A66;
    --divider:      #1C2245;
    --primary:      #6F8CFF; --primary-hover:#869EFF;
    --primary-soft: #1B2354; --primary-ink:  #C9D5FF;
    --coral:        #FF8B7E; --coral-soft:   #3C1F1C;
    --mint:         #39E0B6; --mint-soft:    #0F3329;
    --saffron:      #FFCC4D; --saffron-soft: #3A2C0A;
    --violet:       #A78BFA; --violet-soft:  #251D4A;
    --ink:          #F4F6FB; --text:         #E6EAF6;
    --text-muted:   #A5AECF; --text-faint:   #6F7AA0;
    --text-inverse: #0B1437;
    --success:      #39E0B6; --warning:      #FFCC4D;
    --danger:       #FF6F8B; --info:         #6F8CFF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 6px 16px -4px rgba(0,0,0,.5);
    --shadow-lg: 0 24px 50px -16px rgba(0,0,0,.6);
    --shadow-glow: 0 14px 34px -10px rgba(111,140,255,.55);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
h1,h2,h3,h4 { font-family: 'Manrope', sans-serif; letter-spacing: -.025em; color: var(--ink); margin: 0; }
hr { border: none; height: 1px; background: var(--divider); margin: 16px 0; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ---------- Logo word ---------- */
.kite-word { font-family: 'Manrope'; font-weight: 800; letter-spacing: -.02em; color: var(--ink); display: inline-flex; align-items: center; gap: 9px; line-height: 1; }
.kite-word .dot { color: var(--primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 14px; font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .05s;
  background: var(--surface); color: var(--text); border-color: var(--border);
  text-decoration: none;
}
.btn:hover { border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-glow); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn--outline { background: transparent; }
.btn--danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--lg { padding: 13px 18px; font-size: 14px; border-radius: 12px; }
.btn--sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn--full { width: 100%; }
.btn--icon { width: 38px; height: 38px; padding: 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.card-soft { background: var(--surface-alt); }

/* ---------- Badges & dots ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
  background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border);
  text-transform: capitalize;
}
.badge--success { background: var(--mint-soft); color: var(--mint); border-color: transparent; }
.badge--warning { background: var(--saffron-soft); color: var(--saffron); border-color: transparent; }
.badge--danger  { background: var(--coral-soft); color: var(--coral); border-color: transparent; }
.badge--violet  { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.badge--info    { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge .dot { width: 5px; height: 5px; border-radius: 999px; background: currentColor; display: inline-block; }
.statusdot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; background: var(--text-faint); }
.statusdot.success { background: var(--success); box-shadow: 0 0 0 3px var(--mint-soft); }
.statusdot.warning { background: var(--warning); box-shadow: 0 0 0 3px var(--saffron-soft); }
.statusdot.danger  { background: var(--danger);  box-shadow: 0 0 0 3px var(--coral-soft); }

/* ---------- Avatars ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px; color: #fff;
  font-family: 'Manrope'; font-weight: 800; font-size: 13px;
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--lg { width: 56px; height: 56px; font-size: 18px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.field > input, .field > select, .field > textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field > input:focus, .field > select:focus, .field > textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.field--mono > input { font-family: 'JetBrains Mono', monospace; }
.field--error > input { border-color: var(--danger); box-shadow: 0 0 0 4px var(--coral-soft); }
.field-error { font-size: 11.5px; color: var(--danger); margin-top: -8px; margin-bottom: 14px; }
.field-help  { font-size: 11.5px; color: var(--text-faint); }

.input-row { display: flex; gap: 8px; align-items: center; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.input-row input { background: transparent; border: none; outline: none; flex: 1; font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--text); }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.alert--danger  { background: var(--coral-soft); color: var(--coral); }
.alert--success { background: var(--mint-soft); color: var(--mint); }
.alert--info    { background: var(--primary-soft); color: var(--primary); }
.alert--warning { background: var(--saffron-soft); color: var(--saffron); }

/* ---------- App chrome (desktop dashboard) ---------- */
.app-shell { display: flex; min-height: 100vh; background: var(--bg); }
.sidebar {
  width: 244px; flex-shrink: 0; height: 100vh; position: sticky; top: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar__brand { padding: 20px 18px 12px; }
.sidebar__workspace { padding: 0 12px 14px; }
.sidebar__workspace button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px;
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; text-align: left; color: var(--text);
}
.ws-avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: 'Manrope'; font-weight: 800; font-size: 13px; }
.sidebar nav { flex: 1; padding: 0 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.nav-group__label { padding: 6px 12px; font-size: 10px; font-weight: 700; color: var(--text-faint); letter-spacing: .1em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: transparent; color: var(--text-muted);
  border: none; border-radius: 9px; cursor: pointer; text-align: left;
  font-family: 'Plus Jakarta Sans'; font-weight: 500; font-size: 13px;
  width: 100%; text-decoration: none; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-alt); color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-item .count {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  background: var(--surface-alt); color: var(--text-muted);
  padding: 1px 7px; border-radius: 999px;
}
.nav-item.is-active .count { background: rgba(27,77,255,.15); color: var(--primary); }

.sidebar__pro { padding: 12px; }
.pro-card {
  padding: 14px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--violet) 100%);
  position: relative; overflow: hidden;
}
.pro-card__title { font-family: 'Manrope'; font-weight: 800; font-size: 14px; margin-top: 6px; }
.pro-card__sub   { font-size: 11.5px; opacity: .85; margin-top: 2px; line-height: 1.45; }
.pro-card__cta {
  margin-top: 10px; height: 28px; padding: 0 12px; border-radius: 8px;
  background: #fff; color: var(--primary); border: none;
  font-weight: 700; font-size: 11.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}

/* ---------- Main + topbar ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px 18px; border-bottom: 1px solid var(--divider);
  background: var(--bg); position: sticky; top: 0; z-index: 4;
  gap: 12px; flex-wrap: wrap;
}
.topbar h1 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); margin: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.topbar__title { flex: 1 1 200px; min-width: 0; }

@media (max-width: 1180px) {
  .topbar .search { display: none; }
}
@media (max-width: 1080px) {
  .topbar__right .icon-btn[aria-label="Notifications"] { display: none; }
  .topbar__title { flex-basis: 100%; }
}
.search {
  display: flex; align-items: center; gap: 8px; width: 280px; height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.search input { flex: 1; border: none; outline: none; background: transparent; font-size: 12.5px; color: var(--text); }
.kbd {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; padding: 2px 6px; border-radius: 4px;
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--text-muted);
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative;
}
.icon-btn .ping { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 999px;
  background: var(--coral); border: 1.5px solid var(--surface); }

.content { padding: 22px 28px 36px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 14px; }
.grid.kpi    { grid-template-columns: repeat(4, 1fr); }
.grid.two-third { grid-template-columns: 2fr 1fr; }
.grid.half   { grid-template-columns: repeat(2, 1fr); }
.grid.thirds { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1080px) {
  .grid.kpi { grid-template-columns: repeat(2, 1fr); }
  .grid.two-third { grid-template-columns: 1fr; }
  .grid.thirds { grid-template-columns: 1fr; }
}

/* ---------- Stat tiles ---------- */
.stat-tile { padding: 18px; position: relative; overflow: hidden; }
.stat-tile__top { display: flex; align-items: center; justify-content: space-between; }
.stat-tile__icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.stat-tile__icon.primary { background: var(--primary-soft); color: var(--primary); }
.stat-tile__icon.mint    { background: var(--mint-soft); color: var(--mint); }
.stat-tile__icon.saffron { background: var(--saffron-soft); color: var(--saffron); }
.stat-tile__icon.violet  { background: var(--violet-soft); color: var(--violet); }
.stat-tile__icon.coral   { background: var(--coral-soft); color: var(--coral); }
.stat-tile__label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 12px; letter-spacing: .02em; }
.stat-tile__value { font-family: 'Manrope'; font-weight: 800; font-size: 26px; color: var(--ink); letter-spacing: -.03em; margin-top: 4px; }
.stat-tile__sub   { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table thead { background: var(--surface-alt); color: var(--text-muted); }
.table th { text-align: left; padding: 10px 18px; font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.table td { padding: 12px 18px; border-top: 1px solid var(--divider); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-alt); }
.table .num { font-family: 'Manrope'; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.table-empty { padding: 60px 20px; text-align: center; color: var(--text-muted); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--divider);
  gap: 10px; flex-wrap: wrap;
}
.card-header h3 { font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.card-header > form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-header > form > * { min-width: 0; }

/* ---------- Tabs / segmented ---------- */
.seg {
  display: inline-flex; gap: 4px; padding: 3px;
  background: var(--surface-alt); border-radius: 9px; border: 1px solid var(--border);
}
.seg button {
  padding: 5px 11px; border-radius: 7px; border: none; background: transparent;
  color: var(--text-muted); font-weight: 600; font-size: 11.5px; cursor: pointer;
}
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Chart placeholders ---------- */
.chart { width: 100%; height: 180px; display: block; }

/* ===========================================================
   MARKETING / LANDING
   =========================================================== */
.marketing { background: var(--bg); }
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px; background: rgba(241,244,251,.85);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--divider);
}
.nav__links { display: flex; gap: 22px; }
.nav__links a { color: var(--text-muted); font-weight: 600; font-size: 13.5px; }
.nav__links a:hover { color: var(--ink); text-decoration: none; }
.hero {
  padding: 56px 28px 32px; max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center;
}
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; gap: 16px; padding: 32px 18px; } }
.hero__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: 12px;
}
.hero__h1 {
  font-family: 'Manrope'; font-weight: 800; font-size: 56px; line-height: 1.04;
  letter-spacing: -.04em; color: var(--ink); margin: 18px 0 14px;
}
.hero__h1 .accent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--coral) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (max-width: 640px) { .hero__h1 { font-size: 38px; } }
.hero__p { font-size: 16px; color: var(--text-muted); max-width: 480px; }
.hero__cta { display: flex; gap: 10px; margin-top: 22px; }
.hero__art { position: relative; }

.features {
  max-width: 1180px; margin: 0 auto; padding: 24px 28px 64px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
@media (max-width: 880px) { .features { grid-template-columns: 1fr; padding: 20px 18px 48px; } }
.feat { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
.feat__icon { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feat__title { font-family: 'Manrope'; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--ink); }
.feat__copy { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.55; }

.pricing { background: var(--surface-alt); padding: 64px 28px; border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
.pricing__head { max-width: 760px; margin: 0 auto 28px; text-align: center; }
.pricing__h2 { font-family: 'Manrope'; font-weight: 800; font-size: 36px; letter-spacing: -.03em; color: var(--ink); }
.pricing__p  { color: var(--text-muted); margin-top: 8px; }
.plans { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 880px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px; position: relative; }
.plan.is-featured { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.plan__name { font-family: 'Manrope'; font-weight: 800; font-size: 16px; letter-spacing: -.02em; color: var(--ink); }
.plan__price { font-family: 'Manrope'; font-weight: 800; font-size: 40px; color: var(--ink); margin: 14px 0 2px; letter-spacing: -.03em; }
.plan__per { color: var(--text-muted); font-size: 13px; }
.plan ul { list-style: none; padding: 16px 0 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.plan ul li { font-size: 13px; color: var(--text); display: flex; gap: 8px; }
.plan ul li::before { content: '✓'; color: var(--success); font-weight: 800; }

.cta-strip {
  max-width: 1080px; margin: 64px auto; padding: 36px 32px; border-radius: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #0F3DD9 100%);
  color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 18px;
}
@media (max-width: 720px) { .cta-strip { flex-direction: column; text-align: center; padding: 28px 22px; } }
.cta-strip h2 { font-family: 'Manrope'; font-weight: 800; font-size: 26px; color: #fff; letter-spacing: -.02em; }
.cta-strip p  { opacity: .85; font-size: 14px; margin-top: 4px; }
.cta-strip .btn { background: #fff; color: var(--primary); border-color: #fff; box-shadow: none; }

.footer { max-width: 1180px; margin: 0 auto; padding: 24px 28px 36px; display: flex; justify-content: space-between; align-items: center; color: var(--text-faint); font-size: 12px; border-top: 1px solid var(--divider); }
@media (max-width: 640px) { .footer { flex-direction: column; gap: 8px; padding: 18px; } }

/* ===========================================================
   MOBILE CHECKOUT (phone screens)
   =========================================================== */
.checkout-page { min-height: 100vh; background:
  radial-gradient(800px 400px at 80% -10%, var(--primary-soft) 0%, transparent 60%),
  radial-gradient(700px 380px at 10% 110%, var(--violet-soft) 0%, transparent 60%),
  var(--bg);
  display: flex; align-items: stretch; justify-content: center; padding: 24px 12px;
}
.phone { width: 100%; max-width: 420px; background: var(--surface); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.phone__head {
  padding: 14px 18px 18px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--primary) 0%, #0F3DD9 100%);
}
[data-theme="dark"] .phone__head { background: linear-gradient(180deg, var(--primary) 0%, #101533 100%); }
.phone__head::before {
  content: ''; position: absolute; right: -22px; top: -22px; width: 120px; height: 120px;
  background: rgba(255,255,255,.18); border-radius: 16px;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.phone__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; position: relative; }
.phone__chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.16); padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.phone__label { font-size: 12.5px; font-weight: 500; opacity: .78; letter-spacing: .04em; text-transform: uppercase; }
.phone__merchant { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.phone__merchant__avatar { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-family: 'Manrope'; font-weight: 800; font-size: 16px; }
.phone__merchant__name { font-family: 'Manrope'; font-weight: 700; font-size: 17px; line-height: 1.1; }
.phone__merchant__oid  { font-size: 11.5px; opacity: .75; font-family: 'JetBrains Mono', monospace; }
.phone__amt { margin-top: 18px; display: flex; align-items: baseline; gap: 4px; font-family: 'Manrope'; font-weight: 800; letter-spacing: -.04em; }
.phone__amt .cur { font-size: 22px; opacity: .8; }
.phone__amt .whole { font-size: 44px; line-height: 1; }
.phone__amt .frac { font-size: 22px; opacity: .8; }

.phone__body { padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Pay screen — responsive 2-col layout on desktop ---------- */
.pay-grid { display: flex; flex-direction: column; gap: 14px; }
.pay-grid__qr { text-align: center; }
.pay-grid__upi { display: flex; flex-direction: column; }
.pay-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pay-steps li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.pay-steps__n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-family: 'Manrope'; font-weight: 800; font-size: 11.5px; flex-shrink: 0;
}
.pay-download { display: flex; justify-content: center; margin-top: 4px; }

/* QR center logo overlay (brand badge) */
.qr-frame { position: relative; }
.qr-frame__logo {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; padding: 6px; border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: center;
}
.qr-frame__logo--lg { padding: 8px; border-radius: 12px; }
.qr-frame--lg { width: 280px; height: 280px; margin: 0 auto; }
.qr-frame--lg img { padding: 14px; border-radius: 20px; }

/* ===========================================================
   DESKTOP HOSTED CHECKOUT (≥ 760px) — two-column shell
   =========================================================== */
.checkout-shell {
  display: none; /* shown by media query below */
  width: 100%; max-width: 1180px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.checkout-mobile { display: block; }
@media (min-width: 760px) {
  .checkout-page { padding: 28px 24px; align-items: flex-start; }
  .checkout-mobile { display: none; }
  .checkout-shell { display: block; }
}

.checkout-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px; border-bottom: 1px solid var(--divider);
  background: var(--surface);
}
.checkout-top__brand-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Manrope'; font-weight: 800; font-size: 16px;
}
.checkout-top__brand-name { font-family: 'Manrope'; font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: -.01em; line-height: 1.1; }
.checkout-top__brand-domain { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.checkout-top__secure {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--mint-soft); color: #0B7A5E;
  font-size: 11.5px; font-weight: 700;
}
[data-theme="dark"] .checkout-top__secure { color: var(--mint); }
.checkout-top__order { color: var(--text-faint); font-size: 11px; }

.checkout-body {
  display: grid; grid-template-columns: 380px 1fr;
  background: var(--surface);
}
@media (min-width: 1080px) {
  .checkout-body { grid-template-columns: 420px 1fr; }
}
@media (max-width: 760px) {
  .checkout-body { grid-template-columns: 1fr; }
}

/* Left aside */
.checkout-aside {
  padding: 28px 28px 24px;
  background: var(--surface);
  border-right: 1px solid var(--divider);
  display: flex; flex-direction: column;
}
.checkout-aside__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 12px; text-decoration: none;
}
.checkout-aside__back:hover { color: var(--ink); text-decoration: none; }
.checkout-aside__kicker {
  font-family: 'Manrope'; font-weight: 800; font-size: 12px;
  color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase;
}
.checkout-aside__amount {
  display: flex; align-items: baseline; gap: 4px; margin-top: 8px;
  font-family: 'Manrope'; font-weight: 800; letter-spacing: -.04em; color: var(--ink);
}
.checkout-aside__amount .cur   { font-size: 22px; color: var(--text-muted); }
.checkout-aside__amount .whole { font-size: 52px; line-height: 1; }
.checkout-aside__amount .frac  { font-size: 22px; color: var(--text-muted); }
.checkout-aside__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.checkout-aside__line {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 22px; padding: 12px; background: var(--surface-alt); border-radius: 12px;
}
.checkout-aside__line-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.checkout-aside__totals {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
  display: flex; flex-direction: column; gap: 6px;
}
.checkout-aside__totals .row {
  display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-muted);
}
.checkout-aside__total {
  display: flex; justify-content: space-between; margin-top: 6px; padding-top: 10px;
  border-top: 1px solid var(--divider); color: var(--ink);
}
.checkout-aside__total span:first-child { font-weight: 700; font-size: 14px; }
.checkout-aside__total span:last-child  {
  font-family: 'Manrope'; font-weight: 800; font-size: 20px; letter-spacing: -.02em;
}

.checkout-aside__badges {
  margin-top: 18px; display: flex; gap: 6px; flex-wrap: wrap;
}
.checkout-aside__badges .badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-alt); color: var(--text-muted);
  padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; border: 1px solid var(--border);
}
.checkout-aside__powered {
  margin-top: auto; padding-top: 18px;
  font-size: 11px; color: var(--text-faint);
  display: inline-flex; align-items: center; gap: 6px;
}

/* Right main */
.checkout-main { padding: 30px 40px; min-width: 0; }

/* Method tabs */
.checkout-tabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.checkout-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  font-family: 'Plus Jakarta Sans'; font-weight: 600; font-size: 13px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.checkout-tab:hover:not(:disabled):not(.is-active) { border-color: var(--border-strong); }
.checkout-tab:disabled { opacity: .55; cursor: not-allowed; }
.checkout-tab.is-active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}
.checkout-tab__chip {
  margin-left: 4px; padding: 2px 6px; border-radius: 999px;
  background: rgba(255,255,255,.22); font-size: 10px; font-weight: 800; letter-spacing: .04em;
}

/* QR card on desktop */
.checkout-qr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.checkout-qr-card__head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
}
.checkout-qr-card__title {
  font-family: 'Manrope'; font-weight: 800; font-size: 20px; color: var(--ink); letter-spacing: -.02em;
  text-align: left;
}
.checkout-qr-card__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; text-align: left; }
.checkout-qr-card__pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; margin-top: 14px;
  background: var(--saffron-soft); color: #8A6300;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
[data-theme="dark"] .checkout-qr-card__pill { color: var(--saffron); }
.checkout-qr-card__actions { margin-top: 16px; }

/* Help footer */
.checkout-help {
  margin-top: 22px; padding: 14px 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* Center the awaiting / expired / success states */
.checkout-state {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 40px 20px 20px;
}
.checkout-state .state-h1 { font-size: 32px; }
.checkout-state .state-p { font-size: 14.5px; max-width: 460px; }

/* Success-state background tint */
.checkout-page--success .checkout-shell { background: linear-gradient(180deg, var(--mint-soft) 0%, var(--surface) 30%); }

/* Hide the old .phone wrap on desktop (we use .checkout-shell instead) */
@media (min-width: 760px) {
  .phone.checkout-mobile { display: none !important; }
}

@media (min-width: 760px) {
  .checkout-page { padding: 36px 24px; }
  .phone { max-width: 880px; border-radius: 22px; }
  .phone__head { padding: 26px 36px 30px; position: relative; }
  .phone__amt {
    position: absolute; right: 36px; bottom: 30px; margin: 0;
  }
  .phone__amt .whole { font-size: 56px; }
  .phone__amt .cur, .phone__amt .frac { font-size: 26px; }

  .phone__body.pay-body { padding: 26px 30px 22px; }
  .pay-grid {
    display: flex; flex-direction: column;
    align-items: center;
    gap: 18px;
    max-width: 480px; margin: 0 auto;
  }
  .pay-grid__qr { width: 100%; }
  .qr-frame { width: 240px; height: 240px; margin: 4px auto 14px; }
}

@media (min-width: 1080px) {
  .phone { max-width: 980px; }
  .qr-frame { width: 260px; height: 260px; }
}

/* QR card */
.qr-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.qr-row__title { font-family: 'Manrope'; font-weight: 700; font-size: 15px; color: var(--ink); }
.qr-row__sub   { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.countdown {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-alt); padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text);
}
.countdown .dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; animation: kp-pulse 1.2s infinite; }
.countdown .num { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 13px; }
.countdown .lbl { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.countdown.warn { color: var(--coral); }
@keyframes kp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.qr-frame { position: relative; width: 220px; height: 220px; margin: 0 auto 12px; }
.qr-frame img { width: 100%; height: 100%; display: block; border-radius: 16px; background: #fff; border: 1px solid var(--border); padding: 10px; box-sizing: border-box; }
.qr-frame .corner { position: absolute; width: 18px; height: 18px; }
.qr-frame .corner.tl { left: -2px; top: -2px; border-top: 2.5px solid var(--primary); border-left: 2.5px solid var(--primary); border-top-left-radius: 4px; }
.qr-frame .corner.tr { right: -2px; top: -2px; border-top: 2.5px solid var(--primary); border-right: 2.5px solid var(--primary); border-top-right-radius: 4px; }
.qr-frame .corner.bl { left: -2px; bottom: -2px; border-bottom: 2.5px solid var(--primary); border-left: 2.5px solid var(--primary); border-bottom-left-radius: 4px; }
.qr-frame .corner.br { right: -2px; bottom: -2px; border-bottom: 2.5px solid var(--primary); border-right: 2.5px solid var(--primary); border-bottom-right-radius: 4px; }
.qr-foot { text-align: center; font-size: 12px; color: var(--text-muted); }

.or-divider { display: flex; align-items: center; gap: 12px; }
.or-divider hr { flex: 1; height: 1px; background: var(--border); border: none; margin: 0; }
.or-divider span { font-size: 11px; font-weight: 600; color: var(--text-faint); letter-spacing: .1em; }

.upi-row__title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.upi-row__title h4 { font-family: 'Manrope'; font-weight: 700; font-size: 14px; color: var(--ink); margin: 0; }
.copy-row { display: flex; align-items: center; gap: 8px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.copy-row .inr { color: var(--primary); font-weight: 800; font-family: 'Manrope'; font-size: 16px; width: 18px; text-align: center; }
.copy-row input { flex: 1; background: transparent; border: none; outline: none; font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 14px; color: var(--text); }
.copy-row button { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 7px 12px; font-weight: 600; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.copy-hint { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; color: var(--text-muted); font-size: 11.5px; }

.app-row { margin-top: 4px; }
.app-row__label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; letter-spacing: .02em; text-transform: uppercase; }
.app-row__grid { display: flex; gap: 10px; }
.app-row__grid a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 6px; text-decoration: none; color: var(--text);
}
.app-row__grid a:hover { border-color: var(--primary); text-decoration: none; }
.app-glyph { width: 36px; height: 36px; border-radius: 10px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: 'Manrope'; font-weight: 800; font-size: 16px; }
.app-glyph.gpay   { background: linear-gradient(135deg,#4285F4 0%,#34A853 50%,#FBBC04 75%,#EA4335 100%); }
.app-glyph.phonepe{ background: #5F259F; }
.app-glyph.paytm  { background: #00B9F5; }
.app-glyph.bhim   { background: #FF7043; }
.app-row__grid a span { font-size: 11px; font-weight: 600; }

.trust-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--mint-soft); color: #0B7A5E;
  border-radius: 10px; font-size: 11.5px; font-weight: 600;
}
[data-theme="dark"] .trust-strip { color: var(--mint); }
.foot-brand { text-align: center; margin-top: 6px; color: var(--text-faint); font-size: 11px; font-weight: 500; }
.foot-brand .kite-word { display: inline-flex; vertical-align: -3px; font-size: 12px; }

/* Awaiting (radar) */
.radar { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.radar .ring { position: absolute; inset: 0; border-radius: 999px; border: 2px solid var(--primary); opacity: .4; animation: kp-radar 2.2s ease-out infinite; }
.radar .ring:nth-child(2) { animation-delay: .7s; opacity: .25; }
.radar .ring:nth-child(3) { animation-delay: 1.4s; opacity: .15; }
.radar .core { position: absolute; inset: 18px; border-radius: 999px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; color: var(--primary); }
@keyframes kp-radar { 0% { transform: scale(.95); opacity: .55; } 100% { transform: scale(1.35); opacity: 0; } }

.state-h1 { font-family: 'Manrope'; font-weight: 800; font-size: 22px; color: var(--ink); letter-spacing: -.025em; text-align: center; margin: 16px 0 6px; }
.state-p  { font-size: 13.5px; color: var(--text-muted); text-align: center; line-height: 1.5; }

/* Success */
.success-art { width: 180px; height: 180px; margin: 0 auto; position: relative; }
.success-art .ring1, .success-art .ring2, .success-art .ring3 { position: absolute; border-radius: 999px; }
.success-art .ring1 { inset: 0; background: var(--mint-soft); opacity: .9; }
.success-art .ring2 { inset: 20px; background: var(--mint-soft); opacity: .8; }
.success-art .ring3 { inset: 38px; background: var(--mint); display: flex; align-items: center; justify-content: center; color: #fff; }
.confetti { position: absolute; width: 6px; height: 14px; border-radius: 2px; }

.success-hero { padding: 32px 22px 22px; background: linear-gradient(180deg, var(--mint-soft) 0%, var(--bg) 100%); text-align: center; }
.kv {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.kv .row { display: flex; justify-content: space-between; padding: 13px 16px; gap: 8px; }
.kv .row + .row { border-top: 1px solid var(--divider); }
.kv .k { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.kv .v { font-size: 13px; font-weight: 600; color: var(--text); text-align: right; word-break: break-all; }

/* ===========================================================
   MOBILE-ONLY POLISH (≤ 880px)
   PC layout above is untouched — these rules only apply on phones.
   =========================================================== */
@media (max-width: 880px) {

  /* ----- App shell + topbar ----- */
  .app-shell { display: block; }
  .main { width: 100%; min-width: 0; }

  .topbar {
    padding: 12px 14px;
    flex-wrap: wrap; gap: 8px;
    align-items: flex-start;
  }
  .topbar > div:first-child { min-width: 0; flex: 1 1 100%; }
  .topbar h1 { font-size: 18px; line-height: 1.2; word-break: break-word; }
  .topbar .sub { font-size: 12px; }
  .topbar__right { flex-wrap: wrap; gap: 6px; }
  .topbar__right .btn { font-size: 12px; padding: 8px 10px; }

  /* ----- Content ----- */
  .content { padding: 12px 12px 88px; gap: 12px; }
  .card-pad { padding: 14px; }
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
  .card-header h3 { font-size: 14px; }
  .card-header form,
  .card-header .search { width: 100%; }
  .card-header .search { box-sizing: border-box; }
  .card-header .seg { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card-header .seg::-webkit-scrollbar { display: none; }

  /* ----- Grids collapse ----- */
  .grid.kpi    { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.half   { grid-template-columns: 1fr; gap: 12px; }
  .grid.thirds { grid-template-columns: 1fr; gap: 12px; }
  .grid.two-third { grid-template-columns: 1fr; gap: 12px; }
  .grid { gap: 12px; }

  /* ----- KPI tiles smaller ----- */
  .stat-tile { padding: 14px; }
  .stat-tile__value { font-size: 20px; }
  .stat-tile__label { font-size: 11px; margin-top: 10px; }
  .stat-tile__sub   { font-size: 11px; }
  .stat-tile__icon  { width: 30px; height: 30px; }

  /* ----- Tables: allow horizontal scroll inside cards ----- */
  /* Override inline `overflow:hidden` so the table can scroll. */
  .card { overflow: hidden; }
  .card:has(> .table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Fallback for browsers without :has(): scroll the table by treating it as block */
  .card > .table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; }
  .card > .table thead, .card > .table tbody { display: table; width: 100%; table-layout: auto; }
  .card > .table th, .card > .table td { padding: 9px 12px; font-size: 11.5px; white-space: nowrap; }
  .card > .table th:first-child, .card > .table td:first-child { padding-left: 14px; }
  .card > .table th:last-child,  .card > .table td:last-child  { padding-right: 14px; }
  .table-empty { padding: 36px 14px; font-size: 12.5px; }

  /* ----- Forms ----- */
  .field > input, .field > select, .field > textarea { font-size: 14px; padding: 11px 12px; }
  /* Wide form grids inside settings/admin collapse cleanly */
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* ----- Buttons in toolbars ----- */
  .btn--sm { padding: 6px 9px; font-size: 11.5px; }

  /* ----- Alerts ----- */
  .alert { font-size: 12.5px; padding: 10px 12px; }

  /* ----- Code / pre blocks inside dashboard pages ----- */
  pre { font-size: 11px !important; overflow-x: auto; }

  /* ----- Status banner (subscription) ----- */
  .checkout-page--success .checkout-shell { background: var(--surface); }

  /* ===== AUTH (sign-in / sign-up) — bulletproof split-on-mobile ===== */
  .auth { grid-template-columns: 1fr !important; min-height: auto; }
  .auth__art { display: none !important; }     /* hide gradient panel completely */
  .auth__form { padding: 28px 20px; max-width: 100%; margin: 0; }
  .auth__form h1 { font-size: 24px; }
  .auth__form p  { font-size: 13.5px; }

  /* ===== LANDING ===== */
  .nav { padding: 12px 14px; }
  .nav__links { display: none !important; }
  .hero { padding: 28px 16px 16px; }
  .hero__h1 { font-size: 34px; line-height: 1.08; margin: 12px 0 10px; }
  .hero__p { font-size: 14px; }
  .hero__cta { flex-wrap: wrap; }
  .hero__cta .btn { flex: 1 1 auto; }
  .features { padding: 16px 14px 36px; grid-template-columns: 1fr; }
  .pricing { padding: 36px 14px; }
  .pricing__h2 { font-size: 26px; }
  .plans { grid-template-columns: 1fr; }
  .cta-strip { margin: 36px 14px; padding: 22px 18px; flex-direction: column; text-align: center; }
  .cta-strip h2 { font-size: 20px; }
  .footer { flex-direction: column; gap: 8px; padding: 16px; text-align: center; }

  /* ===== ADMIN/SECURITY runtime grid — already collapses via .grid.half ===== */

  /* ===== PHONE CHECKOUT — fit viewport, no scroll ===== */
  .checkout-page {
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: stretch;
  }
  .phone.checkout-mobile {
    max-width: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .phone__head {
    padding: 10px 16px 14px;
    flex-shrink: 0;
  }
  .phone__row { margin-bottom: 14px; }
  .phone__merchant__name { font-size: 15px; }
  .phone__amt { margin-top: 12px; }
  .phone__amt .whole { font-size: 36px; }
  .phone__amt .cur, .phone__amt .frac { font-size: 18px; }
  .phone__body {
    flex: 1;
    min-height: 0;
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
  }
  .phone__body .card-pad { padding: 12px; }
  .qr-row { margin-bottom: 8px; }
  .qr-row__title { font-size: 14px; }
  .countdown { padding: 6px 10px; }
  .countdown .num { font-size: 12px; }
  .countdown .lbl { font-size: 11px; }
  .qr-frame { width: 180px; height: 180px; margin-bottom: 8px; }
  .qr-frame img { padding: 8px; }
  .qr-foot { font-size: 11px; }
  .pay-download { margin-top: 2px; }
  .pay-download .btn { padding: 8px 12px; font-size: 12px; }
  .foot-brand { margin-top: auto; font-size: 10px; }

  .checkout-page--success .phone.checkout-mobile { overflow: hidden; }
  .success-hero { padding: 20px 18px 12px; flex-shrink: 0; }
  .success-art { width: 120px; height: 120px; }
  .success-art .ring3 { inset: 26px; }
  .state-h1 { font-size: 20px; margin: 12px 0 4px; }
  .state-p { font-size: 12.5px; }
  .phone__body .kv .row { padding: 10px 12px; }
  .phone__body .kv .k { font-size: 11.5px; }
  .phone__body .kv .v { font-size: 12px; }

  .radar { width: 120px; height: 120px; }
  .expired-icon { width: 100px; height: 100px; }

  /* ===== SETTINGS DANGER ZONE row stacks ===== */
  .content .card-pad .flex.between { flex-wrap: wrap; gap: 10px; }

  /* ===== Dashboard chart label row doesn't overflow ===== */
  .chart + .flex { font-size: 9.5px !important; }
}

/* Even narrower (small phones) */
@media (max-width: 480px) {
  .grid.kpi { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 17px; }
}

/* Short phones (viewport height < 680px) — shrink QR further */
@media (max-height: 680px) and (max-width: 760px) {
  .phone__head { padding: 8px 14px 10px; }
  .phone__row { margin-bottom: 10px; }
  .phone__merchant__avatar { width: 30px; height: 30px; font-size: 14px; }
  .phone__amt { margin-top: 8px; }
  .phone__amt .whole { font-size: 32px; }
  .phone__amt .cur, .phone__amt .frac { font-size: 16px; }
  .phone__body { padding: 10px 12px 12px; gap: 8px; }
  .qr-frame { width: 160px; height: 160px; margin-bottom: 6px; }
  .qr-frame img { padding: 6px; border-radius: 12px; }
  .qr-frame .corner { width: 14px; height: 14px; }
  .qr-frame__logo { padding: 4px; border-radius: 8px; }
  .countdown { padding: 5px 8px; }
  .state-h1 { font-size: 18px; }
  .radar { width: 100px; height: 100px; }
  .success-art { width: 110px; height: 110px; }
  .success-art .ring3 { inset: 24px; }
  .expired-icon { width: 80px; height: 80px; }
}
.kv .v.mono { font-family: 'JetBrains Mono', monospace; }

/* Expired */
.expired-icon {
  width: 120px; height: 120px; border-radius: 999px; background: var(--coral-soft);
  display: flex; align-items: center; justify-content: center; color: var(--coral); margin: 0 auto;
  position: relative;
}
.expired-icon::after { content: ''; position: absolute; inset: -8px; border-radius: 999px; border: 2px dashed var(--coral); opacity: .35; }

/* ===========================================================
   AUTH (split-screen)
   =========================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
@media (max-width: 880px) { .auth { grid-template-columns: 1fr; } .auth__art { display: none; } }
.auth__art {
  background: linear-gradient(135deg, var(--primary) 0%, var(--violet) 100%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth__art h2 { color: #fff; font-family: 'Manrope'; font-weight: 800; font-size: 38px; letter-spacing: -.03em; line-height: 1.1; }
.auth__art p  { opacity: .85; font-size: 14px; max-width: 360px; line-height: 1.55; margin-top: 10px; }
.auth__form { padding: 48px; display: flex; flex-direction: column; justify-content: center; max-width: 460px; width: 100%; margin: 0 auto; }
.auth__form h1 { font-family: 'Manrope'; font-weight: 800; font-size: 30px; letter-spacing: -.03em; color: var(--ink); }
.auth__form p  { color: var(--text-muted); margin: 6px 0 24px; font-size: 14px; }
@media (max-width: 640px) { .auth__form { padding: 28px 22px; } }
.auth__divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--text-faint); font-size: 12px; }
.auth__divider hr { flex: 1; height: 1px; background: var(--divider); border: none; margin: 0; }

/* ===========================================================
   ERROR PAGES
   =========================================================== */
.err-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 36px 18px;
  background:
    radial-gradient(800px 400px at 80% -10%, var(--primary-soft) 0%, transparent 60%),
    radial-gradient(700px 380px at 10% 110%, var(--violet-soft) 0%, transparent 60%),
    var(--bg);
}
.err-card {
  max-width: 520px; width: 100%; padding: 48px 36px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  text-align: center; position: relative; overflow: hidden;
}
.err-orb {
  width: 96px; height: 96px; border-radius: 999px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 18px 40px -16px rgba(11,20,55,.25);
  position: relative;
}
.err-orb::before {
  content: ''; position: absolute; inset: -18px; border-radius: 999px;
  border: 2px dashed currentColor; opacity: .25;
  animation: kp-orb-spin 22s linear infinite;
}
@keyframes kp-orb-spin { to { transform: rotate(360deg); } }
.err-orb--coral   { background: linear-gradient(135deg, var(--coral) 0%, #ff8b7e 100%); color: var(--coral); }
.err-orb--saffron { background: linear-gradient(135deg, var(--saffron) 0%, #ffd06b 100%); color: var(--saffron); }
.err-orb--primary { background: linear-gradient(135deg, var(--primary) 0%, var(--violet) 100%); color: var(--primary); }
.err-orb--violet  { background: linear-gradient(135deg, var(--violet) 0%, var(--primary) 100%); color: var(--violet); }
.err-code {
  font-family: 'Manrope', sans-serif; font-weight: 800;
  font-size: 56px; letter-spacing: -.04em; color: var(--ink);
  line-height: 1;
}
.err-kicker {
  display: inline-block; margin-top: 8px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.err-kicker--coral   { background: var(--coral-soft);   color: var(--coral); }
.err-kicker--saffron { background: var(--saffron-soft); color: var(--saffron); }
.err-kicker--primary { background: var(--primary-soft); color: var(--primary); }
.err-kicker--violet  { background: var(--violet-soft);  color: var(--violet); }
.err-title {
  font-family: 'Manrope', sans-serif; font-weight: 800;
  font-size: 26px; letter-spacing: -.025em;
  color: var(--ink); margin: 14px 0 8px;
}
.err-body {
  color: var(--text-muted); font-size: 14px; line-height: 1.55;
  max-width: 360px; margin: 0 auto;
}
.err-actions {
  margin-top: 22px; display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.err-foot {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--divider);
  display: flex; justify-content: center; opacity: .5;
}
@media (max-width: 520px) {
  .err-card { padding: 36px 22px 22px; border-radius: 18px; }
  .err-orb  { width: 80px; height: 80px; }
  .err-code { font-size: 44px; }
  .err-title{ font-size: 22px; }
}

/* Misc utility */
.flex { display: flex; }
.flex.between { justify-content: space-between; }
.flex.center { align-items: center; }
.flex.gap-6 { gap: 6px; } .flex.gap-8 { gap: 8px; } .flex.gap-10 { gap: 10px; } .flex.gap-12 { gap: 12px; } .flex.gap-16 { gap: 16px; }
.col { display: flex; flex-direction: column; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.right { text-align: right; }
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; } .mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

.topbar__menu, .kp-drawer-backdrop { display: none; }
.bn-more { background: none; border: none; }

@media (max-width: 880px) {
  .topbar { padding: 14px 18px; gap: 8px; align-items: center; }
  .topbar__menu { display: inline-flex; flex-shrink: 0; }
  .topbar h1 { font-size: 20px; }
  .search { display: none; }
  .content { padding: 16px 18px 32px; }
  .grid.kpi { grid-template-columns: repeat(2, 1fr); }

  .app-shell { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; max-width: 86vw;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar__pro { padding: 12px 12px 20px; }
  .kp-drawer-backdrop {
    position: fixed; inset: 0; z-index: 99;
    background: rgba(11, 20, 55, .42);
    border: none; padding: 0; cursor: pointer;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  body.kp-drawer-open .sidebar { transform: translateX(0); }
  body.kp-drawer-open .kp-drawer-backdrop { display: block; opacity: 1; pointer-events: auto; }
  body.kp-drawer-open { overflow: hidden; }
}

/* Mobile bottom nav (dashboard mobile) */
.bottom-nav {
  display: none;
}
@media (max-width: 880px) {
  .bottom-nav {
    display: flex; justify-content: space-around;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 8px 6px; padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  .bottom-nav a,
  .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px; color: var(--text-muted); font-size: 10.5px; font-weight: 600;
    background: transparent; border: none; cursor: pointer;
    font-family: inherit; line-height: 1.1;
  }
  .bottom-nav a.is-active,
  .bottom-nav button.is-active { color: var(--primary); }
  .bottom-nav a:hover { text-decoration: none; }
  body.has-bottom-nav { padding-bottom: 64px; }
}

/* Spinner */
.spinner { width: 16px; height: 16px; border-radius: 999px; border: 2px solid currentColor; border-right-color: transparent; animation: kp-spin .8s linear infinite; }
@keyframes kp-spin { to { transform: rotate(360deg); } }
