/* ============================================================
   WalletPass — Sistema de diseno
   Linea visual "Nexepass": fondo claro #F6F8FB, azul #3B4BF5 +
   menta #5FD4C8 + navy #0B0E26. Botones pildora, tarjetas muy
   redondeadas, tipografia Plus Jakarta Sans.
   ============================================================ */

:root {
  /* ---- Marca ---- */
  --blue: #3B4BF5;        /* azul principal */
  --blue-deep: #2F3DD6;   /* hover / enlaces */
  --mint: #5FD4C8;        /* acento menta */
  --mint-ink: #0E6B62;    /* texto sobre menta clara */
  --ink: #0B0E26;         /* navy oscuro (texto y fondos oscuros) */

  /* ---- Tints suaves (fondos de bloques) ---- */
  --tint-blue: #E9ECFF;
  --tint-mint: #DDF5F2;
  --tint-peach: #F6EEE6;
  --tint-sun: #FBF4D6;

  /* ---- Superficies ---- */
  --bg: #F6F8FB;
  --surface: #ffffff;
  --surface-2: #EEF2F7;
  --border: #E3E8F0;
  --text: #0B0E26;
  --text-soft: #535A77;
  --text-faint: #8A90AB;

  /* ---- Zona oscura (barra lateral y secciones navy) ---- */
  --nav-bg: #0B0E26;
  --nav-card: #161A3D;
  --nav-card-2: #1F2450;
  --nav-pill: #2E3468;
  --nav-text: #B8BDD9;

  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;

  --radius: 20px;
  --radius-sm: 14px;
  --radius-lg: 28px;
  --shadow: 0 12px 30px -14px rgba(11, 14, 38, 0.18);
  --shadow-lg: 0 30px 60px -26px rgba(11, 14, 38, 0.38);
  --ring: 0 0 0 3px rgba(59, 75, 245, 0.22);

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-title: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* ---- Alias compatibles con vistas antiguas ---- */
  --blue-900: #10122e;
  --blue-800: #161A3D;
  --blue-700: #1F2450;
  --blue-600: var(--blue);
  --blue-500: var(--blue);
  --blue-400: #6671cc;
  --mist: var(--tint-mint);
  --mist-deep: var(--mint);
  --cyan: var(--mint);
  --steel: #8F96C9;
  --metal: var(--ink);
  --metal-sheen: var(--blue);
  --cyan-grad: linear-gradient(135deg, var(--blue) 0%, var(--mint) 100%);
  --panel-grad: var(--ink);
  --radius-full: 999px;
}

