/* ============================================================
   BizMaster — Design System v5 · Mobile-First
   ============================================================ */
:root {
  --color-primary:    #1A4FDB;
  --color-primary-700:#1240B8;
  --color-primary-900:#0D1B4B;
  --color-primary-50: #EEF2FF;
  --color-ink:        #0D1B4B;
  --color-amber:      #F59E0B;
  --color-teal:       #10B981;
  --color-rose:       #EF4444;
  --color-pink:       #EC4899;
  --color-indigo:     #6366F1;
  --color-violet:     #8B5CF6;
  --color-cyan:       #06B6D4;
  --color-lime:       #84CC16;
  --color-orange:     #F97316;
  --gradient-brand:   linear-gradient(160deg,#0D1B4B 0%,#1A3A8F 50%,#1A4FDB 100%);
  --gradient-teal:    linear-gradient(135deg,#10B981,#059669);
  --gradient-amber:   linear-gradient(135deg,#F59E0B,#D97706);
  --gradient-rose:    linear-gradient(135deg,#EF4444,#B91C1C);
  --gradient-violet:  linear-gradient(135deg,#8B5CF6,#6366F1);
  --color-bg:         #F4F7FF;
  --color-card:       #FFFFFF;
  --color-surface:    #FFFFFF;
  --color-border:     #E2E8F0;
  --color-text:       #1A1A2E;
  --color-text-muted: #64748B;
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-pill:999px;
  --shadow-card: 0 1px 3px rgba(13,27,75,.05),0 4px 16px rgba(13,27,75,.07);
  --shadow-elevated:0 20px 50px rgba(13,27,75,.18);
  --font-body:  "Inter","Segoe UI",sans-serif;
  --font-mono:  "JetBrains Mono",monospace;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
[data-theme="dark"] {
  --color-bg:       #0D1B4B;
  --color-card:     #14235E;
  --color-surface:  #14235E;
  --color-border:   #24357A;
  --color-text:     #EAEFFC;
  --color-text-muted:#9AA9D6;
  --color-primary-50:#1B2C6E;
  --color-primary-700:#8FA8FF;
  --color-ink:      #F4F7FF;
  --color-amber:    #FBBF24;
  --color-teal:     #34D399;
  --color-rose:     #FB7185;
  --color-pink:     #F472B6;
  --gradient-brand: linear-gradient(160deg,#101E52 0%,#1A3A8F 55%,#3B6BF0 100%);
  --shadow-card:0 1px 3px rgba(0,0,0,.3),0 4px 16px rgba(0,0,0,.35);
  --shadow-elevated:0 20px 50px rgba(0,0,0,.45);
}
[data-theme="dark"] .sidebar { background:#0A1628; }
[data-theme="dark"] .field input,[data-theme="dark"] .field select,[data-theme="dark"] .field textarea { background:#1A2E5A; color:var(--color-text); border-color:var(--color-border); }
[data-theme="dark"] .field input::placeholder,[data-theme="dark"] .field textarea::placeholder { color:#6B7BB0; }
/* Más colores en modo oscuro: los mismos iconos/badges que en modo claro,
   pero con tonos oscuros propios en vez de heredar los colores clarosque
   quedaban ilegibles sobre fondo oscuro. */
[data-theme="dark"] .icon-badge.blue   { background:#1B2C6E; color:#93B1FF; }
[data-theme="dark"] .icon-badge.amber  { background:#3A2E0F; color:#FBBF24; }
[data-theme="dark"] .icon-badge.teal   { background:#0F3A34; color:#34D399; }
[data-theme="dark"] .icon-badge.rose   { background:#3A1520; color:#FB7185; }
[data-theme="dark"] .badge-green { background:#0F3A2A; color:#34D399; }
[data-theme="dark"] .badge-red   { background:#3A1520; color:#FCA5A5; }
[data-theme="dark"] .badge-yellow{ background:#3A2E0F; color:#FBBF24; }
[data-theme="dark"] .badge-blue  { background:#1B2C6E; color:#93B1FF; }
[data-theme="dark"] .quick-link:hover { box-shadow:0 4px 14px rgba(0,0,0,.4); }
[data-theme="dark"] ::selection { background:#3B6BF0; color:#fff; }
*   { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html{ scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body{ margin:0; font-family:var(--font-body); background:var(--color-bg); color:var(--color-text); -webkit-font-smoothing:antialiased; overscroll-behavior:none; }
h1,h2,h3,h4{ font-family:var(--font-body); color:var(--color-ink); margin:0 0 10px; letter-spacing:-.02em; line-height:1.15; }
[data-theme="dark"] h1,[data-theme="dark"] h2,[data-theme="dark"] h3,[data-theme="dark"] h4 { color:var(--color-text); }
p { line-height:1.6; } a { color:inherit; text-decoration:none; } img { max-width:100%; }
button{ font-family:var(--font-body); cursor:pointer; border:none; }
input,select,textarea{ font-family:var(--font-body); font-size:16px; }
.mono{ font-family:var(--font-mono); }
.container{ max-width:1100px; margin:0 auto; padding:0 20px; }
.app-shell{ display:grid; grid-template-columns:248px 1fr; min-height:100vh; min-height:100dvh; }
.sidebar{ background:var(--color-ink); color:#fff; padding:20px 12px; display:flex; flex-direction:column; position:sticky; top:0; height:100vh; overflow-y:auto; scrollbar-width:none; }
.sidebar::-webkit-scrollbar{ display:none; }
.sidebar .brand{ display:flex; align-items:center; gap:10px; padding:4px 8px 22px; font-weight:800; font-size:16px; }
.sidebar .brand .mark{ width:30px; height:30px; border-radius:9px; background:var(--color-primary); display:flex; align-items:center; justify-content:center; font-size:15px; }
.sidebar nav{ flex:1; }
.sidebar nav a{ display:flex; align-items:center; gap:11px; padding:10px 10px; border-radius:var(--radius-sm); color:rgba(255,255,255,.6); font-size:13.5px; font-weight:600; margin-bottom:2px; transition:background .15s,color .15s; white-space:nowrap; }
.sidebar nav a svg{ width:17px; height:17px; flex-shrink:0; }
.sidebar nav a.active{ background:var(--gradient-brand); color:#fff; }
.sidebar nav a:hover:not(.active){ background:rgba(255,255,255,.08); color:#fff; }
.sidebar .sidebar-footer{ border-top:1px solid rgba(255,255,255,.1); padding-top:12px; font-size:11px; color:rgba(255,255,255,.4); }
.main-content{ padding:24px 28px 60px; overflow-x:hidden; }
.topbar{ display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; gap:16px; flex-wrap:wrap; }
.topbar .biz-name{ font-size:20px; }
.topbar .user-email{ color:var(--color-text-muted); font-size:12px; font-family:var(--font-mono); }
.section-title{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:14px; }
.section-title h3{ font-size:17px; }
.card{ background:var(--color-card); border-radius:var(--radius-md); box-shadow:var(--shadow-card); border:1px solid var(--color-border); }
.stat-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-bottom:24px; }
.stat-card{ padding:18px; position:relative; overflow:hidden; }
.icon-badge{ width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.icon-badge svg{ width:18px; height:18px; }
.stat-card .icon-badge{ margin-bottom:12px; }
.icon-badge.blue   { background:var(--color-primary-50); color:var(--color-primary-700); }
.icon-badge.amber  { background:#FEF3E2; color:#B5740B; }
.icon-badge.teal   { background:#E3FBF7; color:#0E8C7E; }
.icon-badge.rose   { background:#FDE9ED; color:#C23857; }
.icon-badge.gradient{ background:var(--gradient-brand); color:#fff; }
.stat-card .label{ font-size:12.5px; color:var(--color-text-muted); font-weight:600; margin-bottom:3px; }
.stat-card .value{ font-family:var(--font-mono); font-size:24px; font-weight:700; color:var(--color-ink); }
.row-card{ display:flex; justify-content:space-between; align-items:center; padding:14px 18px; margin-bottom:8px; }
.row-card strong{ font-size:14px; }
.row-card .meta{ font-size:12px; color:var(--color-text-muted); margin-top:2px; }
.form-card{ padding:20px; margin-bottom:16px; }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:12px 20px; border-radius:var(--radius-sm); font-weight:700; font-size:14px; transition:transform .15s,opacity .15s,filter .15s; min-height:44px; cursor:pointer; }
.btn-primary{ background:var(--gradient-brand); color:#fff; box-shadow:0 4px 14px rgba(26,79,219,.3); }
.btn-primary:hover{ filter:brightness(1.07); }
.btn-secondary{ background:var(--color-primary-50); color:var(--color-primary-700); }
.btn-outline{ background:transparent; border:1.5px solid var(--color-border); color:var(--color-text); }
.btn-outline:hover{ border-color:var(--color-primary); color:var(--color-primary); }
.btn-block{ width:100%; }
.btn:active{ transform:scale(.97); }
.btn svg{ width:17px; height:17px; }
.field{ margin-bottom:16px; text-align:left; }
.field label{ display:block; font-size:12.5px; font-weight:700; color:var(--color-text-muted); margin-bottom:6px; }
.field input,.field select,.field textarea{ width:100%; padding:13px 14px; border:1.5px solid var(--color-border); border-radius:var(--radius-sm); background:#FBFCFE; outline:none; transition:border-color .15s; font-size:16px; color:var(--color-text); }
.field input:focus,.field select:focus,.field textarea:focus{ border-color:var(--color-primary); background:#fff; }
/* Ojo de mostrar/ocultar contraseña (js/password-toggle.js) — el JS ya
   armaba este botón hace tiempo, pero le faltaba el CSS por completo:
   el botón salía sin posición ni estilo, y los dos íconos (ojo abierto/
   cerrado) se mostraban los dos a la vez en vez de alternar. */
.field-password-wrap{ position:relative; }
.field-password-wrap input{ padding-right:44px; }
.password-toggle-btn{
  position:absolute; top:50%; right:6px; transform:translateY(-50%);
  width:34px; height:34px; border:none; background:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; border-radius:8px;
  color:var(--color-text-muted); padding:0;
}
.password-toggle-btn:hover{ background:var(--color-bg); color:var(--color-text); }
.password-toggle-btn svg{ width:19px; height:19px; }
.password-toggle-btn .icon-eye-off{ display:none; }
.password-toggle-btn.is-visible .icon-eye{ display:none; }
.password-toggle-btn.is-visible .icon-eye-off{ display:block; }
.auth-shell{ min-height:100dvh; display:grid; grid-template-columns:1fr 1fr; }
.auth-brand-panel{ background:radial-gradient(circle at 15% 20%,rgba(255,255,255,.14),transparent 40%),radial-gradient(circle at 85% 80%,rgba(255,255,255,.12),transparent 45%),var(--gradient-brand); color:#fff; display:flex; flex-direction:column; justify-content:space-between; padding:48px; overflow:hidden; }
.auth-brand-panel .logo-mark{ display:flex; align-items:center; gap:10px; font-weight:800; font-size:19px; }
.auth-brand-panel .pitch h2{ color:#fff; font-size:30px; max-width:360px; }
.auth-form-panel{ display:flex; align-items:center; justify-content:center; padding:24px; }
.auth-form-inner{ width:100%; max-width:380px; }
.auth-form-inner .mobile-logo{ display:none; }
.auth-switch{ margin-top:20px; font-size:13.5px; color:var(--color-text-muted); text-align:center; }
.divider{ display:flex; align-items:center; gap:10px; margin:20px 0; color:var(--color-text-muted); font-size:13px; }
.divider::before,.divider::after{ content:""; flex:1; height:1px; background:var(--color-border); }
/* El menú SIEMPRE vive a la izquierda (nunca abajo). En pantallas
   angostas, el .sidebar se convierte en una gaveta ("drawer") que se
   abre con el botón ☰ (arriba a la izquierda) en vez de mostrar una
   barra de pestañas abajo — así el menú nunca desaparece ni tapa otros
   botones flotantes (calculadora, ayuda). */
.mobile-tabbar, .tabbar-more-sheet, .tabbar-more-btn{ display:none !important; }
.sidebar-overlay{ display:none; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:295; }
.sidebar-overlay.open{ display:block; }
.mobile-topbar{ display:none; }
.theme-toggle-btn{ display:flex; align-items:center; gap:7px; width:100%; padding:8px 10px; margin-bottom:10px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14); border-radius:10px; color:rgba(255,255,255,.75); font-size:12px; font-weight:700; cursor:pointer; transition:background .15s,color .15s; }
.theme-toggle-btn:hover{ background:rgba(255,255,255,.14); color:#fff; }
.theme-toggle-btn svg{ width:14px; height:14px; flex-shrink:0; }
.quick-link{ display:flex; align-items:center; gap:12px; padding:14px 16px; background:var(--color-card); border-radius:12px; text-decoration:none; color:var(--color-text); border:1.5px solid var(--color-border); transition:border-color .15s,box-shadow .15s; }
.quick-link:hover{ border-color:var(--color-primary); box-shadow:0 4px 12px rgba(26,79,219,.1); }
.quick-link .ql-icon{ width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.meta{ font-size:12px; color:var(--color-text-muted); margin-top:2px; }
.badge{ display:inline-block; font-size:11px; font-weight:700; padding:2px 8px; border-radius:var(--radius-pill); }
.badge-green { background:#D1FAE5; color:#065F46; }
.badge-red   { background:#FEE2E2; color:#991B1B; }
.badge-yellow{ background:#FEF3C7; color:#92400E; }
.badge-blue  { background:var(--color-primary-50); color:var(--color-primary-700); }
.table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
@media(max-width:900px){
  .app-shell{ grid-template-columns:1fr; }
  .sidebar{
    position:fixed; top:0; left:0; height:100dvh; width:250px; max-width:82vw;
    z-index:300; transform:translateX(-101%); transition:transform .25s ease;
    box-shadow:0 0 40px rgba(0,0,0,.35); display:flex;
    /* Un solo color sólido (el azul de la marca) en vez del navy oscuro
       que usa el sidebar en escritorio — se siente más a app nativa
       tipo Google Pay/Wallet que a "panel oscuro de admin". */
    background:var(--color-primary);
  }
  .sidebar.mobile-open{ transform:translateX(0); }
  .sidebar nav a{ font-size:16px; padding:14px 12px; gap:13px; }
  .sidebar nav a svg{ width:21px; height:21px; }
  .sidebar nav a.active{ background:rgba(255,255,255,.20); }
  .sidebar nav a:hover:not(.active){ background:rgba(255,255,255,.12); }
  .sidebar .brand{ font-size:18px; }
  .mobile-topbar{
    display:flex; align-items:center; gap:10px; position:fixed; top:0; left:0; right:0;
    height:calc(58px + var(--safe-top)); padding:var(--safe-top) 14px 0;
    background:var(--color-primary); color:#fff; z-index:210; font-weight:800; font-size:17px;
    box-shadow:0 1px 0 rgba(255,255,255,.08),0 4px 14px rgba(0,0,0,.15);
  }
  .mobile-topbar .mobile-menu-btn{
    width:40px; height:40px; border-radius:10px; background:rgba(255,255,255,.16);
    border:none; color:#fff; display:flex; align-items:center; justify-content:center;
    flex-shrink:0; cursor:pointer; padding:0;
  }
  .mobile-topbar .mobile-menu-btn svg{ width:21px; height:21px; }
  .main-content{ padding:calc(72px + var(--safe-top)) 14px 40px; font-size:15.5px; }

  /* ---- Texto general más grande en todo el contenido, para que a
     nadie le cueste leer, sin importar en qué pantalla esté ---- */
  body{ font-size:15.5px; }
  h1{ font-size:24px; } h2{ font-size:21px; } h3{ font-size:19px; } h4{ font-size:17px; }
  p, span, label, li, td, th{ font-size:15px; }
  .meta, .row-card .meta{ font-size:13.5px; }
  .section-title h3{ font-size:18px; }

  .topbar{ margin-bottom:16px; }
  .topbar .biz-name{ font-size:21px; }
  .stat-grid{ grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px; }
  .stat-card{ padding:16px; }
  .stat-card .label{ font-size:14px; }
  .stat-card .value{ font-size:26px; }
  .row-card{ padding:16px; }
  .row-card strong{ font-size:16.5px; }
  .card strong{ font-size:16px; }
  .badge, .icon-badge{ font-size:13px; }
  .btn{ font-size:16px; padding:14px 20px; }
  .btn-sm{ font-size:14.5px; }
  .field label{ font-size:14.5px; }
  .field input,.field select,.field textarea{ font-size:16px; padding:14px; }
  input, select, textarea, button{ font-size:16px; }
}
@media(max-width:800px){
  .auth-shell{ grid-template-columns:1fr; }
  .auth-brand-panel{ display:none; }
  .auth-form-inner .mobile-logo{ display:flex; align-items:center; justify-content:center; width:52px; height:52px; border-radius:14px; background:var(--color-primary); color:#fff; font-weight:800; font-size:24px; margin:0 auto 20px; }
}
:focus-visible{ outline:2px solid var(--color-primary); outline-offset:2px; }
