/* ════════════════════════════════════════════════════════
   MI BOLETA FTP — app de trabajadores (mobile-first)
   Independiente del portal · vanilla · sin build
   Marca FTP: verde #0e7c3a · naranja #f57c1f
   Inspirada en portales de empleado tipo "TuRecibo"
   ════════════════════════════════════════════════════════ */

:root {
  --primary:    #0e7c3a;
  --primary-2:  #0a5c2b;
  --primary-bg: #dcfce7;
  --accent:     #f57c1f;

  --bg:        #f3f5f7;
  --surface:   #ffffff;
  --surface-2: #f7f9fb;
  --border:    #e5e7eb;
  --border-2:  #d1d5db;

  --text:      #1f2937;
  --text-soft: #475569;
  --muted:     #6b7280;

  --ok:        #16a34a;
  --ok-bg:     #dcfce7;
  --warn:      #d97706;
  --warn-bg:   #fef3c7;
  --danger:    #dc2626;
  --danger-bg: #fee2e2;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.06);
  --shadow:    0 6px 18px rgba(15,23,42,.08), 0 2px 5px rgba(15,23,42,.05);
  --shadow-lg: 0 16px 40px rgba(15,23,42,.14);

  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --tap: 44px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ════════ BOTONES ════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  min-height: var(--tap);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px; font-weight: 800;
  transition: all .15s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 24px; font-size: 15px; min-height: 52px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--primary-2); border-color: var(--primary-2); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover, .btn-danger:focus-visible { background: var(--danger); color: #fff; }
.btn-danger svg { width: 18px; height: 18px; }

/* ════════ LOGIN ════════ */
.login-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(165deg, #0e7c3a 0%, #0a5c2b 55%, #064220 100%);
  display: flex; align-items: center; justify-content: center;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bot));
  z-index: 9999;
  overflow-y: auto;
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px rgba(0,0,0,.32), 0 8px 24px rgba(0,0,0,.18);
  padding: 32px 24px 24px;
  text-align: center;
  animation: pop .35s cubic-bezier(.16,.8,.4,1) both;
}
@keyframes pop { from { opacity:0; transform: translateY(18px) scale(.97);} to {opacity:1; transform:none;} }
.login-logo { height: 52px; width: auto; margin: 0 auto 16px; }
.login-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--primary-2); }
.login-sub { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 2px 0 24px; text-transform: uppercase; letter-spacing: .05em; }
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field > span {
  font-size: 11px; font-weight: 800; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .04em;
}
.login-field input {
  font-family: var(--font); font-size: 16px; font-weight: 600;
  color: var(--text); background: var(--surface-2);
  padding: 13px 14px; min-height: var(--tap);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  outline: none; transition: all .15s; width: 100%;
}
.login-field input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-bg); }
.login-pass { position: relative; display: flex; }
.login-pass input { padding-right: 50px; width: 100%; }
.login-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border: none; background: transparent;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.login-eye svg { width: 20px; height: 20px; }
.login-eye:hover { color: var(--primary); background: var(--surface-2); }
.login-error { min-height: 18px; font-size: 12.5px; font-weight: 700; color: var(--danger); }
.login-demo {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid #f1f5f9;
  font-size: 11.5px; color: var(--muted); font-weight: 500;
}
.login-demo b { color: var(--text-soft); font-weight: 800; }

/* ════════ SCREEN / LAYOUT ════════ */
#app { display: block; }
.screen {
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-bot) + 12px);
}
.screen-detalle { padding-bottom: calc(var(--safe-bot) + 20px); }
.view-pad {
  max-width: 560px; margin: 0 auto;
  padding: 16px 16px 0;
  display: flex; flex-direction: column; gap: 16px;
}

/* ════════ HERO (home) ════════ */
.hero {
  background: linear-gradient(160deg, #0e7c3a 0%, #0a5c2b 100%);
  color: #fff;
  padding: calc(18px + var(--safe-top)) 18px 26px;
  border-radius: 0 0 26px 26px;
  box-shadow: 0 8px 24px rgba(14,124,58,.22);
}
.hero-row { display: flex; align-items: center; gap: 10px; }
.hero-logo { height: 30px; width: auto; filter: brightness(0) invert(1); }
.hero-brand { font-size: 14px; font-weight: 800; letter-spacing: -.01em; flex: 1; }
.hero-av {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; letter-spacing: .02em;
}
.hero-greet { font-size: 24px; font-weight: 700; margin-top: 18px; letter-spacing: -.01em; }
.hero-greet b { font-weight: 800; }
.hero-date { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.85); margin-top: 4px; text-transform: capitalize; }

