/* ============================================================
   Cajero de Operadores — Sistema de diseño "Trust & Authority"
   Navy + azul corporativo. Fuentes Lexend / Source Sans 3.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Marca GMG: negro + dorado (+ rojo) */
  --primary: #1C1813;
  --primary-700: #2A241C;
  --secondary: #3A332A;
  --accent: #936E00;        /* dorado profundo: texto/links/folio sobre blanco (AA) */
  --accent-600: #B5890A;
  --accent-700: #7A5C00;
  --gold: #F2C200;          /* dorado de marca: botones/acentos */
  --gold-soft: #FFD23F;
  --ink: #14110A;           /* negro cálido: marco/encabezados */
  --gmg-red: #D81E2C;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --fg: #020617;
  --muted: #E8ECF1;
  --muted-fg: #64748B;
  --border: #E2E8F0;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --success: #16A34A;
  --success-bg: #F0FDF4;
  --warning: #B45309;
  --warning-bg: #FFFBEB;
  --info: #0369A1;
  --info-bg: #EFF6FF;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow: 0 4px 12px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.18);
  --font-head: 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;

  /* Marco/cajero (negro de marca + dorado) */
  --bbva-navy: #16120B;
  --bbva-navy-2: #241D12;
  --bbva-blue: #F2C200;     /* acento del cajero = dorado */
  --bbva-blue-2: #FFD23F;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; color: var(--primary); }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.tabular { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 1px solid transparent;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 15px;
  transition: background .18s ease, box-shadow .18s ease, opacity .18s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid rgba(3,105,161,.45); outline-offset: 2px; }
.btn-primary { background: var(--gold); color: #1A1410; }
.btn-primary:hover { background: #D9AE00; }
.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: var(--primary-700); }
.btn-ghost { background: transparent; color: var(--secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803D; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Inputs ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; color: var(--secondary); margin-bottom: 6px; }
.field .req { color: var(--danger); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font-family: inherit; font-size: 15px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--fg); transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(3,105,161,.15);
}
.help { font-size: 13px; color: var(--muted-fg); margin-top: 5px; }

/* ---------- Login cajero (estilo BBVA / ATM) ---------- */
.atm {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 600px at 50% -10%, rgba(242,194,0,.22), transparent 60%),
    linear-gradient(180deg, #1B160D 0%, #0B0905 100%);
}
.atm-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border-radius: 18px; box-shadow: 0 24px 60px rgba(2,10,28,.55);
  padding: 30px 28px 26px; animation: cardup .35s ease;
}
@keyframes cardup { from { transform: translateY(12px); opacity: 0; } }
.atm-logo { display: flex; justify-content: center; margin-bottom: 6px; }
.atm-logo img { height: 52px; width: auto; object-fit: contain; }
.atm-welcome { text-align: center; color: var(--muted-fg); font-size: 14px; margin-bottom: 22px; }
.atm-welcome b { display: block; color: var(--primary); font-size: 19px; font-weight: 600; margin-bottom: 2px; letter-spacing: -.01em; }

