/* ============================================================
   GestiFalla — Design System
   Estética base: ABANCA (banca móvil ES). Tokens multi-falla.
   ============================================================ */

:root {
  /* Identidad cromática — solo --gf-primary y --gf-accent cambian por falla */
  --gf-primary: #1558A8;       /* Header, botones, badges activos */
  --gf-accent:  #72C0E8;       /* Stripe, highlights, links */
  --gf-primary-dark: #0d3d7a;  /* Barra códigos ficha, overlay */
  --gf-primary-soft: #EEF4FC;  /* Fondos suaves derivados */

  --gf-bg:     #f5f6f8;        /* Fondo general */
  --gf-card:   #ffffff;        /* Cards */
  --gf-border: #e4e8ed;        /* Bordes */
  --gf-text:   #0d2a50;        /* Texto principal */
  --gf-muted:  #8a9ab5;        /* Texto secundario */
  --gf-gold:   #FFD166;        /* Insignias, símbolo moneda */

  --gf-green: #1FA971;
  --gf-green-soft: #E4F6EE;
  --gf-red:   #E0564B;
  --gf-red-soft: #FCEAE8;
  --gf-amber: #E8A33D;

  --gf-r-sm: 10px;
  --gf-r-md: 12px;
  --gf-r-lg: 14px;
  --gf-r-xl: 18px;

  --gf-shadow-card: 0 1px 2px rgba(13,42,80,0.04);
  --gf-shadow-pop:  0 8px 28px rgba(13,42,80,0.16);

  --gf-font: 'Manrope', -apple-system, system-ui, sans-serif;
  --gf-safe-top: 54px;   /* clearance status bar */
  --gf-nav-h: 64px;      /* bottom nav */
  --gf-home-ind: 26px;   /* home indicator clearance */
}

/* ---------- Reset (scoped) ---------- */
.gf-app, .gf-app * { box-sizing: border-box; margin: 0; padding: 0; }
.gf-app {
  font-family: var(--gf-font);
  color: var(--gf-text);
  background: var(--gf-bg);
  height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow: hidden;
}
:where(.gf-app button) { font-family: inherit; cursor: pointer; border: none; background: transparent; color: inherit; }
.gf-app input { font-family: inherit; }
.gf-app ::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- Screen scaffold ---------- */
.gf-screen { height: 100%; display: flex; flex-direction: column; background: var(--gf-bg); position: relative; }
.gf-body { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.gf-body--padnav { padding-bottom: calc(var(--gf-nav-h) + var(--gf-home-ind) + 12px); }

/* ============================================================
   Header universal
   ============================================================ */
.gf-header {
  background: var(--gf-primary);
  padding: var(--gf-safe-top) 18px 14px;
  position: relative;
  flex-shrink: 0;
}
.gf-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: var(--gf-accent);
}
.gf-header__row { display: flex; align-items: center; justify-content: space-between; }
.gf-logo { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.gf-logo b { color: var(--gf-accent); font-weight: 800; }
.gf-header__icons { display: flex; align-items: center; gap: 6px; }
.gf-iconbtn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.78); position: relative;
  transition: background .15s;
}
.gf-iconbtn:active { background: rgba(255,255,255,0.12); }
.gf-iconbtn .gf-dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--gf-red); border: 2px solid var(--gf-primary);
}
.gf-header__greet { color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 600; margin-top: 14px; }
.gf-header__name { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-top: 1px; }