/* ════════ CARD PENDIENTES ════════ */
.card-pend {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer; transition: transform .15s, box-shadow .15s;
  width: 100%; text-align: left;
}
.card-pend:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-pend-left { flex: 1; min-width: 0; }
.card-pend-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card-pend-num { font-size: 42px; font-weight: 800; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; margin: 4px 0; }
.card-pend-sub { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.card-pend-ic {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 16px; background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.card-pend-ic svg { width: 28px; height: 28px; }

/* mini-stats */
.mini-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.mini-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 10px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.mini-stat-n { font-size: 24px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.mini-stat-l { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .03em; }
.mini-stat.ok .mini-stat-n { color: var(--ok); }
.mini-stat.warn .mini-stat-n { color: var(--warn); }

/* ════════ TOPBAR (boletas/perfil) ════════ */
.topbar2 {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  padding: calc(12px + var(--safe-top)) 18px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow-sm);
}
.topbar2-logo { height: 28px; width: auto; }
.topbar2-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }

/* ════════ SEGMENTED (pendientes/revisadas) ════════ */
.seg {
  display: flex; gap: 6px; padding: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.seg-btn {
  flex: 1; padding: 10px; min-height: 42px;
  background: transparent; border: none; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 800; color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s;
}
.seg-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.seg-n {
  font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px;
  background: var(--primary-bg); color: var(--primary); min-width: 20px;
}
.seg-btn:not(.active) .seg-n { background: var(--border); color: var(--text-soft); }

/* ════════ TARJETAS DE BOLETA ════════ */
.bol-cards { display: flex; flex-direction: column; gap: 12px; }
.bol-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm); text-align: left; width: 100%;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.bol-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.bol-card-main { flex: 1; min-width: 0; }
.bol-card-top { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.bol-card-periodo { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.bol-card-neto { font-size: 22px; font-weight: 800; color: var(--primary-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.bol-card-neto small { font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 6px; }
.bol-card-arrow { color: var(--muted); flex-shrink: 0; transform: rotate(180deg); }
.bol-card-arrow svg { width: 20px; height: 20px; }

/* chips */
.chip {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: .03em;
  padding: 4px 9px; border-radius: 999px; text-transform: uppercase;
}
.chip-lg { font-size: 12px; padding: 6px 14px; }
.chip-tipo { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }
.chip-pend { background: #f1f5f9; color: #64748b; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }

/* ════════ EMPTY CARD ════════ */
.empty-card {
  background: var(--surface); border: 1px dashed var(--border-2);
  border-radius: var(--radius); padding: 32px 20px; text-align: center;
}
.empty-ic {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 16px; background: var(--surface-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.empty-ic svg { width: 28px; height: 28px; }
.empty-card strong { display: block; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.empty-card p { font-size: 13px; color: var(--muted); max-width: 320px; margin: 0 auto; }

/* ════════ DETALLE ════════ */
.dtl-top {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  padding: calc(10px + var(--safe-top)) 14px 10px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow-sm);
}
.dtl-back, .dtl-print {
  width: var(--tap); height: var(--tap); flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-sm); color: var(--text-soft);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.dtl-back svg, .dtl-print svg { width: 20px; height: 20px; }
.dtl-back:hover, .dtl-print:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }
.dtl-top-titles { flex: 1; min-width: 0; }
.dtl-top-title { font-size: 16px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtl-top-sub { font-size: 11.5px; font-weight: 600; color: var(--muted); }

/* visor */
.viewer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.viewer-bar {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 8px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.zoom-btn {
  width: 36px; height: 36px; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm); font-size: 20px; font-weight: 800; color: var(--text-soft);
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.zoom-btn:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }
.zoom-val { font-size: 12.5px; font-weight: 800; color: var(--text-soft); min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.viewer-stage { overflow: auto; padding: 14px; background: #eef1f4; -webkit-overflow-scrolling: touch; }
.viewer-doc { transform-origin: top center; transition: transform .15s; width: 100%; }

/* ════════ DOCUMENTO BOLETA (vista en app) ════════ */
.boleta-doc {
  background: #fff; border: 1.5px solid var(--primary);
  border-radius: 10px; overflow: hidden;
  font-size: 11px; color: var(--text); line-height: 1.4;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
}
.bol-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; border-bottom: 2px solid var(--primary); background: var(--surface-2); }
.bol-head-brand { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.bol-logo { height: 38px; width: auto; flex-shrink: 0; }
.bol-razon { font-size: 12.5px; font-weight: 800; color: var(--primary-2); letter-spacing: -.01em; }
.bol-ruc { font-size: 10px; font-weight: 700; color: var(--primary); margin-top: 1px; }
.bol-dir { font-size: 9px; color: var(--muted); margin-top: 3px; }
.bol-title-wrap { text-align: right; flex-shrink: 0; }
.bol-title { font-size: 11px; font-weight: 800; color: var(--text); letter-spacing: .01em; }
.bol-title-sub { font-size: 9px; font-weight: 800; color: var(--accent); margin-top: 2px; letter-spacing: .06em; }
.bol-ident { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); }
.bol-ident-cell { padding: 6px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bol-ident-nombre { grid-column: span 3; }
.bol-k { font-size: 8px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.bol-v { font-size: 10.5px; font-weight: 700; color: var(--text); word-break: break-word; }
.bol-mes { padding: 6px 12px; background: var(--primary-bg); font-size: 10.5px; font-weight: 800; color: var(--primary-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bol-mes-k { font-size: 8.5px; letter-spacing: .06em; color: var(--primary); }
.bol-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bol-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 460px; }
.bol-table > thead th {
  font-size: 8px; font-weight: 800; text-transform: uppercase; color: #fff;
  background: var(--primary); padding: 6px 7px; text-align: left;
  border-right: 1px solid rgba(255,255,255,.25); letter-spacing: .02em;
  width: 25%; vertical-align: top;
}
.bol-cols > td { vertical-align: top; border-right: 1px solid var(--border); padding: 0; }
.bol-sub { width: 100%; border-collapse: collapse; }
.bol-sub td { padding: 4px 7px; border-bottom: 1px solid var(--surface-2); font-size: 9.5px; }
.bol-c-concepto { color: var(--text-soft); font-weight: 600; }
.bol-c-monto { text-align: right; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bol-empty td { color: #9ca3af; text-align: center; }
.bol-totales > td { border-top: 2px solid var(--primary); border-right: 1px solid var(--border); padding: 7px; background: var(--surface-2); vertical-align: top; }
.bol-tot-k { display: block; font-size: 8px; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.bol-tot-v { display: block; font-size: 12px; font-weight: 800; color: var(--primary-2); font-variant-numeric: tabular-nums; margin-top: 2px; }
.bol-neto { background: var(--primary-bg) !important; }
.bol-neto .bol-tot-v { color: var(--primary); font-size: 14px; }
.bol-foot { display: flex; justify-content: space-between; align-items: flex-end; padding: 24px 14px 12px; gap: 14px; flex-wrap: wrap; }
.bol-firma { text-align: center; min-width: 160px; flex: 1; }
.bol-firma-line { border-top: 1px solid var(--text); margin-bottom: 4px; }
.bol-firma-k { font-size: 8.5px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.bol-firma-n { font-size: 9.5px; font-weight: 700; color: var(--text-soft); margin-top: 2px; }
.bol-lema { font-size: 9.5px; font-style: italic; color: var(--primary); font-weight: 600; }

/* ════════ ZONA DE ACCIÓN ════════ */
.accion {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 14px;
}
.accion-title { font-size: 15px; font-weight: 800; color: var(--text); text-align: center; }
.accion-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-choice {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 10px; min-height: 84px;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-soft);
  font-size: 14px; font-weight: 800; transition: all .15s;
}
.big-choice svg { width: 26px; height: 26px; }
.big-choice.ok:hover, .big-choice.ok.sel { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.big-choice.warn:hover, .big-choice.warn.sel { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.big-choice.sel { box-shadow: 0 0 0 3px rgba(14,124,58,.08); }
.obs-wrap { display: flex; flex-direction: column; gap: 6px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(-4px);} to {opacity:1; transform:none;} }
.obs-label { font-size: 12px; font-weight: 800; color: var(--text-soft); }
.obs-label span { color: var(--danger); font-weight: 700; }
.obs-wrap textarea {
  font-family: var(--font); font-size: 16px; font-weight: 500; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; resize: vertical; min-height: 80px; outline: none;
}
.obs-wrap textarea:focus { border-color: var(--warn); background: #fff; box-shadow: 0 0 0 4px var(--warn-bg); }

/* respondida */
.accion-done { align-items: stretch; }
.accion-done-head { text-align: center; }
.accion-done-msg { font-size: 13px; font-weight: 700; color: var(--text-soft); text-align: center; }
.resp-obs { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.resp-obs-k { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); display: block; margin-bottom: 4px; }
.resp-obs p { font-size: 13px; color: var(--text); word-break: break-word; }
.link-sutil { background: none; border: none; color: var(--primary); font-size: 12.5px; font-weight: 700; text-decoration: underline; align-self: center; padding: 6px; }
.link-sutil:hover { color: var(--primary-2); }

/* ════════ PERFIL ════════ */
.perfil-head { text-align: center; padding: 10px 0 4px; }
.perfil-av {
  width: 80px; height: 80px; margin: 0 auto 12px; border-radius: 50%;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; box-shadow: var(--shadow);
}
.perfil-nombre { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.perfil-cargo { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.perfil-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.perfil-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.perfil-row:last-child { border-bottom: none; }
.perfil-k { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.perfil-v { font-size: 13.5px; font-weight: 800; color: var(--text); text-align: right; word-break: break-word; }
.perfil-foot { text-align: center; font-size: 11px; font-style: italic; color: var(--muted); padding: 8px; }

/* ════════ ADMIN ════════ */
.admin-banner {
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.admin-banner-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-chip { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--accent); padding: 4px 10px; border-radius: 999px; }
.admin-current { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.admin-current b { font-weight: 800; color: var(--text); }
.admin-search { position: relative; display: flex; }
.admin-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.admin-search-ic svg { width: 18px; height: 18px; }
.admin-search input {
  width: 100%; font-family: var(--font); font-size: 16px; font-weight: 500;
  padding: 11px 14px 11px 40px; min-height: var(--tap);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; outline: none;
}
.admin-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245,124,31,.12); }
.admin-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.admin-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); background: #fff; border-radius: var(--radius-sm); text-align: left; transition: all .15s; }
.admin-item:hover { border-color: var(--accent); background: #fffbf5; }
.admin-item.active { border-color: var(--accent); background: #fff7ed; box-shadow: inset 0 0 0 1px var(--accent); }
.admin-item-av { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.admin-item-txt { min-width: 0; display: flex; flex-direction: column; }
.admin-item-txt b { font-size: 13px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-item-txt small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-empty { font-size: 12.5px; color: var(--muted); text-align: center; padding: 12px; }

/* ════════ BOTTOM NAV ════════ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bot);
  box-shadow: 0 -2px 12px rgba(15,23,42,.06);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 4px; min-height: var(--nav-h);
  background: transparent; border: none; color: var(--muted);
  font-size: 10.5px; font-weight: 700; transition: color .15s;
}
.nav-ic { display: flex; }
.nav-ic svg { width: 24px; height: 24px; }
.nav-lbl { letter-spacing: .01em; }
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-ic svg { stroke-width: 2.4; }
.nav-item:active { transform: scale(.94); }

/* ════════ TOAST ════════ */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-bot) + 16px);
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px; border-radius: var(--radius);
  background: var(--text); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 9998; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.toast-warn { background: var(--warn); }
.toast-error { background: var(--danger); }

/* ════════ DESKTOP (>720px) ════════ */
@media (min-width: 721px) {
  .view-pad { max-width: 640px; }
  .hero, .topbar2, .dtl-top { border-radius: 0; }
  .hero { border-radius: 0 0 26px 26px; }
}

/* ════════ MOBILE SMALL (≤360px) ════════ */
@media (max-width: 360px) {
  .view-pad { padding: 14px 12px 0; }
  .hero-greet { font-size: 21px; }
  .card-pend-num { font-size: 36px; }
  .accion-btns { grid-template-columns: 1fr; }
}

/* ════════ FOCUS / MOTION ════════ */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ════════ PRINT (la boleta directa, sin chrome de la app) ════════ */
@media print {
  .topbar2, .dtl-top, .bottom-nav, .toast, .viewer-bar, .accion, .login-overlay { display: none !important; }
  body, .screen, .view-pad { background: #fff; padding: 0; }
  .viewer, .viewer-stage { border: none; box-shadow: none; padding: 0; overflow: visible; background: #fff; }
  .viewer-doc { transform: none !important; }
  .boleta-doc { box-shadow: none; }
  .bol-table { min-width: 0; }
}
