/* ══════════════════════════════════════════════════════════════
   SmartSell Design System — Dark Tech × Flowering Tree
   Ecosystem: Alex Vega (#C0192C red) · SmartCoin (cyan) · SmartSell (rose)
   ══════════════════════════════════════════════════════════════ */

/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ── CSS VARIABLES ── */
:root {
  /* Brand — the flowering tree */
  --brand:        #C2185B;
  --brand-bright: #E91E8C;
  --brand-dim:    #880E4F;
  --brand-glow:   rgba(194, 24, 91, 0.22);
  --brand-pale:   rgba(194, 24, 91, 0.08);
  --trunk:        #8D6E63;

  /* AV ecosystem background (dark tech) */
  --bg:       #080308;
  --bg-2:     #0F060E;
  --surface:  #160C14;
  --surface-2:#1F1020;
  --surface-3:#2A1530;
  --border:   #2E1428;
  --border-2: #3D1C38;

  /* Typography — AV brand system */
  --text:     #D0D0D0;
  --text-2:   #8A8A9A;
  --text-muted:#4A4A5A;
  --white:    #FFFFFF;

  /* Status */
  --success:  #00C896;
  --warning:  #F59E0B;
  --danger:   #FF2D44;
  --info:     #00B4D8;

  /* Spacing / shape */
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;
  --nav-h:     68px;
  --header-h:  54px;
  --transition: .18s cubic-bezier(.4,0,.2,1);

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(0,0,0,.5);
  --shadow:    0 4px 20px rgba(0,0,0,.6);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.7);
  --glow:      0 0 20px var(--brand-glow);

  /* Liquid glass */
  --glass-bg:      rgba(31, 16, 32, 0.45);
  --glass-bg-2:    rgba(42, 21, 48, 0.40);
  --glass-border:  rgba(255, 255, 255, 0.10);
  --glass-hi:      rgba(255, 255, 255, 0.06);
  --glass-blur:    blur(18px) saturate(1.3);
}
[data-theme="light"] {
  --glass-bg:     rgba(255, 255, 255, 0.55);
  --glass-bg-2:   rgba(255, 255, 255, 0.45);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-hi:     rgba(255, 255, 255, 0.5);
}

/* Light theme override */
[data-theme="light"] {
  --bg:       #F4EEF2;
  --bg-2:     #EDE3EA;
  --surface:  #FFFFFF;
  --surface-2:#F9F2F7;
  --surface-3:#F0E6EE;
  --border:   #E0C8D8;
  --border-2: #D4B0C8;
  --text:     #1A0A14;
  --text-2:   #6B3A58;
  --text-muted:#B48CA8;
  --shadow-sm: 0 1px 4px rgba(194,24,91,.08);
  --shadow:    0 4px 20px rgba(194,24,91,.12);
  --shadow-lg: 0 8px 40px rgba(194,24,91,.16);
  --brand-pale: rgba(194,24,91,.06);
  --glow:      0 0 20px rgba(194,24,91,.15);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-bright); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }

/* Monospace for labels and numbers */
.mono, .stat-val, .fin-val, .item-amount { font-family: 'JetBrains Mono', monospace; }

/* ── SVG ICONS ── */
.icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon svg { display: block; }

/* ── SCREENS ── */
.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
}
.hidden { display: none !important; }

/* ── LOADING SCREEN ── */
.loading-screen {
  background: var(--bg);
  align-items: center; justify-content: center;
  z-index: 9999;
}
.loading-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; }

.brand-logo {
  width: 80px; height: 80px;
  color: var(--brand);
  animation: logoPulse 2.4s ease-in-out infinite;
}
.brand-logo svg { width: 100%; height: 100%; }

.brand-wordmark {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.5px;
  color: var(--white);
}
.brand-wordmark span { color: var(--brand); }

.loading-bar {
  width: 140px; height: 2px;
  background: var(--border-2);
  border-radius: 99px; overflow: hidden;
}
.loading-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand-dim), var(--brand-bright));
  border-radius: 99px;
  animation: loadbar 1.8s ease-in-out forwards;
  box-shadow: 0 0 8px var(--brand-glow);
}
@keyframes loadbar { to { width: 100%; } }
@keyframes logoPulse { 0%,100% { opacity:.8; transform:scale(1); } 50% { opacity:1; transform:scale(1.04); } }

/* ════════════════════════════════
   INTRO ANIMATION — SmartCoin ↔ SmartSell
   "Las 2 caras de la misma moneda"
   GPU-accelerated, mobile-optimized
════════════════════════════════ */
.intro-screen {
  background: var(--bg);
  align-items: center; justify-content: center;
  z-index: 9998; overflow: hidden;
}

.intro-stage {
  position: relative;
  width: 200px; height: 240px;
  /* perspective más cercana = efecto 3D más dramático en pantallas pequeñas */
  perspective: 800px;
  display: flex; align-items: center; justify-content: center;
}

.coin {
  position: relative;
  width: 150px; height: 150px;
  transform-style: preserve-3d;
  /* ✅ GPU: will-change garantiza compositing layer propio */
  will-change: transform, opacity;
  /* ✅ Mobile: animación más corta (1.8s vs 2.2s), menos pasos */
  animation: coinFlip 1.8s cubic-bezier(.4,.0,.2,1) forwards;
}

.coin-face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* ✅ NO will-change aquí — rompe backface-visibility en Chrome desktop */
  /* overflow:visible heredado desde .coin-front, .coin-back { overflow:visible!important } */
}

/* ── Cara 1: SmartCoin (colibri) ── */
.coin-front {
  background: radial-gradient(circle at 50% 40%, #0a2a26 0%, #051518 70%, #020a0c 100%);
  border: 2px solid rgba(0,230,180,.5);
  box-shadow:
    0 0 40px rgba(0,230,180,.35),
    inset 0 0 24px rgba(0,230,180,.18),
    inset 0 1px 0 rgba(0,230,180,.3);
}

/* ── Cara 2: SmartSell (árbol) ── */
.coin-back {
  background: radial-gradient(circle at 50% 40%, #2a0a1c 0%, #18060e 70%, #0c0306 100%);
  border: 2px solid rgba(233,30,140,.5);
  box-shadow:
    0 0 40px rgba(233,30,140,.35),
    inset 0 0 24px rgba(233,30,140,.18),
    inset 0 1px 0 rgba(233,30,140,.3);
  /* La cara trasera empieza rotada 180° → se ve cuando la moneda gira */
  transform: rotateY(180deg);
}

/* Borde metálico compartido — efecto moneda premium */
.coin-face::before {
  content: '';
  position: absolute; inset: 2px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.06);
  pointer-events: none;
}

.coin-face img, .coin-face svg {
  /* Mismo tamaño para colibri y árbol — circular con cover */
  width: 78% !important;
  height: 78% !important;
  object-fit: cover !important;
  border-radius: 50% !important;   /* ← imagen circular en ambas caras */
  image-rendering: -webkit-optimize-contrast;
}

/* ════ KEYFRAMES — "Las 2 caras de la misma moneda" ════
   Propiedades GPU-only: transform + opacity (60fps mobile)

   Lógica de rotación:
     rotateY(  0°) = coin-front = hummingbird SmartCoin
     rotateY(180°) = coin-back  = tree SmartSell
     rotateY(360°) = hummingbird (vuelta completa)
     rotateY(540°) = tree SmartSell  ← CARA FINAL DESEADA

   Flujo: entra mostrando árbol (180°) → gira mostrando colibri (360°) → termina en árbol (540°)
*/
@keyframes coinFlip {
  /* Entrada desde abajo — empieza mostrando el ÁRBOL (SmartSell) */
  0%   { transform: translateY(90px)  rotateY(180deg) scale(.8);  opacity: 0; }
  12%  { transform: translateY(0)     rotateY(180deg) scale(1);   opacity: 1; }
  /* Sube y gira → SmartCoin colibri (360°) */
  38%  { transform: translateY(-35px) rotateY(360deg) scale(1.06); }
  /* Sigue → árbol SmartSell de nuevo (540°) */
  65%  { transform: translateY(-20px) rotateY(540deg) scale(1.04); }
  /* Aterriza — cara final: ÁRBOL SmartSell */
  85%  { transform: translateY(0)     rotateY(540deg) scale(1); }
  100% { transform: translateY(0)     rotateY(540deg) scale(1); }
}

/* ── Glow ring que pulsa durante la animación ── */
.intro-stage::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 160px; height: 160px;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 0 var(--brand-glow);
  animation: coinGlow 1.8s ease-out forwards;
  pointer-events: none;
}
@keyframes coinGlow {
  0%   { box-shadow: 0 0 0 0 rgba(194,24,91,0); }
  30%  { box-shadow: 0 0 60px 20px rgba(194,24,91,.3); }
  60%  { box-shadow: 0 0 80px 30px rgba(0,230,180,.25); }
  100% { box-shadow: 0 0 40px 10px rgba(194,24,91,.1); }
}

/* ── Flower burst particles (reducido en mobile) ── */
.flower-burst {
  position: absolute; inset: 0;
  pointer-events: none;
}
.petal {
  position: absolute; top: 50%; left: 50%;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-bright);
  opacity: 0;
  will-change: transform, opacity;
}
.petal:nth-child(odd)  { background: rgba(0,230,180,.9); }
.petal:nth-child(even) { background: var(--brand-bright); }
.intro-screen.bursting .petal { animation: petalBurst .7s ease-out forwards; }
@keyframes petalBurst {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(1); }
}

/* ── Wordmark ── */
.intro-wordmark {
  position: absolute; bottom: 12%;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 1.55rem;
  color: var(--white); letter-spacing: -.5px;
  opacity: 0; will-change: opacity, transform;
}
.intro-wordmark span { color: var(--brand); }
.intro-wordmark small {
  display: block; font-size: .5em; font-weight: 400;
  color: var(--text-muted); letter-spacing: .1em;
  text-transform: uppercase; margin-top: 2px; text-align: center;
}
.intro-screen.revealed .intro-wordmark {
  animation: wordmarkIn .5s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes wordmarkIn {
  from { opacity:0; transform:translateY(10px) scale(.95); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

/* ── Mobile: reducir complejidad de animación ── */
@media (max-width: 480px), (max-height: 700px) {
  .coin {
    width: 120px; height: 120px;
    animation-duration: 1.6s;
  }
  .intro-stage { perspective: 600px; }
  .intro-wordmark { font-size: 1.3rem; }
  /* Menos partículas: el JS usará N=8 en mobile */
}

/* ── LOGIN SCREEN ── */
.login-screen {
  background: var(--bg);
  align-items: center;
  overflow-y: auto;
}
.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(194,24,91,.18) 0%, transparent 60%);
  pointer-events: none;
}
.login-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  padding: 3rem 1.5rem;
  display: flex; flex-direction: column; gap: 2rem;
  margin: auto;
}