/* Sub-header (titulo simple de pantalla interior) */
.gf-subhead { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.gf-back {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.gf-subhead__title { color: #fff; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }

/* ============================================================
   Cards & data cells
   ============================================================ */
.gf-card {
  background: var(--gf-card);
  border: 0.5px solid var(--gf-border);
  border-radius: var(--gf-r-md);
  box-shadow: var(--gf-shadow-card);
}
.gf-section { padding: 16px; }
.gf-section--tight { padding: 12px 16px; }
.gf-h { font-size: 12px; font-weight: 800; letter-spacing: 0.02em; color: var(--gf-text); }
.gf-sub { font-size: 11px; color: var(--gf-muted); font-weight: 600; }
.gf-eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gf-muted); margin: 22px 16px 10px;
}

/* Celda de dato */
.gf-cell {
  background: var(--gf-bg); border-radius: var(--gf-r-sm);
  padding: 9px 11px; min-width: 0;
}
.gf-cell__label {
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gf-primary);
}
.gf-cell__val {
  font-size: 13px; font-weight: 700; color: var(--gf-text); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gf-cellgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Lista con chevron */
.gf-list { background: var(--gf-card); border: 0.5px solid var(--gf-border); border-radius: var(--gf-r-md); overflow: hidden; }
.gf-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  position: relative; transition: background .12s;
}
.gf-row:active { background: var(--gf-bg); }
.gf-row + .gf-row::before {
  content: ''; position: absolute; top: 0; left: 50px; right: 0; height: 0.5px; background: var(--gf-border);
}
.gf-row__ico {
  width: 34px; height: 34px; border-radius: 9px; background: var(--gf-primary-soft);
  color: var(--gf-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gf-row__body { flex: 1; min-width: 0; }
.gf-row__title { font-size: 14px; font-weight: 700; color: var(--gf-text); }
.gf-row__sub { font-size: 11px; color: var(--gf-muted); font-weight: 600; margin-top: 1px; }
.gf-chev { color: var(--gf-muted); flex-shrink: 0; }

/* ============================================================
   Buttons
   ============================================================ */
.gf-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; border-radius: var(--gf-r-md); font-size: 15px; font-weight: 800;
  width: 100%; transition: transform .08s, filter .15s; letter-spacing: -0.01em;
}
.gf-btn:active { transform: scale(0.985); }
.gf-btn--primary { background: var(--gf-primary); color: #fff; }
.gf-btn--gold { background: var(--gf-primary); color: var(--gf-gold); }
.gf-btn--ghost { background: var(--gf-primary-soft); color: var(--gf-primary); }
.gf-btn--block-light { background: rgba(255,255,255,0.16); color: #fff; }

/* Inputs */
.gf-field { margin-bottom: 14px; }
.gf-label { font-size: 11px; font-weight: 700; color: var(--gf-muted); margin-bottom: 6px; display: block; }
.gf-input-wrap { position: relative; display: flex; align-items: center; }
.gf-input {
  width: 100%; height: 50px; border-radius: var(--gf-r-md); border: 1px solid var(--gf-border);
  background: var(--gf-bg); padding: 0 14px; font-size: 15px; font-weight: 600; color: var(--gf-text);
  outline: none; transition: border .15s, background .15s;
}
.gf-input:focus { border-color: var(--gf-primary); background: #fff; }
.gf-input::placeholder { color: var(--gf-muted); font-weight: 500; }
.gf-input--icon { padding-right: 46px; }
.gf-eye {
  position: absolute; right: 8px; width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--gf-muted);
}

/* ============================================================
   Badge cargo
   ============================================================ */
.gf-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px; padding: 5px 11px 5px 9px; color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: 0.01em;
}
.gf-badge svg { color: var(--gf-gold); }

.gf-pill {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 20px;
  padding: 4px 10px; font-size: 10px; font-weight: 800; letter-spacing: 0.02em;
}
.gf-pill--ok { background: var(--gf-green-soft); color: var(--gf-green); }
.gf-pill--wait { background: #FEF3DD; color: var(--gf-amber); }
.gf-pill--no { background: var(--gf-red-soft); color: var(--gf-red); }

/* ============================================================
   Hero (monedero / ficha)
   ============================================================ */
.gf-hero {
  background: var(--gf-primary); color: #fff; padding: 20px 18px 22px;
  position: relative;
}
.gf-coin {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center; color: var(--gf-gold);
  font-size: 26px; font-weight: 800; flex-shrink: 0;
}
.gf-balance { font-size: 32px; font-weight: 800; color: #fff; letter-spacing: -0.02em; line-height: 1; }
.gf-balance small { font-size: 15px; font-weight: 700; opacity: 0.8; }

/* Strip de acciones */
.gf-strip { display: flex; background: rgba(255,255,255,0.07); border-radius: var(--gf-r-md); overflow: hidden; }
.gf-strip__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 13px 4px; color: #fff; position: relative; transition: background .12s;
}
.gf-strip__item:active { background: rgba(255,255,255,0.08); }
.gf-strip__item + .gf-strip__item::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: rgba(255,255,255,0.1);
}
.gf-strip__lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.01em; }

/* ============================================================
   Acceso rápido grid 2×2
   ============================================================ */
.gf-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gf-quick__item {
  background: var(--gf-card); border: 0.5px solid var(--gf-border); border-radius: var(--gf-r-md);
  padding: 14px; display: flex; flex-direction: column; gap: 12px; transition: transform .08s;
  text-align: left;
}
.gf-quick__item:active { transform: scale(0.98); }
.gf-quick__ico {
  width: 38px; height: 38px; border-radius: 10px; background: var(--gf-primary-soft);
  color: var(--gf-primary); display: flex; align-items: center; justify-content: center;
}
.gf-quick__title { font-size: 14px; font-weight: 800; color: var(--gf-text); }
.gf-quick__sub { font-size: 11px; color: var(--gf-muted); font-weight: 600; }

/* ============================================================
   Feed / notificaciones
   ============================================================ */
.gf-feed__item { display: flex; gap: 11px; padding: 12px 14px; position: relative; }
.gf-feed__item + .gf-feed__item::before {
  content: ''; position: absolute; top: 0; left: 33px; right: 14px; height: 0.5px; background: var(--gf-border);
}
.gf-feed__dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.gf-feed__body { flex: 1; min-width: 0; }
.gf-feed__txt { font-size: 12px; font-weight: 600; color: var(--gf-text); line-height: 1.35; }
.gf-feed__time { font-size: 10px; color: var(--gf-muted); font-weight: 600; margin-top: 3px; }

/* ============================================================
   Acordeón ficha
   ============================================================ */
.gf-acc { background: var(--gf-card); border: 0.5px solid var(--gf-border); border-radius: var(--gf-r-md); overflow: hidden; }
.gf-acc__item + .gf-acc__item { border-top: 0.5px solid var(--gf-border); }
.gf-acc__head {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; width: 100%; text-align: left;
  transition: background .15s;
}
.gf-acc__head--open { background: var(--gf-primary-soft); }
.gf-acc__ico {
  width: 36px; height: 36px; border-radius: 9px; background: var(--gf-primary-soft); color: var(--gf-primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gf-acc__head--open .gf-acc__ico { background: var(--gf-primary); color: #fff; }
.gf-acc__titles { flex: 1; min-width: 0; }
.gf-acc__title { font-size: 13px; font-weight: 800; color: var(--gf-text); }
.gf-acc__preview { font-size: 10px; color: var(--gf-muted); font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-acc__chev { color: var(--gf-muted); transition: transform .25s; flex-shrink: 0; }
.gf-acc__chev--open { transform: rotate(180deg); color: var(--gf-primary); }
.gf-acc__panel { overflow: hidden; transition: height .28s ease; }
.gf-acc__inner { padding: 4px 14px 16px; }
.gf-ro { font-size: 9px; font-weight: 800; letter-spacing: 0.04em; color: var(--gf-muted); text-transform: uppercase; }

/* ============================================================
   Bottom navigation
   ============================================================ */
.gf-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 0.5px solid var(--gf-border);
  display: flex; padding-bottom: var(--gf-home-ind); height: calc(var(--gf-nav-h) + var(--gf-home-ind));
}
.gf-nav__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--gf-muted); padding-top: 9px; transition: color .15s;
}
.gf-nav__item--active { color: var(--gf-primary); }
.gf-nav__lbl { font-size: 9px; font-weight: 700; letter-spacing: 0.01em; }

/* ============================================================
   Toast
   ============================================================ */
.gf-toast-wrap {
  position: absolute; left: 0; right: 0; bottom: calc(var(--gf-nav-h) + var(--gf-home-ind) + 14px);
  display: flex; justify-content: center; z-index: 60; pointer-events: none;
}
.gf-toast {
  display: flex; align-items: center; gap: 10px; background: var(--gf-primary); color: #fff;
  padding: 12px 18px; border-radius: 12px; font-size: 13px; font-weight: 700;
  box-shadow: var(--gf-shadow-pop); animation: gf-toast-up .32s cubic-bezier(.2,.9,.3,1);
}
.gf-toast svg { color: var(--gf-gold); }
@keyframes gf-toast-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============================================================
   Bottom sheet
   ============================================================ */
.gf-sheet-scrim {
  position: absolute; inset: 0; background: rgba(13,42,80,0.42); z-index: 70;
  display: flex; align-items: flex-end; animation: gf-fade .2s ease;
}
@keyframes gf-fade { from { opacity: 0; } to { opacity: 1; } }
.gf-sheet {
  background: #fff; width: 100%; border-radius: 22px 22px 0 0; padding: 8px 18px calc(var(--gf-home-ind) + 18px);
  animation: gf-sheet-up .3s cubic-bezier(.2,.9,.3,1); max-height: 84%; overflow-y: auto;
}
@keyframes gf-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.gf-sheet__grab { width: 38px; height: 4px; border-radius: 2px; background: var(--gf-border); margin: 0 auto 14px; }
.gf-sheet__title { font-size: 17px; font-weight: 800; color: var(--gf-text); }

/* ============================================================
   Empty state
   ============================================================ */
.gf-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 36px; }
.gf-empty__ico {
  width: 64px; height: 64px; border-radius: 18px; background: var(--gf-primary-soft); color: var(--gf-primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.gf-empty__title { font-size: 15px; font-weight: 800; color: var(--gf-text); }
.gf-empty__sub { font-size: 12px; color: var(--gf-muted); font-weight: 600; margin-top: 5px; line-height: 1.4; }

/* Avatar */
.gf-avatar {
  border-radius: 50%; background: linear-gradient(135deg, #2f74c9, #0d3d7a); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0;
  object-fit: cover;
}
.gf-fadein {}