.atm-label { font-size: 13px; font-weight: 600; color: var(--secondary); margin-bottom: 7px; display: block; }
.atm-input {
  height: 50px; font-size: 16px; letter-spacing: .01em; border-radius: 12px;
  border: 1.5px solid var(--border); background: #F8FAFC;
}
.atm-input:focus { background: #fff; border-color: var(--bbva-blue); box-shadow: 0 0 0 4px rgba(20,100,165,.14); }

/* Display del PIN (puntos) */
.pin-dots { display: flex; justify-content: center; gap: 13px; margin: 6px 0 16px; }
.pin-dots .dot {
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid #CBD5E1;
  transition: background .15s, border-color .15s, transform .15s;
}
.pin-dots .dot.on { background: var(--bbva-blue); border-color: var(--bbva-blue); transform: scale(1.05); }
.pin-dots.err .dot { border-color: var(--danger); animation: shake .35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

/* Teclado numérico cajero */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.key {
  height: 60px; border-radius: 14px; border: 1.5px solid var(--border); background: #fff;
  font-family: var(--font-head); font-size: 24px; font-weight: 500; color: var(--primary);
  display: grid; place-items: center; transition: transform .08s ease, background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.key:hover { background: #F1F5F9; border-color: #CBD5E1; }
.key:active { transform: scale(.95); background: #E8EEF6; }
.key.fn { font-size: 15px; font-weight: 600; color: var(--accent); background: #F8FAFC; }
.key.fn svg { width: 24px; height: 24px; }
.key.ok { background: var(--gold); color: #1A1410; border-color: var(--gold); }
.key.ok:hover { background: #D9AE00; }
.key:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.atm-foot { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.link-google { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; padding: 6px; }
.link-google:hover { text-decoration: underline; }
.link-google svg { width: 17px; height: 17px; }
.atm-secure { display: flex; align-items: center; gap: 6px; color: #94A3B8; font-size: 12px; }
.atm-secure svg { width: 14px; height: 14px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted-fg); font-size: 13px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.alert {
  padding: 11px 13px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px;
  display: flex; gap: 9px; align-items: flex-start;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #FCA5A5; }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid #BFDBFE; }

/* ---------- Kiosko / Cajero (marco tipo ATM) ---------- */
.kiosk {
  min-height: 100dvh; padding: 26px; display: grid; place-items: center;
  background:
    radial-gradient(1200px 700px at 50% -15%, rgba(242,194,0,.18), transparent 60%),
    linear-gradient(180deg, #1B160D 0%, #0B0905 100%);
}
.kiosk-screen {
  width: 100%; max-width: 1040px; min-height: min(86dvh, 760px);
  background: #F1F0EC; border-radius: 22px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 70px rgba(2,10,28,.6), 0 0 0 6px rgba(255,255,255,.04), 0 0 0 14px rgba(7,33,70,.5);
}
.kiosk-top {
  background: linear-gradient(100deg, var(--bbva-navy), var(--bbva-navy-2));
  color: #fff; padding: 16px 26px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.kt-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kt-brand img { height: 40px; width: auto; }
.kt-brand b { font-size: 15px; font-weight: 600; display: block; line-height: 1.15; white-space: nowrap; }
.kt-brand span { font-size: 12.5px; color: var(--gold); letter-spacing: .02em; }
.kt-user { display: flex; align-items: center; gap: 20px; }
.kt-clock { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: #C9BCA0; line-height: 1.3; }
.kt-clock b { display: block; color: #fff; font-size: 16px; font-weight: 600; }
.kt-who { display: flex; align-items: center; gap: 10px; }
.kt-who .avatar { width: 38px; height: 38px; font-size: 15px; background: var(--gold); color: #1A1410; }
.kt-who b { font-size: 14px; color: #fff; display: block; white-space: nowrap; }
.kt-who span { font-size: 12px; color: #C9BCA0; text-transform: capitalize; }
.kt-bell { position: relative; background: rgba(255,255,255,.07); border: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.kt-bell:hover { background: rgba(255,255,255,.14); }
.kt-bell svg { width: 19px; height: 19px; }
.kt-bell .bell-count {
  position: absolute; top: -4px; right: -4px; background: var(--gmg-red); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; display: grid; place-items: center; line-height: 1;
}

/* ---------- Panel de notificaciones ---------- */
.notif-item { padding: 12px 4px; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--muted); }
.notif-item.unread::before { content: ""; position: absolute; left: -10px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notif-tit { font-weight: 600; font-size: 14.5px; }
.notif-cuerpo { font-size: 13.5px; color: var(--secondary); margin-top: 2px; }
.notif-when { font-size: 12px; color: var(--muted-fg); margin-top: 4px; }

.kiosk-body { flex: 1; overflow: auto; padding: 30px 34px; }
.kiosk-bottom {
  background: #fff; border-top: 1px solid var(--border); padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.kiosk-bottom .btn-back { background: #fff; color: var(--bbva-navy); border-color: var(--border); font-weight: 600; }
.kiosk-bottom .btn-back:hover { background: var(--muted); }
.kiosk-bottom .btn-exit { background: #fff; color: var(--danger); border-color: #FCA5A5; }
.kiosk-bottom .btn-exit:hover { background: var(--danger-bg); }
.kiosk-bottom .atm-secure { color: var(--muted-fg); }

@media (max-width: 720px) {
  .kiosk { padding: 0; }
  .kiosk-screen { max-width: none; min-height: 100dvh; border-radius: 0; box-shadow: none; }
  .kiosk-body { padding: 20px 16px; }
  .kt-brand b, .kt-clock { display: none; }
}

/* ---------- Avatar (usado en header del kiosko) ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); flex-shrink: 0;
}

/* ---------- Cards / stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 22px; }
.stat { padding: 18px 20px; }
.stat .label { font-size: 13px; color: var(--muted-fg); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-family: var(--font-head); font-size: 30px; font-weight: 700; color: var(--primary); margin-top: 4px; }
.stat .value.accent { color: var(--accent); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.section-head h3 { font-size: 18px; }

/* ---------- Menú principal (cajero) ---------- */
.menu-wrap { min-height: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; }
.menu-hero { text-align: center; margin-bottom: 26px; }
.menu-hero h1 { font-size: 27px; letter-spacing: -.01em; }
.menu-hero p { color: var(--muted-fg); font-size: 15px; margin-top: 3px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.tile {
  position: relative; text-align: left; cursor: pointer; overflow: hidden;
  border-radius: 16px; padding: 22px 24px; min-height: 152px; color: var(--primary);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 4px 14px rgba(20,18,12,.07);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--gold); }
.tile:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(20,18,12,.16); border-color: var(--gold); }
.tile:active { transform: translateY(0) scale(.99); }
.tile:focus-visible { outline: 3px solid rgba(242,194,0,.85); outline-offset: 3px; }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile .tile-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--gold); color: #1A1410; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(242,194,0,.45); }
.tile .tile-ico svg { width: 27px; height: 27px; }
.tile .tile-num { font-family: var(--font-head); font-size: 30px; font-weight: 700; color: #D7DBE0; line-height: 1; }
.tile .tile-txt h4 { color: var(--primary); font-size: 19px; margin-bottom: 3px; }
.tile .tile-txt p { color: var(--muted-fg); font-size: 13.5px; line-height: 1.4; }
.tile .badge-count { position: absolute; top: 16px; left: 60px; background: var(--gmg-red); color: #fff; font-weight: 700; font-size: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.2); }

/* Acción principal: fondo dorado suave para resaltar sin gritar */
.tile.primary { background: linear-gradient(160deg, #FFF8E2 0%, #FDEFC0 100%); border-color: var(--gold); }
.tile.primary::before { width: 5px; }

/* ---------- Tabla ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data th, table.data td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
table.data th { background: #F1F5F9; color: var(--secondary); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #F8FAFC; cursor: pointer; }
table.data .folio { font-family: var(--font-head); font-weight: 600; color: var(--accent); white-space: nowrap; }

/* ---------- Badges de estado ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-nuevo { background: var(--info-bg); color: #1D4ED8; }
.st-en_proceso { background: var(--warning-bg); color: var(--warning); }
.st-en_espera { background: #F1F5F9; color: var(--secondary); }
.st-resuelto { background: #ECFEFF; color: #0E7490; }
.st-cerrado { background: var(--success-bg); color: var(--success); }
.st-reabierto { background: var(--danger-bg); color: var(--danger); }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(2,6,23,.55); display: grid; place-items: center; padding: 20px; z-index: 100; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90dvh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }
.icon-btn { background: transparent; border: none; padding: 6px; border-radius: 6px; color: var(--muted-fg); display: grid; place-items: center; }
.icon-btn:hover { background: var(--muted); color: var(--fg); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Detalle ticket / timeline ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 18px 28px; margin: 6px 0 14px; }
.meta-row .item .k { font-size: 12px; color: var(--muted-fg); text-transform: uppercase; font-weight: 600; }
.meta-row .item .v { font-size: 15px; font-weight: 500; }
.timeline { list-style: none; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li { position: relative; padding: 0 0 16px 20px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.timeline .t-detalle { font-weight: 500; }
.timeline .t-meta { font-size: 13px; color: var(--muted-fg); }
.msg { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface); }
.msg .who { font-weight: 600; font-size: 14px; }
.msg .when { font-size: 12px; color: var(--muted-fg); }

/* ---------- Empty / loading ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted-fg); }
.empty svg { width: 46px; height: 46px; opacity: .4; margin-bottom: 12px; }
.skeleton { background: linear-gradient(90deg, #EEF2F6 25%, #F8FAFC 50%, #EEF2F6 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--primary); color: #fff; padding: 13px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-weight: 500; font-size: 14px; display: flex; gap: 9px; align-items: center; animation: slidein .25s ease; max-width: 340px; }
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
.toast svg { width: 18px; height: 18px; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 11px 16px; font-weight: 600; color: var(--muted-fg); border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select { width: auto; min-width: 150px; }
.check-inline { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--secondary); cursor: pointer; user-select: none; }
.check-inline input { width: 18px; height: 18px; accent-color: var(--gold); cursor: pointer; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .menu-grid { grid-template-columns: 1fr; }
  .tile { min-height: auto; padding: 18px 20px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .meta-row { gap: 14px 20px; }
}

/* ---------- Encuesta de estrellas (confirmación de ticket) ---------- */
.encuesta-item { margin-bottom: 18px; }
.encuesta-item:last-child { margin-bottom: 0; }
.encuesta-item .k { font-weight: 600; font-size: 14px; color: var(--secondary); margin-bottom: 8px; }
.stars { display: flex; gap: 6px; }
.stars button { background: none; border: none; padding: 2px; cursor: pointer; color: var(--border); line-height: 1; }
.stars button svg { width: 28px; height: 28px; }
.stars button.on { color: var(--gold); }
.stars button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