.login-brand { text-align: center; }
.login-brand-logo {
  width: 96px; height: 96px;
  color: var(--brand);
  margin: 0 auto 1rem;
  filter: drop-shadow(0 0 20px var(--brand-glow));
}
.login-brand-logo svg { width: 100%; height: 100%; }
.login-brand h1 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem; font-weight: 700;
  color: var(--white); letter-spacing: -0.5px;
}
.login-brand h1 span { color: var(--brand); }
.login-tagline {
  font-size: .82rem; color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  margin-top: .35rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-lg);
}
.login-card h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem; font-weight: 600;
  color: var(--white); margin-bottom: .35rem;
}
.login-card p { font-size: .85rem; color: var(--text-2); margin-bottom: 1.25rem; }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  width: 100%; padding: .85rem 1.25rem;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: .9rem; font-weight: 600; color: var(--text);
  transition: all var(--transition);
}
.btn-google:hover {
  border-color: var(--brand);
  background: var(--brand-pale);
  color: var(--white);
  box-shadow: var(--glow);
}
.btn-google svg { flex-shrink: 0; }

.login-legal {
  font-size: .72rem; color: var(--text-muted);
  text-align: center; margin-top: 1rem; line-height: 1.6;
}
.login-legal a { color: var(--brand); }

.login-divider {
  display: flex; align-items: center; gap: .75rem;
  margin: 1rem 0 .85rem; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; font-size: .72rem;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-demo {
  width: 100%; padding: .75rem 1.25rem;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  background: transparent; color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem; font-weight: 600;
  transition: all var(--transition);
}
.btn-demo:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-pale); }

.login-chips {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
}
.chip {
  display: flex; align-items: center; gap: .35rem;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 40px; padding: .3rem .75rem;
  font-size: .75rem; font-weight: 500; color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
}
.chip .icon { color: var(--brand); width: 14px; height: 14px; }
.chip .icon svg { width: 14px; height: 14px; }

/* ════════════════════════════════
   ONBOARDING (explainer + create/join business)
════════════════════════════════ */
.onboard-screen { background: var(--bg); overflow-y: auto; }
.onboard-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px; margin: 0 auto;
  min-height: 100dvh;
  padding: 2.5rem 1.5rem;
  display: flex; flex-direction: column;
}

/* Explainer slides */
.onboard-slides { flex: 1; display: flex; flex-direction: column; }
.slide { display: none; flex-direction: column; align-items: center; text-align: center; flex: 1; justify-content: center; gap: 1.25rem; }
.slide.active { display: flex; animation: slideFade .35s ease; }
@keyframes slideFade { from { opacity:0; transform:translateX(12px); } to { opacity:1; transform:translateX(0); } }
.slide-icon {
  width: 80px; height: 80px; color: var(--brand);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow);
}
.slide-icon svg { width: 40px; height: 40px; }
.slide h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem; font-weight: 700; color: var(--white);
  letter-spacing: -.3px;
}
.slide p { font-size: .9rem; color: var(--text-2); line-height: 1.6; max-width: 320px; }

.onboard-dots { display: flex; gap: .4rem; justify-content: center; margin: 1.5rem 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-2); transition: all var(--transition); }
.dot.active { background: var(--brand); width: 20px; border-radius: 4px; }

.onboard-actions { display: flex; flex-direction: column; gap: .65rem; }
.onboard-skip { text-align: center; color: var(--text-muted); font-size: .8rem; padding: .5rem; }

/* Business setup (create / join) */
.biz-setup { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; }
.biz-setup-head { text-align: center; }
.biz-setup-head h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem; font-weight: 700; color: var(--white);
}
.biz-setup-head p { font-size: .85rem; color: var(--text-2); margin-top: .4rem; }

.choice-cards { display: flex; flex-direction: column; gap: .75rem; }
.choice-card {
  background: var(--surface); border: 1.5px solid var(--border-2);
  border-radius: var(--radius); padding: 1.1rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all var(--transition); text-align: left; width: 100%;
}
.choice-card:hover { border-color: var(--brand); background: var(--surface-2); box-shadow: var(--glow); }
.choice-card .icon { width: 40px; height: 40px; color: var(--brand); flex-shrink: 0;
  background: var(--brand-pale); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; }
.choice-card .icon svg { width: 22px; height: 22px; }
.choice-text strong { display: block; font-size: .95rem; color: var(--white); font-weight: 600; }
.choice-text span { font-size: .78rem; color: var(--text-muted); }

.biz-form { display: flex; flex-direction: column; gap: .85rem; }
.biz-form .field label { margin-bottom: .1rem; }
.biz-back { display: flex; align-items: center; gap: .35rem; color: var(--text-2);
  font-size: .82rem; font-family: 'JetBrains Mono', monospace; margin-bottom: .5rem; }
.biz-back svg { width: 16px; height: 16px; }

.join-code-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem; font-weight: 700; letter-spacing: .3em;
  color: var(--brand); text-align: center;
  background: var(--surface); border: 1.5px dashed var(--border-2);
  border-radius: var(--radius); padding: 1rem; margin: .5rem 0;
}

/* ── WORKSPACE SWITCHER (modal sheet) ── */
.ws-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease;
}
.ws-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.ws-sheet {
  background: var(--surface); width: 100%; max-width: 480px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--border-2); border-bottom: none;
  padding: 1.25rem; max-height: 80dvh; overflow-y: auto;
  animation: sheetUp .28s cubic-bezier(.4,0,.2,1);
}
@keyframes sheetUp { from { transform:translateY(100%); } to { transform:translateY(0); } }
.ws-sheet-handle { width: 36px; height: 4px; background: var(--border-2); border-radius: 2px; margin: 0 auto .85rem; }
.ws-sheet h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-2); margin-bottom: .75rem;
}
.ws-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: .5rem;
  transition: all var(--transition); width: 100%; text-align: left;
}
.ws-item:hover { background: var(--surface-2); border-color: var(--border-2); }
.ws-item.active { border-color: var(--brand); background: var(--brand-pale); }
.ws-item-logo { width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--surface-3); display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.ws-item-info { flex: 1; min-width: 0; }
.ws-item-info strong { display: block; font-size: .9rem; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-item-info span { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; font-family: 'JetBrains Mono', monospace; letter-spacing: .04em; }
.ws-check { color: var(--brand); }
.ws-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }

/* Header workspace pill */
.ws-pill {
  display: flex; align-items: center; gap: .4rem;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: 40px; padding: .25rem .65rem .25rem .75rem;
  max-width: 150px;
}
.ws-pill-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-pill svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.ws-pill:hover { border-color: var(--brand); }

.role-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: .58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; padding: .1rem .4rem; border-radius: 4px;
  background: var(--brand-pale); color: var(--brand);
}

/* Team list (admin) */
.team-member {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem 0; border-bottom: 1px solid var(--border);
}
.team-member:last-child { border-bottom: none; }
.team-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-3); display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .8rem; overflow: hidden; }
.team-info { flex: 1; min-width: 0; }
.team-info strong { display: block; font-size: .85rem; color: var(--text); }
.team-info span { font-size: .7rem; color: var(--text-muted); }

/* ── PAYWALL ── */
.paywall-screen { background: var(--bg); overflow-y: auto; }
.paywall-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.25rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
  font-size: .95rem; color: var(--white);
  position: sticky; top: 0; z-index: 10;
}
.btn-icon-header {
  color: var(--text-2); padding: .25rem;
  display: flex; align-items: center; width: 28px; height: 28px;
  transition: color var(--transition);
}
.btn-icon-header:hover { color: var(--brand); }
.btn-icon-header svg { width: 20px; height: 20px; }

.paywall-body { padding: 1.5rem; max-width: 440px; margin: 0 auto; }
.paywall-hero { text-align: center; margin-bottom: 2rem; }
.paywall-logo {
  width: 72px; height: 72px; color: var(--brand);
  margin: 0 auto 1rem;
  filter: drop-shadow(0 0 14px var(--brand-glow));
}
.paywall-logo svg { width: 100%; height: 100%; }
.paywall-hero h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem; font-weight: 700; color: var(--white);
}
.paywall-hero p { font-size: .85rem; color: var(--text-2); margin-top: .4rem; }

.plan-card {
  background: var(--surface);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 1.5rem; position: relative;
  box-shadow: var(--shadow), var(--glow);
}
.plan-badge-top {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  padding: .2rem .75rem; border-radius: 40px; white-space: nowrap;
  text-transform: uppercase;
}
.plan-price { text-align: center; padding: 1rem 0 1.25rem; }
.price-currency {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem; font-weight: 700; color: var(--brand);
  vertical-align: top; margin-top: .6rem; display: inline-block;
}
.price-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3.2rem; font-weight: 700; color: var(--white); line-height: 1;
}
.price-period { font-size: .9rem; color: var(--text-2); }

.plan-features { list-style: none; display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1.5rem; }
.plan-features li { display: flex; align-items: center; gap: .6rem; font-size: .88rem; color: var(--text); }
.feat-check { color: var(--success); display: flex; align-items: center; flex-shrink: 0; }
.feat-check svg { width: 16px; height: 16px; }

.plan-note { text-align: center; font-size: .74rem; color: var(--text-muted); margin-top: .75rem; }
.btn-ghost-sm {
  display: block; width: 100%; text-align: center; margin-top: 1.25rem;
  color: var(--text-muted); font-size: .8rem; padding: .5rem;
  transition: color var(--transition);
}
.btn-ghost-sm:hover { color: var(--text-2); }

/* ── APP SHELL ── */
.app-screen { background: var(--bg); }

/* Header */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
}
.header-brand {
  display: flex; align-items: center; gap: .5rem;
  text-decoration: none;
}
.header-logo { width: 28px; height: 28px; color: var(--brand); }
.header-logo svg { width: 100%; height: 100%; }
.header-wordmark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem; font-weight: 700; color: var(--white);
  letter-spacing: -0.3px;
}
.header-wordmark span { color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: .35rem; }

.btn-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: all var(--transition);
}
.btn-icon:hover { color: var(--brand); background: var(--brand-pale); }
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon.spinning svg { animation: spin .8s linear infinite; }

.user-avatar-btn {
  width: 32px; height: 32px;
  border-radius: 50%; overflow: hidden;
  background: var(--surface-3);
  border: 1.5px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem; font-weight: 700; color: var(--brand);
  transition: border-color var(--transition);
}
.user-avatar-btn:hover { border-color: var(--brand); }
.user-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Main scroll area */
.app-main {
  position: fixed;
  top: var(--header-h);
  bottom: var(--nav-h);
  left: 0; right: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.app-main::-webkit-scrollbar { width: 4px; }
.app-main::-webkit-scrollbar-track { background: transparent; }
.app-main::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(15,6,14,.82);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: stretch;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: .58rem; font-weight: 500; letter-spacing: .02em;
  transition: color var(--transition), transform var(--transition);
  padding: .5rem .2rem;
  text-transform: uppercase; border-radius: var(--radius-sm);
  position: relative;
}
.nav-item svg { width: 20px; height: 20px; transition: transform var(--transition); }
.nav-item:active { transform: scale(.88); }
.nav-item.active { color: var(--brand); }
.nav-item.active::before {
  content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 2px;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand-glow);
}
.nav-item.active svg { transform: translateY(-2px) scale(1.08); filter: drop-shadow(0 0 4px var(--brand-glow)); }

