/* ============================================================
   SUPER CESTA — Sistema de design compartilhado (claro + escuro)
   Tokens extraídos do app Android (objeto T em ShoppingApp.kt)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Spline+Sans+Mono:wght@400;500;600;700&display=swap');

:root {
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, monospace;
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ----- TEMA ESCURO (padrão do app) ----- */
[data-theme="dark"] {
  --bg:        #15120B;
  --bg2:       #100E08;
  --surface:   #1F1B12;
  --surface2:  #2B2618;
  --surface3:  #383020;
  --line:      rgba(244,238,224,.10);
  --line2:     rgba(244,238,224,.20);
  --text:      #F4EEE0;
  --text2:     #B9B095;
  --text3:     #837A62;
  --on-accent: #07140C;
  --primary:   #2DB672;
  --primary-soft: rgba(45,182,114,.18);
  --amber:     #F4B43C;
  --amber-soft: rgba(244,180,60,.18);
  --rose:      #F26A5A;
  --rose-soft: rgba(242,106,90,.18);
  --violet:    #C264CE;
  --violet-soft: rgba(194,100,206,.18);
  --info:      #5C86F2;
  --info-soft: rgba(92,134,242,.20);
  --tang:      #FF6A3D;
  --tang-soft: rgba(255,106,61,.18);
  --green-deep:#82E3B1;
  --shadow:    0 18px 40px -18px rgba(0,0,0,.7);
  --shadow-sm: 0 8px 20px -12px rgba(0,0,0,.6);
}

/* ----- TEMA CLARO ----- */
[data-theme="light"] {
  --bg:        #F4EFE3;
  --bg2:       #EFE8D8;
  --surface:   #FFFFFF;
  --surface2:  #EFE7D5;
  --surface3:  #E6DCC4;
  --line:      #E7DDC8;
  --line2:     #D8CBAE;
  --text:      #1E1B12;
  --text2:     #6E6755;
  --text3:     #A79D85;
  --on-accent: #F2FBF4;
  --primary:   #0F7A4F;
  --primary-soft: #E0EFE3;
  --amber:     #EFA92C;
  --amber-soft: #FBEDD0;
  --rose:      #D8412F;
  --rose-soft: #FAE0DB;
  --violet:    #97419E;
  --violet-soft: #F1E1F3;
  --info:      #2F62E0;
  --info-soft: #E2E8FB;
  --tang:      #EF5F2B;
  --tang-soft: #FBE5D9;
  --green-deep:#0A5234;
  --shadow:    0 22px 44px -24px rgba(74,62,33,.45);
  --shadow-sm: 0 10px 24px -16px rgba(74,62,33,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   MOLDURA DE TELEFONE (mockup canvas)
   ============================================================ */
.stage {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in oklab, var(--canvas-accent, #c9bfa6) 22%, transparent), transparent 70%),
    var(--canvas-bg, #d9d2c2);
  padding: 0;
}
[data-canvas="dark"] .stage { --canvas-bg:#0c0a06; --canvas-accent:#2a2618; }

.phone {
  width: 384px;
  height: 832px;
  border-radius: 52px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 11px #0b0b0d,
    0 0 0 13px #26262b,
    var(--shadow);
  flex: none;
}
.phone-screen {
  position: absolute;
  inset: 0;
  border-radius: 52px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.phone-notch {
  position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  width: 116px; height: 30px; border-radius: 16px;
  background: #0b0b0d; z-index: 60;
}
.statusbar {
  height: 52px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 30px 0;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.statusbar .sb-icons { display: flex; gap: 7px; align-items: center; }

/* Scroll body inside phone */
.screen-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.screen-scroll::-webkit-scrollbar { display: none; }

/* ============================================================
   COMPONENTES COMUNS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.pill.ok    { color: var(--primary); background: var(--primary-soft); }
.pill.warn  { color: var(--amber);   background: var(--amber-soft); }
.pill.danger{ color: var(--rose);    background: var(--rose-soft); }
.pill.tang  { color: var(--tang);    background: var(--tang-soft); }
.pill.info  { color: var(--info);    background: var(--info-soft); }

.icon-box {
  display: grid; place-items: center; flex: none;
  border-radius: var(--r-sm);
  background: var(--primary-soft); color: var(--primary);
}

/* Segmented control */
.segment {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface2); border: 1px solid var(--line);
  border-radius: 99px;
}
.segment button {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  height: 38px; border-radius: 99px;
  font-family: var(--font); font-size: 13.5px; font-weight: 700;
  color: var(--text2); transition: all .2s var(--ease);
}
.segment button.active {
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .segment button.active { background: var(--surface3); }

/* Avatar */
.avatar {
  display: grid; place-items: center; flex: none;
  border-radius: 50%; color: #fff; font-weight: 800;
  border: 2px solid var(--surface);
}

/* Bottom nav (mobile) */
.botnav {
  flex: none; height: 92px; position: relative;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-around;
  padding: 12px 22px 0;
}
.botnav .tab {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--text3);
  background: none; border: 0; cursor: pointer; width: 64px;
}
.botnav .tab.active { color: var(--primary); }
.botnav .fab {
  width: 64px; height: 64px; border-radius: 22px; border: 0; cursor: pointer;
  background: var(--tang); color: #fff;
  display: grid; place-items: center; margin-top: -16px;
  box-shadow: 0 12px 26px -8px color-mix(in oklab, var(--tang) 60%, transparent);
}

/* Utility */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap6{gap:6px}.gap8{gap:8px}.gap10{gap:10px}.gap12{gap:12px}.gap14{gap:14px}.gap16{gap:16px}
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text2); }
.faint { color: var(--text3); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Canvas chrome */
.canvas-head {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 28px;
  background: color-mix(in oklab, var(--canvas-bg, #d9d2c2) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
[data-canvas="dark"] .canvas-head { border-bottom-color: rgba(255,255,255,.08); }
.canvas-title { font-family: var(--font); font-weight: 800; }
.frame-label {
  font-family: var(--font); font-weight: 800; font-size: 15px;
  margin: 0 0 4px;
}
.frame-sub { font-family: var(--font); font-weight: 600; font-size: 12.5px; opacity:.7; margin:0 0 16px; }
