/* ============================================================
   QIL PERÚ — plantilla de courier USA→Perú
   Sistema de diseño
   ============================================================ */

:root{
  /* Color — marca (anclada al azul real del logo) */
  --ink:            #101A2C;
  --teal-900:       #0B2A54;
  --teal-800:       #123B72;
  --teal-700:       #153F7D;
  --teal-500:       #2E6FC0;
  --teal-100:       #E7EEFA;
  --sky-light:      #8FC7FF;   /* extremo claro de la estela azul en la ilustración del hero */
  --coral:          #FF6F59;
  --coral-dark:     #E2513C;
  --on-accent:      #101A2C;   /* texto sobre fondo coral — corrige contraste 2.74→6.36:1 */
  --gold:           #D9A441;
  --bg:             #F4F6FA;
  --surface:        #FFFFFF;
  --surface-2:      #F7F9FC;   /* hover de filas, cabeceras de tabla */
  --border:         #DCE3EE;
  --border-strong:  #B9C4D6;   /* inputs en foco/error, divisores que necesitan más definición */

  /* Color — estados semánticos (adoptados/ajustados de la propuesta de Gemini) */
  --success:        #15803D;
  --success-bg:     #F0FDF4;
  --warning:        #B45309;
  --warning-bg:     #FFFBEB;
  --danger:         #B91C1C;
  --danger-bg:      #FEF2F2;
  --info:           #0369A1;
  --info-bg:        #F0F9FF;

  /* Color — texto */
  --muted:          #5B6B84;
  --text-tertiary:  #94A3B8;   /* solo placeholders / deshabilitado, no para contenido real */

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Public Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;

  /* Radius / shadow */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(16,26,44,.06);
  --shadow-md: 0 8px 24px rgba(11,42,84,.10);
  --shadow-lg: 0 20px 48px rgba(11,42,84,.16);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:var(--font-body);
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  line-height:1.55;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; font-size:1rem; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4{ font-family:var(--font-display); margin:0; font-weight:600; letter-spacing:-.01em; }
p{ margin:0; }

:focus-visible{
  outline:2px solid var(--coral);
  outline-offset:3px;
}

.container{
  width:100%;
  max-width:1160px;
  margin:0 auto;
  padding:0 24px;
}

.eyebrow{
  font-family:var(--font-mono);
  font-size:.72rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--teal-700);
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.eyebrow::before{
  content:"";
  width:16px; height:1px;
  background:var(--coral);
  display:inline-block;
}

.section{ padding:88px 0; }
.section-head{
  max-width:640px;
  margin-bottom:44px;
}
.section-head h2{
  font-size:clamp(1.7rem,3vw,2.4rem);
  margin-top:12px;
}
.section-head p{
  color:var(--muted);
  margin-top:14px;
  font-size:1.03rem;
}
.section-alt{ background:var(--surface); border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.section-dark{ background:var(--teal-900); color:#F2F4F7; }
.section-dark .eyebrow{ color:#9FB5D6; }
.section-dark .eyebrow::before{ background:var(--coral); }
.section-dark .muted{ color:#B7C1CF; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:13px 24px;
  border-radius:100px;
  font-weight:600;
  font-size:.95rem;
  border:1px solid transparent;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space:nowrap;
}
.btn:active{ transform:translateY(1px); }
.btn-coral{ background:var(--coral); color:var(--on-accent); box-shadow:0 10px 24px rgba(255,111,89,.35); }
.btn-coral:hover{ background:var(--coral-dark); }
.btn-teal{ background:var(--teal-900); color:#fff; }
.btn-teal:hover{ background:var(--teal-800); }
.btn-outline{ background:transparent; border-color:var(--border); color:var(--ink); }
.btn-outline:hover{ border-color:var(--teal-700); color:var(--teal-700); }
.btn-ghost-light{ background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.28); color:#fff; }
.btn-ghost-light:hover{ background:rgba(255,255,255,.16); }
.btn-block{ width:100%; }
.btn-sm{ padding:9px 16px; font-size:.85rem; }

/* ---------- Header / Nav ---------- */
.site-header{
  position:sticky; top:0; z-index:40;
  background:var(--teal-900);
  color:#fff;
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 0;
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand-logo{ height:32px; width:auto; display:block; }
.nav-links{ display:flex; align-items:center; gap:30px; }
.nav-links a{ font-size:.92rem; color:#D9DFE8; transition:color .15s ease; }
.nav-links a:hover{ color:#fff; }
.nav-cta{ display:flex; align-items:center; gap:12px; }
.nav-toggle{ display:none; background:none; border:1px solid rgba(255,255,255,.3); border-radius:8px; padding:8px 10px; color:#fff; }
.nav-toggle svg{ display:block; }

/* Menú mobile del header público — .nav-links.open lo despliega como panel */
@media (max-width: 980px){
  .nav{ flex-wrap:wrap; }
  .nav-links{
    display:none; order:3; width:100%;
    flex-direction:column; align-items:flex-start; gap:2px;
    background:var(--teal-800); border-radius:var(--r-md);
    margin-top:14px; padding:8px; border:1px solid rgba(255,255,255,.1);
  }
  .nav-links.open{ display:flex; }
  .nav-links a{ width:100%; padding:11px 12px; border-radius:var(--r-sm); }
  .nav-links a:hover{ background:rgba(255,255,255,.08); }
}

/* País — pequeña etiqueta con bandera/código junto a datos de pedido o dirección */
.country-tag{
  display:inline-flex; align-items:center; gap:6px;
  font-family:var(--font-mono); font-size:.74rem; font-weight:600;
  color:var(--teal-700); background:var(--teal-100);
  padding:3px 9px; border-radius:100px; white-space:nowrap;
}
.country-select{
  display:flex; gap:8px; margin-bottom:18px;
}
.country-option{
  flex:1; display:flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 14px; border:1px solid var(--border); border-radius:var(--r-sm);
  font-size:.88rem; font-weight:600; color:var(--muted); background:var(--surface);
  cursor:pointer; transition:border-color .15s ease, color .15s ease, background .15s ease;
}
.country-option.active{ border-color:var(--teal-700); color:var(--teal-700); background:var(--teal-100); }

.promo-bar{
  background:var(--coral);
  color:#fff;
  font-size:.86rem;
  text-align:center;
  padding:9px 16px;
}
.promo-bar b{ font-weight:700; }

/* ---------- Hero ---------- */
.hero{
  background:
    radial-gradient(circle at 85% 15%, rgba(255,111,89,.18), transparent 45%),
    var(--teal-900);
  color:#fff;
  padding:64px 0 90px;
  position:relative;
  overflow:hidden;
}
.hero-grid{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:56px;
  align-items:center;
}
.hero-badge{
  display:inline-flex; align-items:center; gap:8px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.18);
  padding:7px 14px; border-radius:100px;
  font-family:var(--font-mono); font-size:.72rem; letter-spacing:.08em; text-transform:uppercase;
  color:#BFCDE3;
  margin-bottom:22px;
}
.hero-badge .dot{ width:7px; height:7px; border-radius:50%; background:var(--coral); }
.hero h1{
  font-size:clamp(2.4rem,4.6vw,3.6rem);
  line-height:1.04;
  color:#fff;
}
.hero h1 em{ font-style:normal; color:var(--coral); }
.hero p.lead{
  margin-top:20px;
  font-size:1.1rem;
  color:#C7D0DE;
  max-width:520px;
}
.hero-actions{ display:flex; gap:14px; margin-top:32px; flex-wrap:wrap; }
.hero-stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
  margin-top:56px;
  padding-top:28px;
  border-top:1px solid rgba(255,255,255,.14);
}
.hero-stats div b{ display:block; font-family:var(--font-display); font-size:1.5rem; color:#fff; }
.hero-stats div span{ font-size:.78rem; color:#9FABBD; }

/* route illustration */
.route-card{
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--r-lg);
  padding:26px;
  backdrop-filter:blur(6px);
}
.route-card svg{ width:100%; height:auto; }
.route-label{ font-family:var(--font-mono); font-size:.72rem; color:#9FABBD; letter-spacing:.06em; }

/* ---------- Feature grid ---------- */
.grid-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.grid-2{ display:grid; grid-template-columns:repeat(2,1fr); gap:20px; }

.feature-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-md);
  padding:26px;
  transition:box-shadow .2s ease, transform .2s ease;
}
.feature-card:hover{ box-shadow:var(--shadow-md); transform:translateY(-2px); }
.feature-icon{
  width:42px;height:42px;border-radius:11px;
  background:var(--teal-100); color:var(--teal-700);
  display:flex;align-items:center;justify-content:center;
  margin-bottom:16px;
}
.feature-card h3{ font-size:1.05rem; margin-bottom:8px; }
.feature-card p{ color:var(--muted); font-size:.92rem; }

/* ---------- Steps ---------- */
.steps{ display:grid; grid-template-columns:repeat(4,1fr); gap:0; counter-reset:step; position:relative; }
.step{ position:relative; padding:0 20px 0 0; }
.step:not(:last-child)::after{
  content:""; position:absolute; top:22px; right:-10px; width:20px; height:1px;
  border-top:2px dashed var(--border);
}
.step-num{
  font-family:var(--font-mono); font-size:.78rem; color:var(--coral);
  border:1px solid var(--coral); width:44px; height:44px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; margin-bottom:16px;
}
.step h3{ font-size:1.02rem; margin-bottom:6px; }
.step p{ color:var(--muted); font-size:.9rem; }

/* ---------- Calculator ---------- */
.calc-panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  padding:38px;
  box-shadow:var(--shadow-md);
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:36px;
}
.calc-field{ margin-bottom:18px; }
.calc-field label{ display:block; font-size:.85rem; color:var(--muted); margin-bottom:8px; }
.calc-field input{
  width:100%; padding:13px 14px; border:1px solid var(--border); border-radius:var(--r-sm);
  font-size:1rem; background:var(--bg);
}
.calc-field input:focus{ outline:none; border-color:var(--teal-500); background:#fff; }
.calc-result{
  background:var(--teal-900); color:#fff; border-radius:var(--r-md);
  padding:28px; display:flex; flex-direction:column; justify-content:center;
}
.calc-result .amount{ font-family:var(--font-display); font-size:2.6rem; color:#fff; }
.calc-result .tax-pill{
  display:inline-flex; align-items:center; gap:8px; margin-top:14px;
  padding:6px 12px; border-radius:100px; font-size:.82rem; font-family:var(--font-mono);
}
.tax-pill.no-tax{ background:rgba(47,158,110,.2); color:#8FE3B6; }
.tax-pill.has-tax{ background:rgba(217,164,65,.22); color:#F1CE86; }
.calc-note{ font-size:.78rem; color:#9FABBD; margin-top:16px; }
.rate-line{ font-size:.85rem; color:var(--muted); margin-top:20px; }
.rate-line b{ color:var(--ink); }

/* Input con prefijo (moneda / unidad) dentro de la calculadora */
.calc-input-prefix{
  display:flex; align-items:stretch; border:1px solid var(--border); border-radius:var(--r-sm);
  overflow:hidden; background:var(--bg);
}
.calc-input-prefix .prefix{
  display:flex; align-items:center; padding:0 14px; font-family:var(--font-mono); font-size:.82rem;
  font-weight:600; color:var(--muted); background:var(--surface-2); border-right:1px solid var(--border);
  white-space:nowrap;
}
.calc-field .calc-input-prefix input{
  flex:1; min-width:0; width:auto; border:none; border-radius:0; background:transparent;
  padding:13px 14px; font-size:1rem; color:var(--ink);
}
.calc-field .calc-input-prefix input:focus{ outline:none; background:transparent; }
.calc-input-prefix:focus-within{ border-color:var(--teal-500); }
.calc-field-row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }

/* Opciones adicionales: seguro (switch) + método de recepción */
.calc-options{ margin:8px 0 18px; padding-top:22px; border-top:1px solid var(--border); }
.calc-options-label{
  display:block; font-family:var(--font-mono); font-size:.72rem; text-transform:uppercase;
  letter-spacing:.06em; color:var(--muted); margin-bottom:16px;
}
.calc-options-label i{ font-style:normal; text-transform:none; letter-spacing:0; }

.calc-toggle-row{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 16px; border:1px solid var(--border); border-radius:var(--r-sm);
  cursor:pointer; margin-bottom:18px; background:var(--bg);
}
.calc-toggle-row .t{ font-size:.9rem; font-weight:600; color:var(--ink); }
.calc-toggle-row .d{ font-size:.8rem; color:var(--muted); margin-top:3px; }

.switch{ position:relative; display:inline-block; width:42px; height:24px; flex:none; }
.switch input{ position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; }
.switch .slider{
  position:absolute; inset:0; background:var(--border-strong); border-radius:100px; transition:background .15s ease;
}
.switch .slider::before{
  content:""; position:absolute; width:18px; height:18px; left:3px; top:3px; background:#fff; border-radius:50%;
  transition:transform .15s ease; box-shadow:0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider{ background:var(--teal-700); }
.switch input:checked + .slider::before{ transform:translateX(18px); }
.switch input:focus-visible + .slider{ outline:2px solid var(--teal-500); outline-offset:2px; }

/* Ayuda por WhatsApp + desglose de costos dentro del panel de resultado (fondo oscuro) */
.calc-help{
  display:inline-flex; align-items:center; gap:6px; margin-top:20px;
  font-size:.82rem; color:#BFCDE3; text-decoration:none;
}
.calc-help b{ color:#fff; text-decoration:underline; }
.calc-help:hover{ color:#fff; }

.calc-detail{ margin-top:22px; padding-top:18px; border-top:1px solid rgba(255,255,255,.14); }
.calc-detail summary{
  cursor:pointer; font-size:.82rem; font-weight:600; color:#fff; list-style:none;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.calc-detail summary::-webkit-details-marker{ display:none; }
.calc-detail summary::after{ content:"▾"; font-size:.7rem; color:#9FABBD; transition:transform .15s ease; }
.calc-detail[open] summary::after{ transform:rotate(180deg); }
.calc-detail-row{
  display:flex; justify-content:space-between; gap:12px; padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.1); font-size:.83rem; color:#C7D0DE;
}
.calc-detail-row:last-child{ border-bottom:none; }
.calc-detail-row.total{ font-weight:700; color:#fff; font-size:.92rem; padding-top:14px; }

/* ---------- Category grid ---------- */
.cat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.cat-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md);
  padding:22px 18px; text-align:center;
}
.cat-card .ic{ font-size:1.6rem; margin-bottom:10px; }
.cat-card span{ font-size:.88rem; font-weight:600; }

.callout{
  margin-top:36px;
  background:var(--teal-100);
  border:1px solid #CBD6E6;
  border-radius:var(--r-md);
  padding:26px 30px;
  display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap;
}
.callout p{ color:var(--teal-900); max-width:560px; font-size:.94rem; }
.callout h4{ font-size:1.1rem; margin-bottom:6px; }

/* ---------- Register CTA band ---------- */
.register-band{
  background:linear-gradient(120deg,var(--teal-900),var(--teal-700));
  color:#fff; border-radius:var(--r-lg); padding:52px; overflow:hidden; position:relative;
  display:grid; grid-template-columns:1.2fr .8fr; gap:40px; align-items:center;
}
.register-band h2{ color:#fff; font-size:clamp(1.5rem,2.6vw,2.1rem); }
.register-band p{ color:#C7D0DE; margin-top:12px; }
.register-perks{ display:flex; flex-direction:column; gap:14px; }
.register-perks li{ display:flex; gap:10px; align-items:flex-start; font-size:.92rem; color:#E7EEFA; }
.register-perks li::before{ content:"✓"; color:var(--coral); font-weight:700; }

/* ---------- FAQ ---------- */
.faq-item{ border-bottom:1px solid var(--border); padding:20px 0; }
.faq-q{ display:flex; align-items:center; justify-content:space-between; cursor:pointer; gap:20px; }
.faq-q h4{ font-size:1rem; font-weight:600; }
.faq-q .chev{ transition:transform .2s ease; color:var(--coral); flex:none; }
.faq-item.open .faq-q .chev{ transform:rotate(45deg); }
.faq-a{ max-height:0; overflow:hidden; transition:max-height .25s ease; }
.faq-a p{ color:var(--muted); font-size:.92rem; padding-top:14px; }
.faq-item.open .faq-a{ max-height:400px; }

/* ---------- Footer ---------- */
.site-footer{ background:var(--teal-900); color:#C7D0DE; padding:64px 0 26px; }
.footer-grid{ display:grid; grid-template-columns:1.6fr 1fr 1fr 1.1fr; gap:36px; margin-bottom:48px; }
.footer-grid h5{ color:#fff; font-size:.82rem; letter-spacing:.06em; text-transform:uppercase; margin-bottom:16px; font-family:var(--font-mono); font-weight:600; }
.footer-grid a{ display:block; font-size:.9rem; color:#B7C1CF; margin-bottom:10px; }
.footer-grid a:hover{ color:#fff; }
.footer-grid .footer-static{ display:block; font-size:.9rem; color:#B7C1CF; margin-bottom:10px; }
.footer-bottom{ border-top:1px solid rgba(255,255,255,.12); padding-top:22px; display:flex; justify-content:space-between; font-size:.82rem; color:#8A97AA; flex-wrap:wrap; gap:10px; }

/* ================= AUTH PAGES ================= */
.auth-wrap{
  min-height:100vh; display:flex;
  background:var(--teal-900);
}
.auth-visual{
  flex:1; position:relative; overflow:hidden;
  display:flex; align-items:flex-end; padding:48px;
  background:radial-gradient(circle at 30% 20%, rgba(255,111,89,.22), transparent 50%), var(--teal-900);
}
.auth-visual-inner{ color:#fff; max-width:420px; }
.auth-visual-inner .eyebrow{ color:#9FB5D6; }
.auth-visual-inner h2{ color:#fff; font-size:1.9rem; margin-top:14px; }
.auth-visual-inner p{ color:#C7D0DE; margin-top:12px; font-size:.95rem; }
.auth-form-side{
  width:460px; background:var(--bg); display:flex; align-items:center; justify-content:center; padding:40px;
}
.auth-card{ width:100%; max-width:360px; }
.auth-card .brand{ margin-bottom:36px; }
.auth-card .brand-logo{ height:34px; }
.auth-card h1{ font-size:1.6rem; margin-bottom:8px; }
.auth-card .sub{ color:var(--muted); font-size:.9rem; margin-bottom:28px; }
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:.83rem; font-weight:600; margin-bottom:7px; color:var(--ink); }
.field input, .field select, .field textarea{
  width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:var(--r-sm); background:#fff;
}
.field input:focus, .field select:focus, .field textarea:focus{ outline:none; border-color:var(--teal-500); }
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.field-hint{ font-size:.78rem; color:var(--muted); margin-top:6px; }
.field-error{ font-size:.78rem; color:var(--danger); margin-top:6px; display:none; }
.field.invalid input{ border-color:var(--danger); }
.field.invalid .field-error{ display:block; }
.auth-foot{ text-align:center; margin-top:22px; font-size:.88rem; color:var(--muted); }
.demo-hint{
  margin-top:22px; background:var(--teal-100); border:1px solid #CBD6E6; border-radius:var(--r-sm);
  padding:12px 14px; font-size:.8rem; color:var(--teal-900); font-family:var(--font-mono);
}
.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:#fff; padding:13px 22px; border-radius:100px; font-size:.88rem;
  opacity:0; pointer-events:none; transition:all .25s ease; z-index:200; box-shadow:var(--shadow-lg);
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast.success{ background:var(--success); }

/* ================= DASHBOARD ================= */
.dash{ display:flex; min-height:100vh; background:var(--bg); }
.dash-sidebar{
  width:250px; background:var(--teal-900); color:#fff; padding:26px 18px; flex:none;
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
  transition:transform .25s ease;
}
.dash-sidebar .brand{ color:#fff; padding:0 8px; margin-bottom:34px; }
.dash-sidebar-close{ display:none; }
.dash-nav a{
  display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:var(--r-sm);
  color:#B7C1CF; font-size:.9rem; margin-bottom:4px; transition:background .15s ease,color .15s ease;
}
.dash-nav a svg{ flex:none; }
.dash-nav a:hover{ background:rgba(255,255,255,.06); color:#fff; }
.dash-nav a.active{ background:var(--coral); color:var(--on-accent); font-weight:600; box-shadow:0 6px 16px rgba(255,111,89,.28); }
.dash-sidebar .spacer{ flex:1; }
.dash-user{
  display:flex; align-items:center; gap:10px; padding:12px; border-radius:var(--r-sm);
  background:rgba(255,255,255,.06); font-size:.85rem;
}
.dash-user .av{
  width:34px;height:34px;border-radius:50%; background:linear-gradient(145deg,var(--coral),var(--gold));
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.8rem; color:#101A2C; flex:none;
}
.dash-main{ flex:1; padding:32px 40px; min-width:0; }
.dash-topbar{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:28px; flex-wrap:wrap; gap:16px; }
.dash-topbar h1{ font-size:1.7rem; }
.dash-topbar p{ color:var(--muted); margin-top:6px; font-size:.92rem; }

.stat-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; margin-bottom:30px; }
.stat-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:20px; }
.stat-card .label{ font-size:.78rem; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; font-family:var(--font-mono); }
.stat-card .value{ font-family:var(--font-display); font-size:1.9rem; margin-top:8px; }
.stat-card .delta{ font-size:.78rem; margin-top:6px; }
.stat-card .delta.up{ color:var(--success); }
.stat-card .delta.flat{ color:var(--muted); }

.panel{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden; }
.panel-head{ display:flex; justify-content:space-between; align-items:center; padding:20px 22px; border-bottom:1px solid var(--border); }
.panel-head h3{ font-size:1.05rem; }

/* ---------- Barra mobile del portal (oculta en desktop) ---------- */
.dash-mobile-bar{
  display:none; align-items:center; justify-content:space-between;
  background:var(--teal-900); color:#fff; padding:14px 18px; position:sticky; top:0; z-index:30;
}
.dash-mobile-bar .brand-logo{ height:24px; }
.dash-mobile-bar .actions{ display:flex; align-items:center; gap:8px; }
.dash-toggle{
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.25); border-radius:8px;
  padding:8px; color:#fff; display:flex; align-items:center; justify-content:center;
}
.dash-backdrop{
  display:none; position:fixed; inset:0; background:rgba(11,42,84,.5); z-index:35;
}
.dash-backdrop.show{ display:block; }

/* ---------- Notificaciones ---------- */
.notif-bell{ position:relative; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.25); border-radius:8px; padding:8px; color:#fff; display:flex; }
.notif-bell .count{
  position:absolute; top:-6px; right:-6px; background:var(--coral); color:var(--on-accent);
  font-size:.66rem; font-weight:700; min-width:16px; height:16px; border-radius:100px;
  display:flex; align-items:center; justify-content:center; padding:0 3px; font-family:var(--font-mono);
}
.notif-bell.on-light{ background:var(--surface); border-color:var(--border); color:var(--ink); box-shadow:var(--shadow-sm); }
.notif-panel{
  position:absolute; top:calc(100% + 10px); right:0; width:340px; max-width:90vw;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md);
  box-shadow:var(--shadow-lg); z-index:60; display:none; overflow:hidden;
}
.notif-panel.show{ display:block; }
.notif-panel .np-head{ padding:14px 18px; border-bottom:1px solid var(--border); font-weight:600; font-size:.92rem; }
.notif-item{ display:flex; gap:12px; padding:14px 18px; border-bottom:1px solid var(--border); }
.notif-item:last-child{ border-bottom:none; }
.notif-item .ic{
  width:32px; height:32px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  background:var(--teal-100); color:var(--teal-700);
}
.notif-item.unread .ic{ background:var(--teal-700); color:#fff; }
.notif-item p{ font-size:.85rem; color:var(--ink); line-height:1.4; }
.notif-item .t{ font-size:.74rem; color:var(--muted); margin-top:4px; font-family:var(--font-mono); }
.notif-empty{ padding:30px 18px; text-align:center; color:var(--muted); font-size:.85rem; }
.topbar-wrap{ position:relative; }

/* ---------- Estado vacío ---------- */
.empty-state{
  display:flex; flex-direction:column; align-items:center; text-align:center;
  padding:64px 24px; color:var(--muted);
}
.empty-state .ic{
  width:64px; height:64px; border-radius:50%; background:var(--teal-100); color:var(--teal-700);
  display:flex; align-items:center; justify-content:center; margin-bottom:20px;
}
.empty-state h3{ color:var(--ink); font-size:1.1rem; margin-bottom:8px; }
.empty-state p{ max-width:380px; font-size:.92rem; margin-bottom:22px; }

/* ---------- Vista Mi perfil ---------- */
.profile-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.profile-field{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:16px 18px; }
.profile-field .lbl{ font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-family:var(--font-mono); }
.profile-field .val{ font-size:.98rem; margin-top:6px; font-weight:600; }
.profile-locker{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  background:var(--teal-900); color:#fff; border-radius:var(--r-md); padding:18px 20px; margin-bottom:18px;
}
.profile-locker .code{ font-family:var(--font-mono); font-size:1.2rem; font-weight:700; }
.profile-locker .country{ font-size:.78rem; color:#9FABBD; margin-top:4px; }
.profile-locker.pending{
  background:rgba(217,164,65,.14); color:var(--ink); border:1px dashed var(--gold); flex-wrap:wrap;
}
.profile-locker.pending .code{ font-family:var(--font-body); font-size:.98rem; font-weight:700; color:#8A6414; }
.profile-locker.pending .country{ color:var(--muted); }

/* ---------- Tarjetas de pedido (mobile) ---------- */
.order-cards{ display:none; }
.order-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md);
  padding:16px 18px; margin:0 0 12px; cursor:pointer;
}
.order-card:last-child{ margin-bottom:0; }
.order-card .oc-top{ display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:8px; }
.order-card .oc-desc{ font-size:.9rem; color:var(--ink); margin-bottom:10px; }
.order-card .oc-meta{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:.78rem; color:var(--muted); }

table.orders, table.data-table{ width:100%; border-collapse:collapse; font-size:.88rem; }
table.orders th, table.data-table th{
  text-align:left; padding:12px 22px; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em;
  color:var(--muted); font-family:var(--font-mono); border-bottom:1px solid var(--border); background:var(--surface-2);
}
table.orders td, table.data-table td{ padding:14px 22px; border-bottom:1px solid var(--border); vertical-align:middle; }
table.orders tbody tr, table.data-table tbody tr{ cursor:pointer; transition:background .12s ease; }
table.orders tbody tr:hover, table.data-table tbody tr:hover{ background:var(--surface-2); }
table.orders tbody tr:last-child td, table.data-table tbody tr:last-child td{ border-bottom:none; }
.order-code{ font-family:var(--font-mono); font-size:.82rem; color:var(--teal-700); }

/* Sistema de estados logísticos — el color comunica la CATEGORÍA (neutral / en progreso /
   éxito / atención); el ícono + el texto comunican el estado exacto. No depender solo del color. */
.badge{ display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius:100px; font-size:.76rem; font-weight:600; }
.badge svg{ width:12px; height:12px; flex:none; }

/* Neutral / inicio — Registrado, Pendiente */
.badge.b-registrado,
.badge.b-pendiente{ background:#E9ECF2; color:#5C6478; }

/* En progreso — Comprado, Recibido en casilla, Procesando, Consolidado, Despachado, En tránsito, En camino */
.badge.b-comprado,
.badge.b-recibido,
.badge.b-procesando,
.badge.b-consolidado,
.badge.b-despachado,
.badge.b-transito,
.badge.b-camino{ background:var(--teal-100); color:var(--teal-700); }

/* Atención — requiere revisión, no es necesariamente un error (aduana) o sí lo es (incidencia) */
.badge.b-aduana{ background:var(--warning-bg); color:var(--warning); }
.badge.b-incidencia{ background:var(--danger-bg); color:var(--danger); }

/* Éxito — Entregado */
.badge.b-entregado{ background:var(--success-bg); color:var(--success); }

/* Modal */
.modal-overlay{
  position:fixed; inset:0; background:rgba(14,20,29,.55); display:none;
  align-items:flex-start; justify-content:center; padding:60px 20px; z-index:100; overflow-y:auto;
}
.modal-overlay.show{ display:flex; }
.modal{ background:#fff; border-radius:var(--r-lg); max-width:600px; width:100%; padding:34px; box-shadow:var(--shadow-lg); }
.modal-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:22px; }
.modal-head h3{ font-size:1.25rem; }
.modal-close{ background:none; border:none; font-size:1.3rem; color:var(--muted); line-height:1; }

.tracking-steps{ list-style:none; margin:0; padding:0; }
.tracking-steps li{ display:flex; gap:14px; padding-bottom:22px; position:relative; }
.tracking-steps li:not(:last-child)::before{
  content:""; position:absolute; left:11px; top:26px; bottom:0; width:1px; background:var(--border);
}
.tracking-steps .dot{
  width:24px;height:24px;border-radius:50%; background:#E9ECF2; color:#9AA3B5;
  display:flex; align-items:center; justify-content:center; flex:none; font-size:.7rem; margin-top:2px;
}
.tracking-steps li.done .dot{ background:var(--success); color:#fff; }
.tracking-steps li.current .dot{ background:var(--coral); color:#fff; }
.tracking-steps .t-title{ font-weight:600; font-size:.9rem; }
.tracking-steps .t-date{ font-size:.78rem; color:var(--muted); margin-top:2px; font-family:var(--font-mono); }

/* Utility */
.mt-8{ margin-top:8px; } .mt-16{ margin-top:16px; } .mt-24{ margin-top:24px; } .mt-32{ margin-top:32px; }
.flex{ display:flex; } .items-center{ align-items:center; } .justify-between{ justify-content:space-between; } .gap-8{gap:8px;} .gap-12{gap:12px;}
.text-muted{ color:var(--muted); }
.hidden{ display:none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .nav-toggle{ display:inline-flex; }
  .hero-grid{ grid-template-columns:1fr; }
  .hero-stats{ grid-template-columns:repeat(2,1fr); }
  .grid-4,.grid-3,.cat-grid,.steps{ grid-template-columns:repeat(2,1fr); }
  .steps .step::after{ display:none; }
  .calc-panel{ grid-template-columns:1fr; }
  .register-band{ grid-template-columns:1fr; padding:34px; }
  .footer-grid{ grid-template-columns:1fr 1fr; }
  .auth-visual{ display:none; }
  .auth-form-side{ width:100%; }

  /* Portal del usuario: el sidebar se convierte en drawer, no desaparece */
  .dash-mobile-bar{ display:flex; }
  .dash-sidebar{
    position:fixed; top:0; left:0; z-index:40; height:100vh;
    transform:translateX(-100%);
  }
  .dash-sidebar.open{ transform:translateX(0); }
  .dash-sidebar-close{
    display:flex; align-items:center; justify-content:center; margin-left:auto;
    background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.25); border-radius:8px;
    width:30px; height:30px; color:#fff;
  }
  .dash-sidebar .brand{ display:flex; align-items:center; justify-content:space-between; }
  .dash-main{ padding:20px; }
  .stat-row{ grid-template-columns:repeat(2,1fr); }
  .profile-grid{ grid-template-columns:1fr; }

  /* Tabla de pedidos → tarjetas */
  #pedidos-panel .table-scroll{ display:none; }
  .order-cards{ display:block; padding:14px; }

  /* Tablas densas del panel admin: no hay vista de tarjetas, se mantienen con scroll
     horizontal para no perder columnas (uso interno del equipo, no del cliente). */
  .data-table{ min-width:640px; }
}
@media (max-width: 560px){
  .grid-4,.grid-3,.cat-grid,.steps,.hero-stats{ grid-template-columns:1fr 1fr; }
  .section{ padding:56px 0; }
  .field-row{ grid-template-columns:1fr; }
  table.orders, table.data-table{ font-size:.8rem; }
  table.orders th, table.data-table th, table.orders td, table.data-table td{ padding:10px 12px; }
  .filter-bar{ flex-direction:column; align-items:stretch; }
  .admin-kpi-row{ grid-template-columns:1fr 1fr; }
}

/* ================= PANEL DE ADMINISTRACIÓN ================= */
/* Reutiliza el shell .dash / .dash-sidebar / .panel / .stat-card / table.data-table
   del Design System. Estos son los componentes propios de la vista admin. */
.admin-kpi-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; margin-bottom:30px; }

.filter-bar{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  padding:16px 22px; border-bottom:1px solid var(--border); background:var(--surface-2);
}
.filter-bar input[type="search"],
.filter-bar select{
  padding:10px 14px; border:1px solid var(--border); border-radius:var(--r-sm);
  font-size:.86rem; background:var(--surface); color:var(--ink);
}
.filter-bar input[type="search"]{ flex:1; min-width:200px; }
.filter-bar input[type="search"]:focus,
.filter-bar select:focus{ outline:none; border-color:var(--teal-500); }
.filter-bar .filter-count{ font-size:.8rem; color:var(--muted); white-space:nowrap; }

.status-select{
  padding:6px 10px; border:1px solid var(--border); border-radius:var(--r-sm);
  font-size:.78rem; background:var(--surface); color:var(--ink); margin-top:6px;
}
.status-select:focus{ outline:none; border-color:var(--teal-500); }

.mu-cas-input{
  padding:6px 10px; border:1px solid var(--border); border-radius:var(--r-sm);
  font-size:.78rem; background:var(--surface); color:var(--ink); width:126px; font-family:var(--font-mono);
}
.mu-cas-input:focus{ outline:none; border-color:var(--teal-500); }

.user-status{ display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius:100px; font-size:.76rem; font-weight:600; }
.user-status.activo{ background:var(--success-bg); color:var(--success); }
.user-status.inactivo{ background:var(--danger-bg); color:var(--danger); }

.avatar-sm{
  width:30px; height:30px; border-radius:50%; flex:none;
  background:linear-gradient(145deg,var(--coral),var(--gold));
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.74rem; color:var(--on-accent);
}
.name-cell{ display:flex; align-items:center; gap:10px; }

.warehouse-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md);
  padding:24px; margin-bottom:18px;
}
.warehouse-card .wh-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; gap:12px; flex-wrap:wrap; }
.warehouse-card .wh-head h3{ font-size:1.05rem; display:flex; align-items:center; gap:8px; }
.warehouse-card .wh-code{ font-family:var(--font-mono); font-size:.82rem; color:var(--teal-700); background:var(--teal-100); padding:4px 10px; border-radius:100px; }

.detail-row{ display:flex; justify-content:space-between; gap:14px; padding:10px 0; border-bottom:1px solid var(--border); font-size:.88rem; }
.detail-row:last-child{ border-bottom:none; }
.detail-row .k{ color:var(--muted); }
.detail-row .v{ font-weight:600; text-align:right; }

.mini-order{ display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); }
.mini-order:last-child{ border-bottom:none; }
.mini-order .mo-main{ min-width:0; }
.mini-order .mo-main .oc-desc{ font-size:.85rem; color:var(--muted); margin-top:2px; }

@media (max-width: 980px){
  .admin-kpi-row{ grid-template-columns:repeat(2,1fr); }
}