/* ── TAB PANELS ── */
.tab-panel { display: none; padding: 1rem; }
.tab-panel.active { display: block; }

.ia-panel { display: none !important; flex-direction: column; height: 100%; padding: 0; }
.ia-panel.active { display: flex !important; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; padding-top: .25rem;
}
.panel-header h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem; font-weight: 700; color: var(--white);
  letter-spacing: -.3px; white-space: nowrap;
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .6rem; margin-bottom: .75rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  display: flex; align-items: center; gap: .75rem;
  border-left: 2px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.stat-card {
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover  { background: var(--surface-2); transform: translateY(-1px); }
.stat-card:active { transform: scale(.97); }
.stat-card[data-color="rose"]   { border-left-color: var(--brand);   box-shadow: inset 3px 0 12px -8px var(--brand); }
.stat-card[data-color="green"]  { border-left-color: var(--success);  box-shadow: inset 3px 0 12px -8px var(--success); }
.stat-card[data-color="orange"] { border-left-color: var(--warning);  box-shadow: inset 3px 0 12px -8px var(--warning); }
.stat-card[data-color="blue"]   { border-left-color: var(--info);     box-shadow: inset 3px 0 12px -8px var(--info); }

.stat-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card[data-color="rose"]   .stat-icon { background: var(--brand-pale); color: var(--brand); }
.stat-card[data-color="green"]  .stat-icon { background: rgba(0,200,150,.08); color: var(--success); }
.stat-card[data-color="orange"] .stat-icon { background: rgba(245,158,11,.08); color: var(--warning); }
.stat-card[data-color="blue"]   .stat-icon { background: rgba(0,180,216,.08); color: var(--info); }
.stat-icon svg { width: 18px; height: 18px; }

.stat-data { display: flex; flex-direction: column; min-width: 0; }
.stat-val {
  font-size: 1.05rem; font-weight: 700; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-lbl {
  font-size: .62rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

/* ── PERIOD NAV ── */
.period-nav {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-bottom: .85rem;
}
.period-arrow {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); border: 1px solid var(--border);
  background: var(--surface); transition: all var(--transition);
}
.period-arrow svg { width: 16px; height: 16px; }
.period-arrow:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.period-arrow:disabled { opacity: .35; cursor: not-allowed; }
.period-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem; font-weight: 600; color: var(--text);
  min-width: 150px; text-align: center; text-transform: capitalize;
}

/* ── CHARTS ── */
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .75rem;
}
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
.charts-row .chart-card { margin-bottom: 0; }
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .75rem;
}
.chart-head h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem; font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .05em;
}
.chart-sub { font-family: 'JetBrains Mono', monospace; font-size: .85rem; font-weight: 700; color: var(--brand); }
.chart-body { width: 100%; }
.chart-empty {
  text-align: center; color: var(--text-muted); font-size: .8rem;
  padding: 1.5rem 0; font-family: 'JetBrains Mono', monospace;
}

/* Bar chart (HTML, crisp) */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 130px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar-fill {
  width: 100%; border-radius: 3px 3px 0 0; min-height: 2px;
  background: linear-gradient(180deg, #E91E8C 0%, #C2185B 60%, #880E4F 100%);
  box-shadow: 0 0 8px rgba(233,30,140,.25);
  animation: barGrow .5s cubic-bezier(.4,0,.2,1) backwards;
  transition: filter var(--transition);
}
.bar-col:hover .bar-fill { filter: brightness(1.2); }
@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } }
.bar-x {
  font-size: .56rem; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; white-space: nowrap;
}

/* Donut */
/* Legacy alias kept for potential old code */
.donut-wrap { display: flex; align-items: center; gap: 1rem; }

/* New layout: SVG centered above legend on narrow, side-by-side on wide */
.donut-layout {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.donut-svg-wrap {
  flex-shrink: 0;
  /* ✅ FIX: NO usar CSS filter aquí — crea stacking context que rompe
     stroke-dasharray en Chrome. Glow se hace con pseudo-elemento. */
  position: relative;
  border-radius: 50%;
  transition: transform var(--transition);
}
.donut-svg-wrap::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(194,24,91,.3);
  pointer-events: none;
  transition: box-shadow var(--transition);
}
.donut-svg-wrap:hover { transform: scale(1.03); }
.donut-svg-wrap:hover::after { box-shadow: 0 0 40px rgba(194,24,91,.55); }
.donut { width: 150px; height: 150px; }
.donut-center-val {
  font-size: 14px; font-weight: 700; fill: var(--white);
  font-family: 'JetBrains Mono', monospace;
}
.donut-center-lbl {
  font-size: 5.5px; fill: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; letter-spacing: .1em;
}
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: .4rem; min-width: 130px; }
.donut-leg-item { display: flex; align-items: center; gap: .5rem; font-size: .76rem; border-radius: var(--radius-sm); }
.donut-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-leg-lbl { flex: 1; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-leg-val { color: var(--white); font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .78rem; }

/* ── CATEGORÍA INLINE ── */
.cat-inline { display: flex; gap: .4rem; align-items: center; }
.cat-inline-inp { flex: 1; }
.cat-inline-ok, .cat-inline-cancel {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); transition: all var(--transition);
}
.cat-inline-ok { color: var(--success); }
.cat-inline-ok:hover { background: var(--success); color: #fff; border-color: var(--success); }
.cat-inline-cancel { color: var(--text-muted); }
.cat-inline-cancel:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.cat-inline svg { width: 16px; height: 16px; }

.fin-note { font-size: .62rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

/* ── INSIGHT CARD ── */
.insight-card {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 1rem 1.1rem;
  margin-bottom: .75rem;
  position: relative; overflow: hidden;
}
.insight-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: .6;
}
.insight-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .5rem;
}
.insight-label {
  display: flex; align-items: center; gap: .4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem; font-weight: 600; color: var(--brand);
  text-transform: uppercase; letter-spacing: .06em;
}
.insight-label .icon { color: var(--brand); width: 14px; height: 14px; }
.insight-label .icon svg { width: 14px; height: 14px; }
.btn-text-sm { font-size: .72rem; color: var(--text-muted); transition: color var(--transition); }
.btn-text-sm:hover { color: var(--brand); }
.insight-body {
  font-size: .85rem; line-height: 1.55; color: var(--text);
}

/* ── SECTION CARDS ── */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem; margin-bottom: .75rem;
}
.section-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .65rem;
}
.section-card h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem; font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .05em;
}
.btn-text {
  font-size: .78rem; color: var(--brand); font-weight: 500;
  transition: color var(--transition);
}
.btn-text:hover { color: var(--brand-bright); }

/* ── FORMS ── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 1.1rem;
  margin-bottom: .75rem;
}
.form-card.collapsed { display: none; }
.form-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem; font-weight: 600; color: var(--white);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: .85rem;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-bottom: .85rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field.full { grid-column: span 2; }

.field label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem; font-weight: 500; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .05em;
}
.inp {
  width: 100%; padding: .6rem .75rem;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: .88rem; color: var(--text);
  background: var(--bg-2);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none; appearance: none;
}
.inp:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.inp::placeholder { color: var(--text-muted); }
select.inp {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A4A5A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 16px;
  padding-right: 2rem;
  cursor: pointer;
}
select.inp option { background: var(--surface-2); color: var(--text); }

.form-actions { display: flex; gap: .65rem; justify-content: flex-end; }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--brand); color: var(--white);
  padding: .65rem 1.4rem; border-radius: var(--radius);
  font-size: .88rem; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .02em;
  transition: all var(--transition);
  cursor: pointer; border: none;
}
.btn-primary:hover { background: var(--brand-bright); box-shadow: var(--glow); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-lg { padding: .85rem 2rem; font-size: .95rem; width: 100%; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--brand-pale); color: var(--brand);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  padding: .6rem 1.2rem; font-size: .85rem; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--brand); background: var(--brand-pale); box-shadow: var(--glow); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: none; color: var(--text-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem 1.2rem; font-size: .85rem; font-weight: 500;
  transition: all var(--transition);
}
.btn-ghost:hover { border-color: var(--border-2); color: var(--text); background: var(--surface-2); }

.btn-ghost-sm { background: none; color: var(--text-muted); font-size: .8rem; transition: color var(--transition); }
.btn-ghost-sm:hover { color: var(--text-2); }

.btn-danger {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  background: rgba(255,45,68,.07); color: var(--danger);
  border: 1.5px solid rgba(255,45,68,.25);
  border-radius: var(--radius); padding: .65rem 1.25rem;
  font-size: .88rem; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  width: 100%; transition: all var(--transition);
}
.btn-danger:hover { background: rgba(255,45,68,.14); border-color: var(--danger); }

.btn-fab-header {
  display: flex; align-items: center; gap: .35rem;
  background: var(--brand-pale); color: var(--brand);
  border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: .4rem .85rem;
  font-size: .78rem; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .03em;
  transition: all var(--transition);
}
.btn-fab-header:hover { background: var(--brand); color: var(--white); border-color: var(--brand); }
.btn-fab-header .icon { width: 14px; height: 14px; }
.btn-fab-header .icon svg { width: 14px; height: 14px; }

.btn-sm { padding: .45rem .9rem; font-size: .8rem; }

/* ── FILTERS ── */
.filter-row {
  display: flex; gap: .5rem; margin-bottom: .65rem; align-items: center;
}
.search-inp { flex: 1; }
.select-sm {
  padding: .5rem .65rem;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  background: var(--surface);
  color: var(--text);
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A4A5A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .4rem center;
  background-size: 14px; padding-right: 1.6rem; cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
}
select option { background: var(--surface-2); color: var(--text); }

/* ── ITEM LISTS ── */
.item-list { display: flex; flex-direction: column; gap: .45rem; }
.item-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
  transition: background var(--transition), border-left-color var(--transition);
}
.item-row:hover { background: var(--surface-2); border-left-color: var(--brand); }
.item-row.sale       { border-left-color: var(--brand); }
.item-row.ingreso    { border-left-color: var(--success); }
.item-row.egreso     { border-left-color: var(--danger); }
.item-row.inversion  { border-left-color: var(--info); }

