/* ============================================================
   QINI · Dashboard de Soporte — Estilos
   ============================================================ */

:root {
  --brand:        #2563eb;
  --brand-dark:   #1d4ed8;
  --brand-soft:   #eff6ff;
  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --border:       #e6ebf2;
  --line-soft:    #eef2f6;
  --text:         #0f172a;
  --text-soft:    #64748b;
  --text-mute:    #94a3b8;

  --amber:        #f59e0b;
  --amber-soft:   #fef9c3;
  --green:        #16a34a;
  --green-soft:   #dcfce7;
  --slate:        #94a3b8;
  --slate-soft:   #f1f5f9;
  --red:          #dc2626;
  --red-soft:     #fee2e2;

  --shadow-sm:    0 1px 2px rgba(15,23,42,.05);
  --shadow-md:    0 8px 24px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
  --radius:       14px;
  --radius-sm:    10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px; height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, #4f46e5 100%);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.brand-sub  { font-size: 12px; color: var(--text-mute); margin-top: -2px; }

.topbar-status {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-soft);
  background: var(--bg); padding: 7px 14px; border-radius: 20px;
  border: 1px solid var(--border);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px var(--green-soft);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .5; }
}

/* ── Controles de formulario (casillas) ──────────────────── */
.sel {
  font-family: inherit; font-size: 13px; color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.sel:hover { border-color: #cbd5e1; }
.sel:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
select.sel {
  appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer;
  padding-right: 34px;
  background-repeat: no-repeat; background-position: right 11px center; background-size: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
.modal-body .sel { width: 100%; }

/* ── Login ────────────────────────────────────────────────── */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-md);
  padding: 32px 28px; display: flex; flex-direction: column; gap: 14px;
}
.login-logo {
  width: 52px; height: 52px; border-radius: 13px; align-self: center;
  background: linear-gradient(135deg, var(--brand) 0%, #4f46e5 100%);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px;
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.login-title { text-align: center; font-size: 19px; font-weight: 700; margin-top: 4px; }
.login-sub { text-align: center; font-size: 13px; color: var(--text-soft); margin-bottom: 8px; }
.login-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.login-label input { padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; font-weight: 400; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.login-label input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.login-error { background: var(--red-soft); color: #b91c1c; font-size: 13px; padding: 9px 12px; border-radius: 9px; text-align: center; }
.login-btn { width: 100%; padding: 12px; font-size: 14.5px; margin-top: 4px; }

/* ── Layout con sidebar ───────────────────────────────────── */
.layout { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 236px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 18px 14px;
}
.side-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.side-empresa { padding: 0 4px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.side-empresa label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-mute); margin-bottom: 6px; }
.side-empresa .sel { width: 100%; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-group {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-mute); padding: 14px 12px 5px;
}
.nav-group:first-child { padding-top: 4px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px; width: 100%;
  border: none; background: none; cursor: pointer; text-align: left;
  padding: 11px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600; font-family: inherit; color: var(--text-soft);
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); }
.nav-item.active::before { content: ""; position: absolute; left: 2px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-ico i, .nav-ico svg { color: currentColor; }
.nav-ico { display: inline-flex; align-items: center; }
.nav-ico svg { width: 18px; height: 18px; }
.nav-logout { margin-top: 14px; text-decoration: none; color: var(--red); }
.nav-logout:hover { background: var(--red-soft); color: #b91c1c; }

/* ── Íconos Lucide ────────────────────────────────────────── */
.card-head .icon svg { width: 18px; height: 18px; vertical-align: -3px; }
.alert-ico svg { width: 17px; height: 17px; vertical-align: -3px; }
.stat-icon svg { width: 23px; height: 23px; }
.stat.nuevo    .stat-icon { color: var(--amber); }
.stat.atendido .stat-icon { color: var(--green); }
.stat.escalado .stat-icon { color: var(--red); }
.stat.tiempo   .stat-icon { color: var(--brand); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-title { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }

.content { max-width: none; margin: 0 auto; padding: 24px 28px; width: 100%; }
.tab-panel[hidden] { display: none; }

@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: auto; height: auto; position: static;
    flex-direction: row; align-items: center; overflow-x: auto; gap: 6px; padding: 10px 14px;
  }
  .side-brand { border: none; margin: 0; padding: 0 12px 0 4px; flex-shrink: 0; }
  .side-empresa { border: none; padding: 0 8px 0 0; margin: 0; flex-shrink: 0; }
  .side-empresa label { display: none; }
  .nav { flex-direction: row; }
  .nav-group { display: none; }
  .nav-item { white-space: nowrap; }
}

/* ── Stats ────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 620px) { .stats { grid-template-columns: repeat(2,1fr); } }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 14px;
  transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(15,23,42,.05); }
.stat.nuevo     .stat-icon { background: var(--amber-soft); }
.stat.atendido  .stat-icon { background: var(--green-soft); }
.stat.escalado  .stat-icon { background: var(--red-soft); }
.stat.tiempo    .stat-icon { background: var(--brand-soft); }
.stat-num { font-size: 26px; font-weight: 800; line-height: 1.05; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat.nuevo     .stat-num { color: var(--amber); }
.stat.atendido  .stat-num { color: var(--green); }
.stat.escalado  .stat-num { color: var(--red); }
.stat.tiempo    .stat-num { color: var(--brand); }
.stat-label { font-size: 12.5px; color: var(--text-soft); margin-top: 4px; }

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-head .icon { font-size: 16px; }

.btn-ghost {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); padding: 7px 13px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--bg); border-color: #cbd5e1; }

/* ── Barra de filtros ─────────────────────────────────────── */
.filtros {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.f-input {
  flex: 1; min-width: 200px; padding: 10px 13px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.f-input:hover { border-color: #cbd5e1; }
.f-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.f-count { font-size: 12px; color: var(--text-mute); margin-left: auto; }

/* ── Filas clicables + detalle ────────────────────────────── */
tbody tr.clic { cursor: pointer; }
.det-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.det-row:last-child { border-bottom: none; }
.det-row .k { color: var(--text-soft); font-weight: 600; flex-shrink: 0; }
.det-row .v { text-align: right; }
.det-block { margin-top: 12px; }
.det-block .k { font-size: 13px; color: var(--text-soft); font-weight: 600; margin-bottom: 5px; }
.det-block .box { background: var(--bg); border-radius: 9px; padding: 11px 13px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }

/* Ficha del equipo (inventario): tarjetas en 2 columnas, con aire para que no
   se vea apretado como casilleros. Una sola columna en pantallas angostas. */
.ficha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ficha-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .ficha-grid { grid-template-columns: 1fr; } }
.ficha-sec { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.ficha-sec-t { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-mute); margin-bottom: 10px; }
.ficha-kv { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.ficha-kv:last-child { border-bottom: none; }
.ficha-kv .k { color: var(--text-soft); min-width: 130px; flex-shrink: 0; }
.ficha-kv .v { font-weight: 600; color: var(--text); word-break: break-word; }
.ficha-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.ficha-foot { font-size: 11.5px; color: var(--text-mute); margin-top: 4px; }

/* ── Tabla ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 12px 16px; background: #f8fafc;
  color: var(--text-mute); font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid #f3f6fa; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fbfcfe; }

.folio { font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 12px; color: var(--brand-dark); font-weight: 600; }
.cliente-nombre { font-weight: 600; }
.cliente-contacto { font-size: 11.5px; color: var(--text-mute); margin-top: 1px; }

.badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.badge-whatsapp { background: var(--green-soft); color: #15803d; border: 1px solid #bbf7d0; }
.badge-email    { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #bfdbfe; }
.badge-presencial { background: #ccfbf1; color: #0f766e; border: 1px solid #99f6e4; }

.detalle { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.fecha { font-size: 11.5px; color: var(--text-mute); white-space: nowrap; }

.estado-select {
  font-size: 11px; padding: 4px 26px 4px 11px; border-radius: 20px;
  font-weight: 600; cursor: pointer; border: none; appearance: none;
  background-repeat: no-repeat; background-position: right 8px center; background-size: 9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%23555' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
}
.estado-en_proceso { background-color: var(--amber-soft); color: #a16207; box-shadow: inset 0 0 0 1px #fde68a; }
.estado-en_atencion { background-color: #dbeafe; color: #1e40af; box-shadow: inset 0 0 0 1px #bfdbfe; }
.estado-resuelto   { background-color: var(--green-soft); color: #15803d; box-shadow: inset 0 0 0 1px #bbf7d0; }
.estado-escalado   { background-color: var(--red-soft); color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.badge-tipo { background: var(--slate-soft); color: #475569; border: 1px solid #e2e8f0; }

.badge-warn { background: var(--amber-soft); color: #b45309; }
.badge-danger { background: var(--red-soft); color: #b91c1c; }
tr.row-warn td { background: #fffbeb; }
tr.row-danger td { background: #fef2f2; }

/* ── Alerta de números sin asignar ────────────────────────── */
.alert-warn {
  display: flex; align-items: center; gap: 11px;
  background: var(--amber-soft); border: 1px solid #fcd34d; color: #92400e;
  padding: 12px 16px; border-radius: 12px; margin-bottom: 16px;
  font-size: 13.5px; font-weight: 500;
}
.alert-warn[hidden] { display: none; }
.alert-ico { font-size: 17px; line-height: 1; }

.asign-hint { padding: 12px 18px; font-size: 12.5px; color: var(--text-soft); background: var(--bg); border-bottom: 1px solid var(--border); }

.empty { text-align: center; padding: 48px 20px; color: var(--text-mute); font-size: 13.5px; }
.empty .emoji { display: block; margin: 0 auto 12px; line-height: 0; color: var(--text-mute); opacity: .55; }
.empty .emoji svg { width: 38px; height: 38px; }

/* ── Chat ─────────────────────────────────────────────────── */
.chat { display: flex; flex-direction: column; height: 540px; }
.chat-stream {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, #fbfcfe 0%, var(--surface) 100%);
}
.bubble { max-width: 84%; padding: 11px 15px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bubble.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.bubble.bot  { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; box-shadow: var(--shadow-sm); }
.bubble.bot .who { font-size: 11px; font-weight: 700; color: var(--brand); margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.bubble.sys { align-self: center; background: var(--amber-soft); color: #92400e; font-size: 11.5px; padding: 7px 14px; border-radius: 20px; text-align: center; }

.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-mute); margin: 0 1px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

.chat-foot { border-top: 1px solid var(--border); padding: 14px; display: flex; flex-direction: column; gap: 9px; background: var(--surface); }
.chat-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.chat-meta input { padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 12.5px; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.chat-send { display: flex; gap: 9px; }
.chat-send input { flex: 1; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.chat-meta input:focus, .chat-send input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.btn-send { background: var(--brand); color: #fff; border: none; padding: 11px 20px; border-radius: 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-send:hover { background: var(--brand-dark); }
.btn-send:disabled { opacity: .5; cursor: not-allowed; }

/* ── Formularios admin (sedes / asignaciones) ─────────────── */
.card-body { padding: 16px 18px; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.form-row input, .form-row .sel {
  flex: 1; min-width: 110px; padding: 10px 13px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus, .form-row .sel:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-row .btn-send { flex: 0 0 auto; padding: 10px 18px; border-radius: 10px; }
.btn-del { background: none; border: none; color: var(--red); cursor: pointer; font-size: 13px; padding: 4px 8px; border-radius: 6px; }
.btn-del:hover { background: #fef2f2; }
.btn-edit { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 13px; padding: 4px 8px; border-radius: 6px; margin-right: 4px; }
.btn-edit:hover { background: #eff6ff; }
.sede-tag { font-family: monospace; font-size: 12px; color: var(--brand-dark); font-weight: 600; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fade .15s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 460px;
  box-shadow: 0 24px 60px rgba(15,23,42,.18), 0 8px 20px rgba(15,23,42,.08); animation: rise .2s ease;
  max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.modal-close { display: grid; place-items: center; width: 30px; height: 30px; background: none; border: none; font-size: 17px; color: var(--text-mute); cursor: pointer; line-height: 1; border-radius: 8px; transition: background .15s, color .15s; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.modal-body label { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text); }
/* Todos los campos de un modal comparten el MISMO estilo: input, select y
   textarea. Antes solo el <input> se veía bien; los <select>/<textarea> salían
   con el estilo por defecto del navegador. */
.modal-body label input,
.modal-body label select,
.modal-body label textarea,
.modal-body select,
.modal-body textarea {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; font-weight: 400; color: var(--text);
  background-color: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.modal-body label input:hover,
.modal-body label select:hover,
.modal-body label textarea:hover,
.modal-body select:hover,
.modal-body textarea:hover { border-color: #cbd5e1; }
.modal-body label input:focus,
.modal-body label select:focus,
.modal-body label textarea:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.modal-body textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
/* Flecha propia para los <select> (en vez de la fea del navegador). */
.modal-body select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer;
  padding-right: 34px; background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
.modal-body .req { color: var(--red); }
.modal-body .modal-hint { font-weight: 400; }
/* Filas de campos en paralelo dentro de un modal: alinea etiquetas y campos. */
.modal-body .campos-2 { display: flex; gap: 12px; }
.modal-body .campos-2 > * { flex: 1; min-width: 0; }
.modal-hint { font-size: 12px; color: var(--text-mute); margin: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 15px 24px; border-top: 1px solid var(--border); background: #fcfdfe; }
.modal-foot .btn-ghost { padding: 11px 18px; }
.modal-foot .btn-send { padding: 11px 20px; border-radius: 9px; }
.modal-foot-spacer { flex: 1; }

/* ── Modal: estado y acciones de persona ────────────────────── */
.modal { position: relative; }

.btn-danger {
  border: 1px solid var(--red); background: var(--surface); color: var(--red);
  padding: 10px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s;
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  padding: 8px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn-toggle:hover { background: var(--bg); border-color: #cbd5e1; }
.btn-toggle.alta { border-color: var(--green); color: var(--green); }
.btn-toggle.alta:hover { background: var(--green-soft); }

.estado-box { background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; }
.estado-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.estado-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-mute); margin-bottom: 6px; }
.estado-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 20px; background: var(--green-soft); color: var(--green); }
.estado-badge.baja { background: var(--red-soft); color: var(--red); }
.estado-hint { font-size: 11.5px; color: var(--text-mute); margin: 11px 0 0; line-height: 1.45; }

.modal-confirm {
  position: absolute; inset: 0; z-index: 5; border-radius: 14px;
  background: rgba(15,23,42,.4);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fade .12s ease;
}
.modal-confirm[hidden] { display: none; }
.modal-confirm-card {
  background: var(--surface); border-radius: 12px; padding: 22px 20px;
  max-width: 360px; text-align: center; box-shadow: var(--shadow-md);
}
.modal-confirm-card p { font-size: 13.5px; color: var(--text); line-height: 1.55; margin: 0 0 16px; }
.modal-confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* Estado de persona en la tabla */
.row-baja { opacity: .5; }
.pill-baja { font-size: 11px; font-weight: 600; color: var(--red); background: var(--red-soft); border-radius: 10px; padding: 1px 8px; margin-left: 6px; }

/* Código de invitado */
.codigo-big { font-size: 42px; font-weight: 800; letter-spacing: 10px; color: var(--brand); padding: 12px 8px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

/* ── Mini-stats del reporte ───────────────────────────────── */
.rep-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 620px) { .rep-stats { grid-template-columns: repeat(2,1fr); } }
.rep-stat { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.rep-stat .n { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.rep-stat .l { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

.rep-charts { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 18px; }
@media (max-width: 700px) { .rep-charts { grid-template-columns: 1fr; } }
.chart-box { background: var(--bg); border-radius: 10px; padding: 14px; height: 260px; }
.rep-tablas { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
@media (max-width: 700px) { .rep-tablas { grid-template-columns: 1fr; } }