/* Titulos */
h1, h2, h3, h4,
.brand h1, .page-title, .stat .num, .wallet-primary .val,
.auth-art h2, .auth-box h3, .card-head h3 {
  font-family: var(--font-title);
  letter-spacing: -0.03em;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  text-wrap: pretty;
}
a { color: inherit; text-decoration: none; }
::selection { background: #C9CFFF; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- Layout con barra lateral ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 264px; flex-shrink: 0;
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 22px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 24px; }
.brandmark { width: 40px; height: 36px; flex-shrink: 0; display: block; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--blue);
  display: grid; place-items: center;
  position: relative;
  box-shadow: 0 8px 20px -6px rgba(59, 75, 245, 0.55);
}
.brand .logo::after {
  content: ''; position: absolute; right: -5px; top: -5px;
  width: 18px; height: 18px; border-radius: 6px;
  background: var(--mint); opacity: .95;
}
.brand h1 { font-size: 19px; color: #fff; font-weight: 800; letter-spacing: -0.03em; }
.brand span { font-size: 11px; color: var(--steel); display: block; font-weight: 500; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--mint); padding: 16px 12px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 12px;
  color: var(--nav-text); font-weight: 600; font-size: 14px;
  transition: all .15s ease;
}
.nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav a.active { background: var(--blue); color: #fff; box-shadow: 0 8px 18px -8px rgba(59,75,245,.8); }
.nav a i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.logo i { font-size: 22px; color: #fff; }
.brand .logo i { font-size: 20px; color: #fff; position: relative; z-index: 1; }
.sidebar-foot a i { font-size: 15px; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-foot a { color: var(--steel); font-size: 13px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; }
.sidebar-foot a:hover { background: rgba(255,255,255,0.05); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 74px; background: rgba(246,248,251,.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.topbar .page-title small { display: block; font-size: 12px; color: var(--text-soft); font-weight: 500; letter-spacing: 0; }
.topbar .user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.content { padding: 28px 32px 60px; }

/* ---------- Tarjetas de estadistica ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  background: var(--surface); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  border: 1px solid var(--border); position: relative; overflow: hidden;
}
.stat .ico { width: 48px; height: 48px; border-radius: 15px; background: var(--tint-blue); display: grid; place-items: center; margin-bottom: 16px; }
.stat .ico i { font-size: 22px; color: var(--blue); }
.stat .num { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; }
.stat .lbl { color: var(--text-soft); font-size: 13px; font-weight: 500; margin-top: 2px; }

/* ---------- Paneles ---------- */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  overflow: hidden;
}
.card-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-head h3 { font-size: 17px; font-weight: 700; }
.card-head p { font-size: 13px; color: var(--text-soft); }
.card-body { padding: 24px; }

.section-title { font-size: 15px; font-weight: 700; margin: 26px 0 14px; display: flex; align-items: center; gap: 8px; }

/* ---------- Botones (pildora) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 14px;
  border: none; cursor: pointer; transition: all .18s ease; font-family: inherit;
  min-height: 44px;
}
.btn i { font-size: 14px; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 12px 24px -10px rgba(59,75,245,.6); }
.btn-primary:hover { background: var(--blue-deep); transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--blue); transform: translateY(-1px); }
.btn-cyan { background: var(--mint); color: var(--ink); box-shadow: 0 12px 24px -10px rgba(95,212,200,.6); }
.btn-cyan:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-danger:hover { background: #fbdcdc; }
.btn-sm { padding: 8px 15px; font-size: 13px; min-height: 38px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Tablas ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; }
.table td { padding: 15px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }

/* ---------- Pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-green { background: #dcfce7; color: #166534; }
.pill-amber { background: #fef3c7; color: #92400e; }
.pill-blue { background: var(--tint-blue); color: var(--blue-deep); }
.pill-gray { background: var(--surface-2); color: #475569; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; color: var(--text); }
.field .hint { font-size: 12px; color: var(--text-soft); font-weight: 400; margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%; padding: 13px 15px; border: 1px solid var(--border);
  border-radius: 14px; font-size: 15px; font-family: inherit; background: var(--surface);
  color: var(--text); transition: all .15s ease;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.textarea { resize: vertical; min-height: 90px; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 48px; height: 46px; border: 1px solid var(--border); border-radius: 12px; padding: 3px; background: #fff; cursor: pointer; }

/* ---------- Zona de imagen (placeholder con medidas) ---------- */
.imgzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 172px;
  border: 1.5px dashed var(--border); border-radius: 18px;
  background: var(--surface-2);
  padding: 18px 14px; text-align: center; cursor: pointer;
  transition: all .15s ease; position: relative; overflow: hidden;
}
.imgzone:hover { border-color: var(--blue); background: var(--tint-blue); }
.imgzone .ph-ico {
  width: 50px; height: 50px; border-radius: 14px; margin-bottom: 4px;
  background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--blue);
}
.imgzone .ph-ico i { font-size: 20px; }
.imgzone .ph-size { font-weight: 700; font-size: 13px; color: var(--text); }
.imgzone .ph-dim { font-size: 11px; font-weight: 700; color: var(--blue); }
.imgzone .ph-desc { font-size: 11px; color: var(--text-faint); line-height: 1.35; margin-top: 2px; max-width: 210px; }
.imgzone .ph-upload { margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--blue); display: inline-flex; align-items: center; gap: 5px; }
.imgzone.has-img { border-style: solid; border-color: var(--blue); background: #fff; padding: 12px; }
.imgzone.has-img img { max-width: 100%; max-height: 118px; object-fit: contain; border-radius: 8px; display: block; }
.imgzone input[type=file] { display: none; }

/* ---------- Vista previa de la tarjeta Wallet ---------- */
.wallet-preview { position: sticky; top: 100px; }
.wallet-card {
  width: 320px; border-radius: 22px; margin: 0 auto;
  box-shadow: var(--shadow-lg); overflow: hidden; color: #fff;
  font-size: 13px; position: relative;
}
.wallet-top { padding: 16px 18px 10px; display: flex; align-items: center; justify-content: space-between; }
.wallet-logo { height: 30px; max-width: 150px; object-fit: contain; }
.wallet-logo-ph { font-weight: 800; font-size: 15px; opacity: .95; }
.wallet-head-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: .8; }
.wallet-strip { height: 90px; background: rgba(255,255,255,0.12); display: grid; place-items: center; font-size: 11px; opacity: .85; overflow: hidden; }
.wallet-strip img { width: 100%; height: 100%; object-fit: cover; }
.wallet-primary { padding: 14px 18px 6px; }
.wallet-primary .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: .75; }
.wallet-primary .val { font-size: 26px; font-weight: 800; }
.wallet-fields { display: flex; justify-content: space-between; padding: 6px 18px 14px; }
.wallet-fields .lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; opacity: .7; }
.wallet-fields .val { font-size: 14px; font-weight: 700; }
.wallet-barcode { background: #fff; margin: 0 18px 18px; border-radius: 12px; padding: 12px; display: grid; place-items: center; }
.wallet-barcode .qr { width: 90px; height: 90px; background: repeating-linear-gradient(90deg,var(--ink) 0 4px,#fff 4px 8px); border-radius: 4px; }
.wallet-barcode .sn { color: #334; font-size: 10px; margin-top: 6px; letter-spacing: 1px; }
/* ---- Variaciones del disenador (orientacion, tamanos) ---- */
.wallet-card.fs-sm .wallet-primary .val { font-size: 20px; }
.wallet-card.fs-md .wallet-primary .val { font-size: 26px; }
.wallet-card.fs-lg .wallet-primary .val { font-size: 34px; }
.wallet-logo.lg-sm { height: 22px; }
.wallet-logo.lg-md { height: 30px; }
.wallet-logo.lg-lg { height: 46px; }
.wallet-card.horizontal { width: 440px; }
.wallet-card.horizontal .wallet-strip { display: none; }
.wallet-card.horizontal .wallet-main { display: flex; align-items: center; gap: 12px; padding: 4px 16px 16px; }
.wallet-card.horizontal .wallet-left { flex: 1; min-width: 0; }
.wallet-card.horizontal .wallet-primary { padding: 10px 0 4px; }
.wallet-card.horizontal .wallet-fields { padding: 0; }
.wallet-card.horizontal .wallet-barcode { margin: 0; width: 118px; flex-shrink: 0; }
.wallet-card.horizontal .wallet-barcode .qr { width: 78px; height: 78px; }
.orient-opt { display: flex; gap: 10px; }
.orient-opt label { flex: 1; cursor: pointer; }
.orient-opt input { display: none; }
.orient-opt .box { border: 2px solid var(--border); border-radius: 14px; padding: 14px; text-align: center; transition: all .15s; }
.orient-opt input:checked + .box { border-color: var(--blue); background: var(--tint-blue); box-shadow: var(--ring); }
.orient-opt .box i { font-size: 22px; color: var(--blue); }
.orient-opt .box div { font-size: 13px; font-weight: 700; margin-top: 6px; }

/* Interruptor (toggle) */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ''; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.platform-tag { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; color: var(--text-soft); margin-top: 14px; justify-content: center; }
.platform-tag i { font-size: 15px; }
.auth-features .fi i { font-size: 15px; }
.auth-art .badge i { font-size: 14px; }
.pill i, .type-chip i { font-size: 12px; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); padding: 8px; gap: 8px; }
.auth-art {
  background: var(--ink); color: #fff; padding: 56px;
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.auth-art::before { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: var(--mint); opacity: .12; top: -80px; right: -80px; filter: blur(18px); }
.auth-art::after { content: ''; position: absolute; width: 280px; height: 280px; border-radius: 50%; background: var(--blue); opacity: .18; bottom: -60px; left: -40px; filter: blur(14px); }
.auth-art .badge { display: inline-flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.1); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; width: fit-content; margin-bottom: 28px; backdrop-filter: blur(6px); color: var(--mint); }
.auth-art h2 { font-size: 42px; line-height: 1.04; letter-spacing: -0.04em; margin-bottom: 16px; position: relative; font-weight: 800; }
.auth-art p { font-size: 16px; opacity: .82; max-width: 420px; position: relative; line-height: 1.6; }
.auth-features { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.auth-features div { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.auth-features .fi { width: 36px; height: 36px; border-radius: 11px; background: rgba(255,255,255,0.12); display: grid; place-items: center; color: var(--mint); }
.auth-form { display: grid; place-items: center; padding: 40px; background: var(--surface); border-radius: var(--radius-lg); }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h3 { font-size: 28px; letter-spacing: -0.03em; margin-bottom: 6px; font-weight: 800; }
.auth-box .sub { color: var(--text-soft); margin-bottom: 26px; }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 24px; }
.auth-tabs a { flex: 1; text-align: center; padding: 10px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--text-soft); }
.auth-tabs a.active { background: var(--surface); color: var(--blue); box-shadow: var(--shadow); }
.alert { padding: 13px 16px; border-radius: 14px; font-size: 13px; margin-bottom: 18px; }
.alert-error { background: #fdecec; color: var(--danger); }
.alert-info { background: var(--tint-blue); color: var(--blue-deep); }
.cred-hint { margin-top: 20px; font-size: 12px; color: var(--text-faint); text-align: center; line-height: 1.7; }

/* ---------- Varios ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-soft); }
.empty i { font-size: 46px; color: var(--steel); margin-bottom: 14px; display: block; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 14px; flex-wrap: wrap; }
.type-chip { display: inline-flex; gap: 7px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 700; border: 1px solid var(--border); }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; width: 110px; }
.progress > span { display: block; height: 100%; background: var(--mint); }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.muted { color: var(--text-soft); }
.mt { margin-top: 18px; } .mt-lg { margin-top: 28px; }

@media (max-width: 1000px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: -264px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; }
  .grid.cols-4, .grid.cols-2 { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 50px; }
  .topbar { padding: 0 16px; }
}