.item-main { flex: 1; min-width: 0; }
.item-title {
  font-weight: 600; font-size: .88rem; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-sub { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

.item-right { text-align: right; flex-shrink: 0; }
.item-amount { font-size: .9rem; font-weight: 700; color: var(--white); }
.item-date { font-size: .68rem; color: var(--text-muted); margin-top: 2px; }

.item-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.btn-action {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--transition);
}
.btn-action svg { width: 14px; height: 14px; }
.btn-action:hover { background: var(--surface-3); color: var(--brand); }
.btn-action.danger:hover { color: var(--danger); }

.empty-msg {
  text-align: center; color: var(--text-muted); font-size: .85rem;
  padding: 2.5rem 1rem;
  font-family: 'JetBrains Mono', monospace;
}

/* Total bar */
.total-bar {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: .6rem .9rem; margin-top: .6rem;
  display: flex; justify-content: space-between;
  font-size: .82rem; color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
}
.total-bar strong { color: var(--brand); }

/* ── PRODUCTS GRID ── */
.products-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem; position: relative; overflow: hidden;
  transition: border-color var(--transition), background var(--transition);
}
.product-card:hover { background: var(--surface-2); border-color: var(--border-2); }
.product-card.low-stock { border-color: rgba(255,45,68,.35); }
.product-card.low-stock .low-stock-badge {
  display: flex; align-items: center; gap: .25rem;
}
.low-stock-badge {
  display: none;
  position: absolute; top: 0; right: 0;
  background: var(--danger); color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  font-size: .58rem; font-weight: 700; letter-spacing: .04em;
  padding: .2rem .5rem; border-radius: 0 var(--radius) 0 var(--radius-sm);
}
.product-name {
  font-weight: 700; font-size: .88rem; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: .2rem;
}
.product-cat { font-size: .68rem; color: var(--text-muted); margin-bottom: .6rem; }
.product-stock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem; font-weight: 700; color: var(--brand); line-height: 1;
}
.product-stock-lbl { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.product-price { font-size: .75rem; color: var(--text-2); margin-top: .4rem; }
.product-actions { display: flex; gap: .2rem; margin-top: .6rem; }

/* Alert bar */
.alert-bar {
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--radius-sm); padding: .55rem .9rem;
  font-size: .82rem; color: var(--warning); margin-bottom: .65rem;
  display: flex; align-items: center; gap: .45rem;
  font-family: 'JetBrains Mono', monospace;
}
.alert-bar .icon { width: 16px; height: 16px; }
.alert-bar .icon svg { width: 16px; height: 16px; }

/* ── FINANCE ── */
.finance-summary {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .6rem; margin-bottom: .75rem;
}
.fin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  display: flex; flex-direction: column; gap: .2rem;
  border-left: 2px solid transparent;
}
.fin-card.green  { border-left-color: var(--success); }
.fin-card.red    { border-left-color: var(--danger); }
.fin-card.blue   { border-left-color: var(--info); }
.fin-card.gold   { border-left-color: var(--brand); }
.fin-lbl {
  font-size: .62rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  font-family: 'JetBrains Mono', monospace;
}
.fin-val { font-size: 1.05rem; font-weight: 700; }
.fin-card.green .fin-val { color: var(--success); }
.fin-card.red   .fin-val { color: var(--danger); }
.fin-card.blue  .fin-val { color: var(--info); }
.fin-card.gold  .fin-val { color: var(--brand); }

.radio-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.radio-opt {
  display: flex; align-items: center; gap: .35rem;
  font-size: .85rem; color: var(--text-2); cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
}
.radio-opt input { accent-color: var(--brand); }

.sub-tab-row {
  display: flex; gap: .4rem; margin-bottom: .65rem;
  overflow-x: auto; padding-bottom: .2rem;
  scrollbar-width: none;
}
.sub-tab-row::-webkit-scrollbar { display: none; }
.sub-tab {
  padding: .35rem .9rem; border-radius: 40px;
  font-size: .72rem; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .03em; text-transform: uppercase;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2);
  white-space: nowrap; transition: all var(--transition);
}
.sub-tab.active { background: var(--brand); color: var(--white); border-color: var(--brand); }
.sub-tab:hover:not(.active) { border-color: var(--border-2); color: var(--text); }

/* ── AI CHAT ── */
.ia-panel > .panel-header { padding: .85rem 1rem .5rem; flex-shrink: 0; }

.ia-context-bar {
  padding: .5rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.toggle-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .75rem; color: var(--text-2); cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
}
.toggle-switch {
  width: 34px; height: 18px; background: var(--border-2);
  border-radius: 9px; position: relative;
  transition: background var(--transition); flex-shrink: 0;
  cursor: pointer;
}
input[type=checkbox]:checked + .toggle-switch { background: var(--brand); }
.toggle-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--white);
  transition: transform var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
input[type=checkbox]:checked + .toggle-switch::after { transform: translateX(16px); }
input[type=checkbox] { display: none; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: .85rem 1rem;
  display: flex; flex-direction: column; gap: .85rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}

.msg { display: flex; gap: .6rem; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.msg-avatar.ai {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  color: var(--brand);
}
.msg-avatar.ai svg { width: 32px; height: 32px; }
.msg-avatar.user {
  background: var(--brand-pale);
  border: 1px solid var(--brand);
  color: var(--brand);
}
.msg-avatar.user svg { width: 32px; height: 32px; }

.msg-bubble {
  max-width: 78%; padding: .7rem .9rem;
  border-radius: var(--radius);
  font-size: .88rem; line-height: 1.55;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.msg-bubble p + p { margin-top: .45rem; }
.msg.user .msg-bubble {
  background: var(--brand);
  border-color: transparent;
  color: var(--white);
}

/* Typing indicator */
.msg-typing .msg-bubble { padding: .75rem 1rem; }
.typing-dots { display: flex; gap: 4px; align-items: center; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted); display: block;
  animation: typingBlink 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBlink { 0%,80%,100% { opacity:.2; } 40% { opacity:1; } }

.chat-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0; padding: .6rem;
}
.quick-prompts {
  display: flex; gap: .35rem; overflow-x: auto;
  padding: .2rem 0 .5rem; scrollbar-width: none;
}
.quick-prompts::-webkit-scrollbar { display: none; }
.qp {
  display: flex; align-items: center; gap: .3rem;
  white-space: nowrap; padding: .3rem .7rem;
  border-radius: 40px;
  font-size: .72rem; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .02em;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); transition: all var(--transition);
}
.qp:hover { background: var(--brand-pale); color: var(--brand); border-color: var(--brand); }
.qp .icon { width: 12px; height: 12px; }
.qp .icon svg { width: 12px; height: 12px; }

.chat-input-row {
  display: flex; gap: .5rem; align-items: flex-end;
}
.chat-textarea {
  flex: 1; padding: .6rem .8rem;
  border: 1.5px solid var(--border-2); border-radius: var(--radius);
  font-size: .88rem; resize: none; max-height: 110px;
  background: var(--bg-2); color: var(--text);
  transition: border-color var(--transition);
  line-height: 1.45; font-family: 'Inter', sans-serif;
}
.chat-textarea:focus { outline: none; border-color: var(--brand); }
.chat-textarea::placeholder { color: var(--text-muted); }

.btn-send {
  width: 38px; height: 38px; border-radius: var(--radius);
  background: var(--brand); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--transition);
}
.btn-send:hover:not(:disabled) {
  background: var(--brand-bright);
  box-shadow: var(--glow); transform: scale(1.04);
}
.btn-send:disabled { background: var(--surface-3); color: var(--text-muted); cursor: not-allowed; }
.btn-send svg { width: 18px; height: 18px; }

/* ── CONFIG ── */
.config-profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1rem;
  margin-bottom: .75rem;
  display: flex; align-items: center; gap: .85rem;
}
.cfg-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface-3); border: 1.5px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem; font-weight: 700; color: var(--brand); flex-shrink: 0;
  overflow: hidden;
}
.cfg-profile-info { flex: 1; min-width: 0; }
.cfg-profile-info strong {
  font-size: .95rem; font-weight: 600; color: var(--white);
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cfg-profile-info span { font-size: .75rem; color: var(--text-muted); }
.plan-badge-sm {
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 40px;
  padding: .2rem .6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem; font-weight: 700; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .05em;
}
.plan-badge-sm.pro {
  background: var(--brand-pale); color: var(--brand);
  border-color: var(--border-2);
}

.config-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1rem;
  margin-bottom: .6rem;
  transition: box-shadow var(--transition);
}
.config-section:has(.cfg-body) { cursor: default; }
.config-section h3 {
  display: flex; align-items: center; gap: .5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem; font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .65rem;
  user-select: none;
}
.config-section.collapsible h3 {
  cursor: pointer;
  margin-bottom: 0;
  justify-content: space-between;
  padding: .1rem 0;
}
.config-section.collapsible h3:hover { color: var(--text); }
.config-section.collapsible h3 .cfg-chevron {
  width: 18px; height: 18px; color: var(--text-muted);
  flex-shrink: 0; transition: transform .25s ease;
  margin-left: auto;
}
.config-section.collapsible[data-open="true"] h3 .cfg-chevron { transform: rotate(180deg); }
.cfg-body {
  overflow: hidden; max-height: 0;
  transition: max-height .28s cubic-bezier(.4,0,.2,1), opacity .2s ease, margin-top .2s ease;
  opacity: 0; margin-top: 0;
}
.config-section.collapsible[data-open="true"] .cfg-body {
  max-height: 600px; opacity: 1; margin-top: .65rem;
}
.config-section.collapsible[data-open="false"] h3 { margin-bottom: 0; }

.config-section h3 .icon { color: var(--brand); width: 16px; height: 16px; }
.config-section h3 .icon svg { width: 16px; height: 16px; }

.config-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .35rem 0;
}
.config-row label { font-size: .85rem; color: var(--text-2); }
.cfg-desc { font-size: .8rem; color: var(--text-muted); margin-bottom: .7rem; line-height: 1.5; }

.toggle { display: flex; align-items: center; flex-shrink: 0; }
.toggle input { display: none; }
.toggle-slider {
  width: 40px; height: 22px; background: var(--border-2);
  border-radius: 11px; position: relative; cursor: pointer;
  transition: background var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--brand); }
.toggle-slider::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--white);
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); }

.bridge-detail { margin-top: .65rem; display: flex; flex-direction: column; gap: .45rem; }
.sheets-result {
  margin-top: .65rem; font-size: .8rem;
  background: rgba(0,200,150,.06); border: 1px solid rgba(0,200,150,.2);
  padding: .6rem .85rem; border-radius: var(--radius-sm); color: var(--success);
  font-family: 'JetBrains Mono', monospace;
}
.subscription-status-block { margin-bottom: .7rem; font-size: .85rem; color: var(--text-2); line-height: 1.5; }

/* ══ SmartClub Subscription Card ══ */
.smartclub-card {
  position: relative; overflow: hidden;
  border-radius: var(--liquid-radius);
  background: linear-gradient(145deg, rgba(194,24,91,.18) 0%, rgba(12,8,20,.95) 60%);
  border: 1px solid rgba(194,24,91,.35);
  box-shadow: 0 4px 32px rgba(194,24,91,.15), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 1.1rem;
  margin-bottom: .75rem;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--spring);
}
.smartclub-card.is-pro {
  background: linear-gradient(145deg, rgba(0,200,100,.12) 0%, rgba(12,8,20,.95) 60%);
  border-color: rgba(0,200,100,.35);
  box-shadow: 0 4px 32px rgba(0,200,100,.12), inset 0 1px 0 rgba(255,255,255,.06);
}
.smartclub-glow {
  position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(194,24,91,.35) 0%, transparent 70%);
  pointer-events: none;
}
.smartclub-card.is-pro .smartclub-glow {
  background: radial-gradient(circle, rgba(0,200,100,.3) 0%, transparent 70%);
}
.smartclub-top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem;
}
.smartclub-badge {
  display: flex; align-items: center; gap: .35rem;
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--brand); font-family: 'JetBrains Mono', monospace;
}
.smartclub-badge svg { color: var(--brand); }
.smartclub-price {
  font-size: 1.15rem; font-weight: 800; color: var(--white);
  font-family: 'JetBrains Mono', monospace;
}
.smartclub-period { font-size: .72rem; font-weight: 400; color: var(--text-muted); }

.smartclub-status-block { margin-bottom: .75rem; font-size: .8rem; }
.smartclub-active-tag {
  display: inline-flex; align-items: center; gap: .3rem;
  color: #22c55e; font-weight: 600; font-size: .8rem;
}
.smartclub-inactive-tag { color: var(--text-muted); font-size: .78rem; }

.smartclub-features {
  list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .35rem;
}
.smartclub-features li {
  display: flex; align-items: center; gap: .4rem;
  font-size: .78rem; color: var(--text-2);
}
.smartclub-features li svg { color: var(--brand); flex-shrink: 0; }

.smartclub-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1rem;
  background: linear-gradient(135deg, var(--brand-bright) 0%, var(--brand) 100%);
  color: #fff; border: none; border-radius: var(--liquid-radius-sm);
  font-size: .88rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 20px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .18s var(--spring), box-shadow .18s ease;
}
.smartclub-btn:hover { box-shadow: 0 6px 28px var(--brand-glow); transform: translateY(-1px); }
.smartclub-btn:active { transform: scale(.97); }
.smartclub-card.is-pro .smartclub-btn {
  background: rgba(255,255,255,.08);
  box-shadow: none; border: 1px solid var(--glass-border-premium);
  color: var(--text);
}
.smartclub-note {
  font-size: .65rem; color: var(--text-muted); text-align: center;
  margin-top: .65rem; line-height: 1.5;
}

/* ══ SmartCoin Promo Card (config tab) ══ */
.smartcoin-promo {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 30% 0%, rgba(0,230,180,.15) 0%, rgba(0,230,180,.03) 50%, transparent 70%),
              linear-gradient(145deg, rgba(0,40,32,.7) 0%, rgba(6,20,18,.8) 100%);
  border: 1px solid rgba(0,230,180,.3);
  box-shadow: 0 0 40px rgba(0,230,180,.1), inset 0 1px 0 rgba(0,230,180,.2);
  padding: 1.5rem;
  margin: .75rem 0 1.5rem;
  text-decoration: none; display: block;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  cursor: pointer;
}
.smartcoin-promo:hover {
  border-color: rgba(0,230,180,.55);
  box-shadow: 0 0 60px rgba(0,230,180,.2), inset 0 1px 0 rgba(0,230,180,.3);
  transform: translateY(-2px);
}
.smartcoin-promo:active { transform: scale(.98); }

/* Floating particles bg */
.scp-particles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.scp-dot {
  position: absolute;
  width: 4px; height: 4px; border-radius: 50%;
  background: #00E6B4; opacity: 0;
  animation: scpFloat var(--d, 4s) var(--delay, 0s) ease-in-out infinite;
}
@keyframes scpFloat {
  0%   { opacity: 0; transform: translateY(0) scale(0); }
  20%  { opacity: .6; transform: translateY(-10px) scale(1); }
  80%  { opacity: .3; transform: translateY(-40px) scale(.8); }
  100% { opacity: 0; transform: translateY(-60px) scale(0); }
}

/* Hummingbird orbit */
.scp-hbird-wrap {
  position: absolute; top: -12px; right: -12px;
  width: 90px; height: 90px;
  animation: scpHbirdOrbit 6s ease-in-out infinite;
}
@keyframes scpHbirdOrbit {
  0%   { transform: translate(0,0) rotate(-5deg); }
  25%  { transform: translate(-8px, 6px) rotate(3deg); }
  50%  { transform: translate(-4px, 12px) rotate(-2deg); }
  75%  { transform: translate(4px, 6px) rotate(5deg); }
  100% { transform: translate(0,0) rotate(-5deg); }
}
.scp-hbird-img {
  width: 70px; height: 70px; border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 12px rgba(0,230,180,.6));
  opacity: .9;
  animation: scpWing .35s ease-in-out infinite alternate;
}
@keyframes scpWing {
  from { transform: scaleX(1); }
  to   { transform: scaleX(.92); }
}

/* Content */
.scp-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem; font-weight: 600; letter-spacing: .1em;
  color: #00E6B4; text-transform: uppercase; margin-bottom: .6rem;
  opacity: .8;
}
.scp-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem; font-weight: 700;
  color: #fff; margin-bottom: .4rem; line-height: 1.2;
  max-width: 70%;
}
.scp-desc {
  font-size: .82rem; color: rgba(255,255,255,.65);
  line-height: 1.55; margin-bottom: 1rem; max-width: 75%;
}
.scp-desc span { color: #00E6B4; font-weight: 600; }
.scp-cta {
  display: inline-block;
  background: #00E6B4;
  color: #041210;
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem; font-weight: 700;
  padding: .65rem 1.25rem;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,230,180,.35);
  width: 100%;
  text-align: center;
}
.scp-cta:hover {
  background: #33EFC7; color: #041210;
  box-shadow: 0 6px 24px rgba(0,230,180,.5);
  transform: translateY(-1px);
}
.scp-cta:active { transform: scale(.97); }
.scp-note {
  font-size: .68rem; color: rgba(0,230,180,.5);
  text-align: center; margin-top: .6rem;
  font-family: 'JetBrains Mono', monospace;
}

.made-by { font-size: .82rem; color: var(--text-2); margin-bottom: .35rem; }
.made-by-link {
  color: var(--brand); font-weight: 700; text-decoration: none;
  border-bottom: 1px dashed var(--brand); padding-bottom: 1px;
}
.made-by-link:hover { color: var(--brand-bright); }
.footer-meta { font-size: .72rem; }

.app-footer-note {
  text-align: center; font-size: .7rem; color: var(--text-muted);
  padding: 1.5rem 0; margin-top: .25rem;
  font-family: 'JetBrains Mono', monospace;
}
.app-footer-note a { color: var(--brand); }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + .75rem);
  right: .75rem; z-index: 9000;
  display: flex; flex-direction: column; gap: .4rem;
  pointer-events: none;
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  color: var(--text); border-radius: var(--radius-sm);
  padding: .6rem .9rem;
  font-size: .82rem; font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn .22s ease;
  max-width: 260px;
  display: flex; align-items: center; gap: .5rem;
}
.toast .icon { width: 16px; height: 16px; flex-shrink: 0; }
.toast .icon svg { width: 16px; height: 16px; }
.toast.success { border-color: rgba(0,200,150,.3); color: var(--success); }
.toast.error   { border-color: rgba(255,45,68,.3);  color: var(--danger); }
.toast.warning { border-color: rgba(245,158,11,.3); color: var(--warning); }
.toast.info    { border-color: rgba(0,180,216,.3);  color: var(--info); }
.toast.fade-out { animation: toastOut .22s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(12px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { to   { opacity:0; transform:translateX(12px); } }

/* ── MISC ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; display: inline-block; }

/* ── RESPONSIVE ── */
@media (min-width: 768px) {
  .stats-grid     { grid-template-columns: repeat(4, 1fr); }
  .form-grid      { grid-template-columns: repeat(3, 1fr); }
  .products-grid  { grid-template-columns: repeat(3, 1fr); }
  .finance-summary{ grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .app-main, .bottom-nav {
    max-width: 820px; left: 50%; transform: translateX(-50%);
  }
  .app-header { padding: 0 calc(50% - 410px + 1rem); }
  .toast-container { right: calc(50% - 410px + .75rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* ════════════════════════════════════════════
   LIQUID GLASS — translucent surfaces + blur
   ════════════════════════════════════════════ */
.app-header, .bottom-nav {
  background: var(--glass-bg) !important;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-color: var(--glass-border);
}
.stat-card, .section-card, .chart-card, .config-section,
.form-card, .fin-card, .item-row, .insight-card,
.login-card, .ws-sheet, .config-profile-card, .plan-card,
.family-card, .product-card, .msg-bubble {
  background: var(--glass-bg) !important;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-hi);
}
.insight-card {
  background: linear-gradient(135deg, var(--brand-glow), var(--glass-bg-2)) !important;
}
.stat-card:hover, .chart-card:hover, .section-card:hover {
  border-color: var(--glass-border);
  box-shadow: var(--glow), inset 0 1px 0 var(--glass-hi);
}
/* glass ambient glow behind app */
.app-screen::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 40% at 80% 0%, var(--brand-glow), transparent 70%),
    radial-gradient(50% 35% at 0% 100%, var(--brand-glow), transparent 70%);
  opacity: .5;
}
/* bar chart follows accent */
.bar-fill { background: linear-gradient(180deg, var(--brand-bright) 0%, var(--brand) 60%, var(--brand-dim) 100%) !important; }

/* ── ACCENT SWATCHES ── */
.accent-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.accent-sw {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
  position: relative;
}
.accent-sw:hover { transform: scale(1.12); }
.accent-sw.active { border-color: var(--white); box-shadow: 0 0 12px currentColor; }


/* ── LOGO IMAGE (imagen oficial PNG) ── */
.logo-img { display:block; width:100%; height:100%; object-fit:contain; }
.coin-back { background: #060a0a !important; overflow: hidden; }
.coin-back .logo-img { object-fit: cover; border-radius: 50%; }
.header-logo .logo-img { object-fit: contain; }

.logo-img-full, .logo-img-small { border-radius: 50%; object-fit: cover; }

/* moneda cara frontal (colibrí imagen) redonda */
.coin-front { background: #060a0a !important; overflow: hidden; }
.coin-front .logo-img { object-fit: cover; border-radius: 50%; width:100%; height:100%; }
/* ícono familia SmartCoin redondo */
.family-icon { border-radius: 50%; overflow: hidden; }
.family-icon .logo-img { width:100%; height:100%; object-fit: cover; border-radius:50%; }

/* ── DONUT interactivo ── */
.donut-seg { cursor: pointer; transition: stroke-width .18s ease, opacity .18s ease; transform-box: fill-box; transform-origin: center; }
.donut:hover .donut-seg:not(.active) { opacity: .35; }
.donut-seg.active { stroke-width: 17; opacity: 1; }
.donut-center-val, .donut-center-lbl { transition: opacity .15s ease; }
.donut-leg-item {
  background: none; border: none; width: 100%; text-align: left; cursor: pointer;
  padding: .15rem .25rem; border-radius: 6px;
  transition: background .15s ease;
}
.donut-leg-item:hover, .donut-leg-item.active { background: var(--glass-hi); }
.donut-leg-item.active .donut-leg-lbl { color: var(--text); font-weight: 600; }

/* FIX giro 3D: overflow:hidden rompe backface-visibility → quitarlo.
   La imagen ya es redonda por su propio border-radius. */
.coin-front, .coin-back { overflow: visible !important; }

/* ══════════════════════════════════════════════════════
   CITAS (APPOINTMENTS) — full module styles
══════════════════════════════════════════════════════ */

.appt-section-header {
  display: flex; align-items: center; gap: .4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  margin: 1rem 0 .5rem; padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.appt-section-header svg { color: var(--brand); }

.appt-list { display: flex; flex-direction: column; gap: .5rem; }

.appt-card {
  display: flex; align-items: stretch; gap: .75rem;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: .75rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-hi);
  transition: transform var(--transition), box-shadow var(--transition);
}
.appt-card:active { transform: scale(.99); }
.appt-card.past { border-left-color: var(--border-2); opacity: .75; }

.appt-card-left { display: flex; align-items: flex-start; }
.appt-date-badge {
  display: flex; flex-direction: column; align-items: center;
  background: var(--brand-pale); border: 1px solid var(--brand-glow);
  border-radius: var(--radius-sm); padding: .3rem .5rem; min-width: 40px;
}
.appt-card.past .appt-date-badge { background: var(--surface-2); border-color: var(--border); }
.appt-date-day {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem; font-weight: 700; color: var(--brand);
  line-height: 1;
}
.appt-card.past .appt-date-day { color: var(--text-muted); }
.appt-date-mon {
  font-family: 'JetBrains Mono', monospace;
  font-size: .55rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: .04em; margin-top: 2px;
}

.appt-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.appt-card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.appt-client { font-weight: 600; font-size: .9rem; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-status { font-size: .65rem; font-family: 'JetBrains Mono', monospace; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
.appt-service { font-size: .8rem; color: var(--brand); font-weight: 500; }
.appt-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; font-size: .72rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.appt-notes { font-size: .75rem; color: var(--text-2); font-style: italic; border-left: 2px solid var(--border-2); padding-left: .5rem; margin-top: .15rem; }

.appt-card-actions { display: flex; flex-direction: column; gap: .3rem; justify-content: flex-start; }
.appt-act-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border); color: var(--text-muted);
  background: var(--surface); transition: all var(--transition);
  flex-shrink: 0;
}
.appt-act-btn:active { transform: scale(.9); }
.appt-act-btn.appt-wa    { border-color: rgba(37,211,102,.4); color: #25D366; }
.appt-act-btn.appt-wa:hover { background: rgba(37,211,102,.12); border-color: rgba(37,211,102,.7); }
.appt-act-btn.appt-check { border-color: rgba(0,200,150,.4); color: var(--success); }
.appt-act-btn.appt-check:hover { background: rgba(0,200,150,.12); border-color: var(--success); }
.appt-act-btn.appt-edit  { border-color: rgba(0,180,216,.3); color: var(--info); }
.appt-act-btn.appt-edit:hover { background: rgba(0,180,216,.1); }
.appt-act-btn.appt-x     { border-color: rgba(255,45,68,.3); color: var(--danger); }
.appt-act-btn.appt-x:hover { background: rgba(255,45,68,.1); }

/* ══ WA INVITATION MODAL ══ */
.wa-modal-wrap {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: flex-end;
}
.wa-overlay-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.65);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.wa-modal-sheet {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.5rem 1.25rem 2rem;
  box-shadow: 0 -8px 40px rgba(0,0,0,.6);
  max-height: 90dvh; overflow-y: auto;
}
.wa-close {
  position: absolute; top: .9rem; right: 1rem;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border-2);
  color: var(--text-muted); background: var(--surface-2);
  transition: all var(--transition);
}
.wa-close:hover { color: var(--text); border-color: var(--border); }

.wa-modal-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  text-align: center; margin-bottom: 1.1rem;
}

/* Preview card */
.wa-preview-card {
  background: linear-gradient(145deg, #0d1f1a 0%, #0a1612 100%);
  border: 1px solid rgba(37,211,102,.25);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 30px rgba(37,211,102,.08), inset 0 1px 0 rgba(255,255,255,.06);
  margin-bottom: 1rem;
}
.wa-preview-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border-bottom: 1px solid rgba(37,211,102,.15);
  background: linear-gradient(135deg, rgba(37,211,102,.1) 0%, transparent 60%);
}
.wa-biz-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(37,211,102,.4);
}
.wa-biz-name-txt { font-weight: 700; font-size: .95rem; color: #fff; }
.wa-preview-subtitle { font-size: .65rem; color: rgba(37,211,102,.7); font-family: 'JetBrains Mono', monospace; }
.wa-divider { height: 1px; background: rgba(37,211,102,.1); margin: 0; }

.wa-msg-body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.wa-greeting { font-size: .9rem; color: var(--text); }
.wa-greeting strong { color: #25D366; }
.wa-confirm-txt { font-size: .82rem; color: var(--text-2); margin-bottom: .25rem; }

.wa-detail-row {
  display: flex; align-items: flex-start; gap: .55rem;
  font-size: .85rem; color: var(--text);
}
.wa-detail-icon { color: #25D366; flex-shrink: 0; margin-top: 2px; }
.wa-time-txt { font-family: 'JetBrains Mono', monospace; }

.wa-tolerance-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3);
  border-radius: 40px; padding: .25rem .65rem;
  font-size: .7rem; font-weight: 600; color: var(--warning);
  font-family: 'JetBrains Mono', monospace;
  margin-top: .25rem; align-self: flex-start;
}
.wa-footer-note { font-size: .78rem; color: var(--text-muted); font-style: italic; margin-top: .35rem; }
.wa-signature { font-size: .78rem; color: rgba(37,211,102,.6); font-weight: 600; }

.wa-actions { display: flex; flex-direction: column; gap: .6rem; }
.btn-wa-send {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  background: #25D366; color: #fff;
  font-family: 'JetBrains Mono', monospace; font-size: .9rem; font-weight: 700;
  padding: .9rem 1.5rem; border-radius: var(--radius);
  text-decoration: none; text-align: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.4);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.btn-wa-send:hover { background: #20bb5a; color: #fff; box-shadow: 0 6px 28px rgba(37,211,102,.55); }
.btn-wa-send:active { transform: scale(.97); }
.btn-wa-cal {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border-2);
  font-family: 'JetBrains Mono', monospace; font-size: .82rem; font-weight: 600;
  padding: .75rem 1.5rem; border-radius: var(--radius);
  text-decoration: none; text-align: center;
  transition: all var(--transition);
}
.btn-wa-cal:hover { border-color: var(--info); color: var(--info); background: rgba(0,180,216,.06); }

/* ══ SALE DETAIL BOTTOM SHEET ══ */
.detail-sheet-wrap {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: flex-end;
}
.detail-sheet-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.detail-sheet {
  position: relative; z-index: 1;
  width: 100%; max-width: 520px; margin: 0 auto;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-top: 2px solid var(--brand);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.25rem 1.25rem 2.5rem;
  box-shadow: 0 -12px 50px rgba(0,0,0,.7);
  animation: sheetSlideUp .22s cubic-bezier(.25,.46,.45,.94);
}
@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.detail-sheet-handle {
  width: 36px; height: 4px; background: var(--border-2);
  border-radius: 2px; margin: 0 auto 1rem;
}
.detail-sheet-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border-2);
  color: var(--text-muted); background: var(--surface);
}
.detail-sheet-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem; font-weight: 700; color: var(--white);
  margin-bottom: 1rem; padding-right: 2rem;
}
.detail-rows { display: flex; flex-direction: column; gap: .5rem; }
.detail-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .75rem;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.detail-row-label { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.detail-row-val { color: var(--text); font-weight: 600; text-align: right; }
.detail-row-val.profit { color: var(--success); }
.detail-row-val.amount { color: var(--white); font-family: 'JetBrains Mono', monospace; font-size: .95rem; }
.detail-row-val.payment {
  background: var(--brand-pale); color: var(--brand);
  border-radius: 40px; padding: .15rem .6rem;
  font-size: .7rem; font-family: 'JetBrains Mono', monospace; font-weight: 700;
  letter-spacing: .04em;
}

/* Long-press indicator */
.item-row {
  position: relative;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}
.item-row::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--brand-pale); opacity: 0; pointer-events: none;
  transition: opacity .15s ease;
}
.item-row.pressing::after { opacity: 1; }
.item-row:active { transform: scale(.99); }

/* ══ CLIENT AUTOCOMPLETE DROPDOWN ══ */
.client-suggestions {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius); z-index: 200;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.client-suggestion {
  display: flex; flex-direction: column; align-items: flex-start;
  width: 100%; padding: .6rem .85rem; gap: .15rem;
  border-bottom: 1px solid var(--border);
  text-align: left; color: var(--text);
  transition: background var(--transition);
}
.client-suggestion:last-child { border-bottom: none; }
.client-suggestion:hover, .client-suggestion:focus { background: var(--brand-pale); outline: none; }
.cs-name { font-size: .88rem; font-weight: 600; }
.cs-meta { font-size: .7rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ══ SOLO PROVIDER LABEL ══ */
.provider-solo-label {
  display: block; margin-top: .4rem;
  font-size: .8rem; color: var(--brand);
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
}
/* Hide the select when in solo mode */
#f-appt-provider-wrap[data-solo="true"] select { display: none; }

/* ══ CONFLICT / AVAILABILITY indicator ══ */
.conflict-warn {
  display: flex; align-items: flex-start; gap: .55rem;
  background: rgba(255,45,68,.08); border: 1px solid rgba(255,45,68,.3);
  border-radius: var(--radius-sm); padding: .6rem .8rem;
  font-size: .78rem; color: var(--danger); line-height: 1.5;
}
.conflict-warn svg { flex-shrink:0; margin-top:2px; }
.conflict-warn strong { color: var(--white); }
.conflict-warn em { color: var(--text-2); font-style: normal; }
.conflict-free-row { margin-top: .35rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; font-size: .74rem; color: var(--text-2); }
.conflict-free-chip {
  background: rgba(0,200,150,.1); border: 1px solid rgba(0,200,150,.3);
  color: var(--success); border-radius: 40px; padding: .15rem .55rem;
  font-family: 'JetBrains Mono', monospace; font-size: .72rem; font-weight: 600;
}
.conflict-ok {
  display: flex; align-items: center; gap: .45rem;
  background: rgba(0,200,150,.06); border: 1px solid rgba(0,200,150,.25);
  border-radius: var(--radius-sm); padding: .5rem .8rem;
  font-size: .78rem; color: var(--success);
}
.conflict-ok svg { color: var(--success); }

/* Conflict badge on card */
.appt-card.conflict { border-left-color: var(--danger); }
.appt-conflict-badge {
  position: absolute; top: .45rem; left: 50%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .3rem;
  background: rgba(255,45,68,.1); border: 1px solid rgba(255,45,68,.4);
  border-radius: 40px; padding: .15rem .55rem;
  font-size: .62rem; font-weight: 700; color: var(--danger);
  font-family: 'JetBrains Mono', monospace; letter-spacing: .04em;
  white-space: nowrap; z-index: 1;
}
.appt-card { position: relative; }

/* Provider chip on card */
.appt-provider-chip {
  display: inline-flex; align-items: center;
  background: rgba(194,24,91,.07); border: 1px solid rgba(194,24,91,.2);
  border-radius: 40px; padding: .1rem .5rem;
  font-size: .65rem; font-weight: 600; color: var(--brand);
  font-family: 'JetBrains Mono', monospace;
  margin-top: .15rem;
}

/* ══ ANALYTICS ══ */
.analytics-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .5rem; margin-bottom: .75rem;
}
.analytics-kpi {
  display: flex; flex-direction: column; align-items: center;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: .65rem .5rem;
  text-align: center;
}
.kpi-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem; font-weight: 700; color: var(--brand);
}
.kpi-lbl {
  font-size: .6rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .06em; font-family: 'JetBrains Mono', monospace; margin-top: 2px;
}

.analytics-chart-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .6rem;
}
.analytics-chart-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem; font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .75rem;
}

/* Bar chart (hours / days) */
.ah-chart {
  display: flex; align-items: flex-end; gap: 2px;
  height: 60px; padding-bottom: 20px; position: relative;
}
.ah-col { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; height: 100%; }
.ah-bar-wrap { flex: 1; display: flex; align-items: flex-end; width: 100%; }
.ah-bar {
  width: 100%; border-radius: 2px 2px 0 0;
  background: var(--brand-pale); border: 1px solid rgba(194,24,91,.3);
  transition: height .3s ease;
  min-height: 3px;
}
.ah-bar.top { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 6px var(--brand-glow); }
.ah-lbl {
  font-size: .55rem; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 3px; white-space: nowrap;
}

/* Provider stats */
.prov-stats-list { display: flex; flex-direction: column; gap: .65rem; }
.prov-stat-card {
  display: flex; align-items: center; gap: .65rem;
}
.prov-stat-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-pale); border: 1px solid var(--brand-glow);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: .85rem; color: var(--brand);
}
.prov-stat-body { flex: 1; min-width: 0; }
.prov-stat-name { display: block; font-size: .82rem; font-weight: 600; color: var(--text); }
.prov-stat-meta { display: block; font-size: .68rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-bottom: .3rem; }
.prov-stat-bar-bg {
  height: 4px; background: var(--border-2); border-radius: 2px; overflow: hidden; margin-bottom: .2rem;
}
.prov-stat-bar-fill { height: 100%; background: var(--brand); border-radius: 2px; transition: width .4s ease; }
.prov-stat-pct { font-size: .62rem; color: var(--brand); font-family: 'JetBrains Mono', monospace; font-weight: 600; }

/* ══════════════════════════════════════════════════════
   LIQUID GLASS UI — SmartSell Premium (iOS 26 inspired)
   Frosted glass, depth, motion, tactile feel
══════════════════════════════════════════════════════ */

/* ── Liquid Glass tokens ── */
:root {
  --glass-bg-premium:      rgba(255,255,255,.045);
  --glass-bg-hover:        rgba(255,255,255,.075);
  --glass-bg-pressed:      rgba(255,255,255,.10);
  --glass-border-premium:  rgba(255,255,255,.10);
  --glass-border-bright:   rgba(255,255,255,.18);
  --glass-blur-premium:    blur(28px) saturate(1.6);
  --glass-shadow-card:     0 2px 24px rgba(0,0,0,.35), 0 1px 4px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.06);
  --glass-shadow-hover:    0 8px 40px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.10);
  --glass-shadow-brand:    0 4px 24px var(--brand-glow), 0 1px 4px rgba(0,0,0,.3);
  --liquid-radius:         18px;
  --liquid-radius-sm:      12px;
  --liquid-radius-lg:      24px;
  --spring: cubic-bezier(.34,1.56,.64,1);
  --ease-out-expo: cubic-bezier(.16,1,.3,1);
}

/* ── Upgrade stat cards to Liquid Glass ── */
.stat-card {
  position: relative; overflow: hidden;
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius) !important;
  box-shadow: var(--glass-shadow-card);
  transition: transform .22s var(--spring), box-shadow .22s ease, border-color .2s ease;
  cursor: default;
  -webkit-user-select: none; user-select: none;
}
/* Specular highlight top edge */
.stat-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 50%);
  border-radius: inherit; pointer-events: none;
}
/* Bottom glow based on data-color */
.stat-card[data-color="rose"]::after   { background: radial-gradient(ellipse at 50% 120%, rgba(194,24,91,.3) 0%, transparent 70%); }
.stat-card[data-color="green"]::after  { background: radial-gradient(ellipse at 50% 120%, rgba(0,200,100,.25) 0%, transparent 70%); }
.stat-card[data-color="orange"]::after { background: radial-gradient(ellipse at 50% 120%, rgba(255,100,0,.25) 0%, transparent 70%); }
.stat-card[data-color="blue"]::after   { background: radial-gradient(ellipse at 50% 120%, rgba(37,99,235,.25) 0%, transparent 70%); }
.stat-card::after {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
}
.stat-card:active { transform: scale(.97); box-shadow: var(--glass-shadow-brand); }

/* ── Upgrade chart cards ── */
.chart-card {
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius) !important;
  box-shadow: var(--glass-shadow-card);
  overflow: hidden; position: relative;
  transition: box-shadow .2s ease;
}
.chart-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  pointer-events: none;
}

/* ── Upgrade section cards ── */
.section-card {
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius) !important;
  box-shadow: var(--glass-shadow-card);
  position: relative; overflow: hidden;
}
.section-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  pointer-events: none;
}

/* ── Upgrade form cards ── */
.form-card:not(.collapsed) {
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid var(--glass-border-bright) !important;
  border-radius: var(--liquid-radius) !important;
  box-shadow: var(--glass-shadow-brand);
  animation: glassSlideDown .35s var(--ease-out-expo);
}
@keyframes glassSlideDown {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Premium buttons ── */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-bright) 0%, var(--brand) 100%) !important;
  box-shadow: 0 4px 16px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.15) !important;
  border: none !important;
  border-radius: var(--liquid-radius-sm) !important;
  transition: transform .18s var(--spring), box-shadow .18s ease !important;
}
.btn-primary:active { transform: scale(.96) !important; }
.btn-primary:hover  { box-shadow: 0 6px 24px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.2) !important; }

.btn-ghost {
  background: rgba(255,255,255,.06) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius-sm) !important;
  transition: background .15s ease, transform .15s ease !important;
}
.btn-ghost:active { transform: scale(.96) !important; background: rgba(255,255,255,.10) !important; }

.btn-fab-header {
  border-radius: var(--liquid-radius-sm) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform .2s var(--spring), box-shadow .2s ease !important;
}
.btn-fab-header:active { transform: scale(.93) !important; }

/* ── Bar chart upgrades ── */
.bar-fill {
  border-radius: 6px 6px 0 0 !important;
  background: linear-gradient(180deg,
    var(--brand-bright) 0%,
    var(--brand) 60%,
    var(--brand-dim) 100%) !important;
  box-shadow: 0 -2px 8px var(--brand-glow);
  animation: barGrow .5s var(--ease-out-expo) !important;
}
.bar-col.bar-clickable { cursor: pointer; }
.bar-col.bar-clickable:hover .bar-fill {
  filter: brightness(1.25);
  box-shadow: 0 -4px 14px var(--brand-glow);
}
.bar-col.bar-active .bar-fill {
  transform: scaleY(1.06); transform-origin: bottom;
  transition: transform .15s var(--spring);
}
.bar-tap-hint {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  font-size: .55rem; color: var(--brand); font-family: 'JetBrains Mono', monospace;
  opacity: 0; transition: opacity .15s ease; pointer-events: none;
  background: var(--glass-bg-premium); border-radius: 4px; padding: 1px 4px;
}
.bar-col.bar-clickable:hover .bar-tap-hint { opacity: 1; }
.bar-track { position: relative; }
.chart-hint {
  font-size: .68rem; color: var(--text-muted); text-align: center;
  margin-top: .4rem; font-family: 'JetBrains Mono', monospace;
  animation: fadeIn .4s ease .3s both;
}

/* ── Donut upgrade — glow via pseudo-element, NO CSS filter ── */
.donut-svg-wrap::after {
  box-shadow: 0 0 28px var(--brand-glow) !important;
}
.donut-seg {
  transition: stroke-width .22s var(--spring), opacity .18s ease !important;
}
.donut-seg.active { stroke-width: 18 !important; }
.donut:hover .donut-seg:not(.active) { opacity: .3; }

/* ══ BAR DETAIL PANEL ══ */
.bar-detail-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: flex-end;
  opacity: 0; transition: opacity .3s ease;
}
.bar-detail-overlay.open { opacity: 1; }
.bar-detail-overlay.hidden { display: none !important; }

.bar-detail-sheet {
  width: 100%; max-height: 75dvh;
  background: linear-gradient(160deg, rgba(30,14,30,.92) 0%, rgba(10,10,20,.96) 100%);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid var(--glass-border-bright);
  border-bottom: none;
  border-radius: var(--liquid-radius-lg) var(--liquid-radius-lg) 0 0;
  box-shadow: 0 -8px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12);
  padding: 0 1.25rem 2rem;
  transform: translateY(100%);
  transition: transform .35s var(--ease-out-expo);
  display: flex; flex-direction: column; overflow: hidden;
}
.bar-detail-overlay.open .bar-detail-sheet { transform: translateY(0); }

.bar-detail-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.2); margin: .75rem auto .5rem;
  flex-shrink: 0;
}
.bar-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: .5rem 0 1rem; flex-shrink: 0;
  border-bottom: 1px solid var(--glass-border-premium);
  margin-bottom: .75rem;
}
.bar-detail-period {
  font-family: 'JetBrains Mono', monospace; font-size: .72rem;
  font-weight: 700; color: var(--brand); text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: .4rem;
}
.bar-detail-kpis { display: flex; gap: 1.25rem; }
.bd-kpi { display: flex; flex-direction: column; align-items: flex-start; }
.bd-kpi-val {
  font-size: 1rem; font-weight: 700; color: var(--white);
  font-family: 'JetBrains Mono', monospace;
}
.bd-kpi-lbl { font-size: .62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

.bar-detail-close {
  background: rgba(255,255,255,.08); border: 1px solid var(--glass-border-premium);
  border-radius: 50%; width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.bar-detail-close:hover { background: rgba(255,255,255,.14); color: var(--white); }

.bar-detail-list {
  overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
.bd-sale-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 0; border-bottom: 1px solid var(--border);
  animation: fadeIn .2s ease;
}
.bd-sale-row:last-child { border-bottom: none; }
.bd-sale-product { font-size: .88rem; font-weight: 600; color: var(--white); }
.bd-sale-meta    { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.bd-sale-amount  {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: .9rem; color: var(--brand); flex-shrink: 0; padding-left: .75rem;
}

/* ══ LONG-PRESS CONTEXT MENU ══ */
.ctx-menu-overlay {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s ease;
}
.ctx-menu-overlay.open { opacity: 1; }
.ctx-menu-overlay.hidden { display: none !important; }

.ctx-menu {
  background: linear-gradient(160deg, rgba(30,20,40,.95) 0%, rgba(12,10,18,.98) 100%);
  -webkit-backdrop-filter: blur(40px) saturate(2);
  backdrop-filter: blur(40px) saturate(2);
  border: 1px solid var(--glass-border-bright);
  border-radius: var(--liquid-radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.10);
  min-width: 240px; max-width: 320px;
  overflow: hidden;
  transform: scale(.88); opacity: 0;
  transition: transform .28s var(--spring), opacity .2s ease;
}
.ctx-menu-overlay.open .ctx-menu { transform: scale(1); opacity: 1; }

.ctx-menu-title {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  padding: .9rem 1rem .5rem;
}
.ctx-menu-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; cursor: pointer; width: 100%;
  background: none; border: none; color: var(--text); text-align: left;
  font-size: .9rem; transition: background .12s ease;
  border-top: 1px solid var(--border);
}
.ctx-menu-item:first-of-type { border-top: none; }
.ctx-menu-item:hover, .ctx-menu-item:active { background: rgba(255,255,255,.06); }
.ctx-menu-item svg { flex-shrink: 0; color: var(--brand); }
.ctx-menu-item.danger { color: var(--danger); }
.ctx-menu-item.danger svg { color: var(--danger); }
.ctx-menu-item.ctx-cancel {
  color: var(--text-muted); justify-content: center;
  background: rgba(255,255,255,.03) !important;
  font-size: .82rem;
}

/* Haptic press feedback on long-pressable elements */
.long-pressable {
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}
.long-pressable.pressing {
  animation: pressScale .6s var(--ease-out-expo) forwards;
}
@keyframes pressScale {
  0%   { transform: scale(1); }
  60%  { transform: scale(.97); box-shadow: var(--glass-shadow-brand); }
  100% { transform: scale(.97); }
}

/* ── Nav bottom glow ── */
.nav-item.active {
  position: relative;
}
.nav-item.active::after {
  content: ''; position: absolute;
  bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2px; border-radius: 1px;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand-glow);
}

/* ── Inputs premium ── */
.inp {
  background: rgba(255,255,255,.04) !important;
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius-sm) !important;
  transition: border-color .15s ease, box-shadow .15s ease !important;
}
.inp:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px var(--brand-glow) !important;
  outline: none !important;
  background: rgba(255,255,255,.06) !important;
}

/* ── Sub-tab pills liquid style ── */
.sub-tab {
  border-radius: var(--liquid-radius-sm) !important;
  transition: background .18s ease, color .18s ease, transform .15s var(--spring) !important;
}
.sub-tab.active {
  background: var(--brand) !important;
  box-shadow: 0 2px 12px var(--brand-glow) !important;
  transform: scale(1.03) !important;
}

/* ── Toast premium ── */
.toast {
  border-radius: var(--liquid-radius-sm) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.4) !important;
}

/* ── Appointment card glass upgrade ── */
.appt-card {
  -webkit-backdrop-filter: var(--glass-blur-premium) !important;
  backdrop-filter: var(--glass-blur-premium) !important;
  border-radius: var(--liquid-radius) !important;
  box-shadow: var(--glass-shadow-card) !important;
  transition: transform .2s var(--spring), box-shadow .2s ease !important;
}
.appt-card:active { transform: scale(.985) !important; }

/* ── Item rows hover ── */
.item-row {
  border-radius: var(--liquid-radius-sm);
  transition: background .12s ease;
  margin: 0 -.5rem; padding-left: .5rem !important; padding-right: .5rem !important;
}
.item-row:hover { background: rgba(255,255,255,.04); }

/* ── Scrollbar global premium ── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-dim); }

/* ══════════════════════════════════════════════════════
   LIQUID GLASS — ALL TABS (ventas, inventario, finanzas, IA, config)
   Coherencia visual total sin importar el sistema operativo
══════════════════════════════════════════════════════ */

/* ── Period nav (< Mayo 2026 >) ── */
.period-nav {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid var(--glass-border-premium);
  border-radius: var(--liquid-radius);
  padding: .35rem .5rem;
  box-shadow: var(--glass-shadow-card);
  margin-bottom: .75rem;
}
.period-arrow {
  background: rgba(255,255,255,.06) !important;
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius-sm) !important;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, transform .15s var(--spring) !important;
  flex-shrink: 0;
}
.period-arrow:hover  { background: rgba(255,255,255,.12) !important; }
.period-arrow:active { transform: scale(.9) !important; }
.period-arrow:disabled { opacity: .3; pointer-events: none; }
.period-label {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: .85rem; color: var(--white); flex: 1; text-align: center;
  letter-spacing: .04em;
}
.select-sm {
  background: rgba(255,255,255,.06) !important;
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius-sm) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text) !important;
  transition: border-color .15s ease, box-shadow .15s ease !important;
  padding: .3rem .6rem !important;
}
.select-sm:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px var(--brand-glow) !important;
  outline: none !important;
}

/* ── AI Insight card ── */
.insight-card {
  background: linear-gradient(135deg, rgba(194,24,91,.12) 0%, var(--glass-bg-premium) 60%) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid rgba(194,24,91,.25) !important;
  border-radius: var(--liquid-radius) !important;
  box-shadow: 0 4px 32px rgba(194,24,91,.10), var(--glass-shadow-card) !important;
  position: relative; overflow: hidden;
}
.insight-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(194,24,91,.4), transparent);
  pointer-events: none;
}

/* ── Finance cards (fin-card) ── */
.fin-card {
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius) !important;
  box-shadow: var(--glass-shadow-card) !important;
  overflow: hidden; position: relative;
}
.fin-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
  pointer-events: none;
}

/* ── Product cards (inventario) ── */
.product-card {
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius) !important;
  box-shadow: var(--glass-shadow-card) !important;
  transition: transform .2s var(--spring), box-shadow .2s ease, border-color .2s ease !important;
  position: relative; overflow: hidden;
}
.product-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
  pointer-events: none;
}
.product-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--glass-shadow-hover) !important;
  border-color: var(--glass-border-bright) !important;
}
.product-card:active { transform: scale(.98) !important; }

/* ── Config sections ── */
.config-section {
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius) !important;
  box-shadow: var(--glass-shadow-card) !important;
  overflow: hidden;
}
.config-section h3 {
  border-radius: var(--liquid-radius) var(--liquid-radius) 0 0;
  transition: background .15s ease;
}
.config-section h3:hover { background: rgba(255,255,255,.04); }

/* ── Sale rows / item rows — premium list items ── */
.item-row {
  background: rgba(255,255,255,.025) !important;
  border: 1px solid transparent;
  border-radius: var(--liquid-radius-sm) !important;
  margin: 0 -.25rem .25rem !important;
  padding: .65rem .75rem !important;
  transition: background .15s ease, border-color .15s ease, transform .15s var(--spring) !important;
}
.item-row:hover {
  background: rgba(255,255,255,.06) !important;
  border-color: var(--glass-border-premium) !important;
  transform: translateX(2px) !important;
}
.item-row:active { transform: scale(.98) !important; }

/* ── Sale list rows (in ventas tab) ── */
.sale-row, [class*="sale-item"] {
  background: rgba(255,255,255,.025);
  border: 1px solid transparent;
  border-radius: var(--liquid-radius-sm);
  padding: .65rem .75rem;
  transition: background .15s ease, border-color .15s ease;
}
.sale-row:hover { background: rgba(255,255,255,.06); border-color: var(--glass-border-premium); }

/* ── Bottom navigation bar ── */
.bottom-nav {
  background: rgba(8,4,16,.85) !important;
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  backdrop-filter: blur(40px) saturate(1.8);
  border-top: 1px solid var(--glass-border-premium) !important;
  box-shadow: 0 -4px 30px rgba(0,0,0,.3) !important;
}

/* ── Header bar ── */
.app-header {
  background: rgba(8,4,16,.8) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  backdrop-filter: blur(30px) saturate(1.6);
  border-bottom: 1px solid var(--glass-border-premium) !important;
  box-shadow: 0 2px 20px rgba(0,0,0,.25) !important;
}

/* ── Panel headers (h2 in tabs) ── */
.panel-header h2 {
  background: linear-gradient(135deg, var(--white) 0%, rgba(255,255,255,.7) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Secondary buttons ── */
.btn-secondary {
  background: rgba(255,255,255,.06) !important;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius-sm) !important;
  transition: background .15s ease, transform .15s var(--spring) !important;
}
.btn-secondary:hover  { background: rgba(255,255,255,.10) !important; }
.btn-secondary:active { transform: scale(.96) !important; }

/* ── Input shake animation (error feedback) ── */
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.inp-error-shake {
  animation: inputShake .4s ease;
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(255,45,68,.25) !important;
}

/* ── Analytics mini cards (inside citas) ── */
.analytics-chart-card {
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius) !important;
  box-shadow: var(--glass-shadow-card) !important;
}
.analytics-kpi {
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius-sm) !important;
  padding: .75rem !important;
}

/* ── Provider stat cards ── */
.prov-stat-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--glass-border-premium);
  border-radius: var(--liquid-radius-sm);
  padding: .75rem;
  transition: background .15s ease;
}
.prov-stat-card:hover { background: rgba(255,255,255,.06); }

/* ── Appt form fields — phone now optional visual ── */
#f-appt-phone::placeholder { opacity: .5; font-style: italic; }
label[for="f-appt-phone"]::after { content: ' (opcional)'; font-size:.7em; color: var(--text-muted); font-weight:400; }

/* ── Workspace pill ── */
.ws-pill {
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-color: var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius-sm) !important;
  transition: border-color .15s ease, background .15s ease !important;
}
.ws-pill:hover {
  background: var(--glass-bg-hover) !important;
  border-color: var(--brand) !important;
}

/* ── Paywall screen glass ── */
.plan-card {
  background: var(--glass-bg-premium) !important;
  -webkit-backdrop-filter: var(--glass-blur-premium);
  backdrop-filter: var(--glass-blur-premium);
  border: 1px solid var(--glass-border-premium) !important;
  border-radius: var(--liquid-radius-lg) !important;
  box-shadow: var(--glass-shadow-card) !important;
}

/* ── Sales form card open animation ── */
#sale-form:not(.collapsed),
#product-form:not(.collapsed),
#finance-form:not(.collapsed) {
  animation: glassSlideDown .3s var(--ease-out-expo);
}

/* ── Floating sale button premium ── */
.fab {
  background: linear-gradient(135deg, var(--brand-bright), var(--brand)) !important;
  box-shadow: 0 6px 24px var(--brand-glow), 0 2px 8px rgba(0,0,0,.3) !important;
  border-radius: 50% !important;
  transition: transform .2s var(--spring), box-shadow .2s ease !important;
}
.fab:hover  { transform: scale(1.08) translateY(-2px) !important; }
.fab:active { transform: scale(.95) !important; }
