/* ============================================================
   PASSER — Design System
   Sistema visual unificado para el panel web,
   derivado de la identidad de la app móvil.
   Adaptado para convivir con Bootstrap 5 (modales, alerts, forms).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800&family=Chakra+Petch:wght@500;600;700&display=swap');

:root {
  /* ---- Marca / Azul índigo (muestreado de la app) ---- */
  --blue-50:  #EEF1FE;
  --blue-100: #DFE4FD;
  --blue-200: #C2CBFB;
  --blue-300: #9DA9F6;
  --blue-400: #6675EE;
  --blue-500: #3A49E6;   /* hero / pantallas vivas */
  --blue-600: #2E3DD6;   /* PRIMARIO */
  --blue-700: #2632B4;   /* hover */
  --blue-800: #1F2890;   /* texto sobre claro / active */

  /* ---- Neutros (azul-gris frío, como la app) ---- */
  --ink:      #0F1320;   /* títulos */
  --slate-800:#1B2130;
  --slate-700:#333B4C;   /* cuerpo */
  --slate-500:#69728A;   /* secundario / muted */
  --slate-400:#98A0B3;   /* placeholder / iconos apagados */
  --line:     #E6EAF2;   /* bordes */
  --line-2:   #EEF1F7;   /* divisores suaves */
  --surface:  #FFFFFF;
  --surface-2:#F6F8FC;   /* relleno sutil */
  --bg:       #ECEFF6;   /* fondo de página */

  /* ---- Estados ---- */
  --green-600:#2E9E5B; --green-700:#23814A; --green-50:#E5F5EC;
  --red-600:  #E04444; --red-700:#C5333A;   --red-50:#FCEBEC;
  --amber-600:#D9871F; --amber-50:#FBF0DF;

  /* ---- Radios ---- */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl:26px;
  --r-pill:999px;

  /* ---- Sombras (suaves, tipo app) ---- */
  --sh-xs: 0 1px 2px rgba(16,20,40,.05);
  --sh-sm: 0 1px 2px rgba(16,20,40,.04), 0 2px 6px rgba(20,28,60,.05);
  --sh:    0 2px 8px rgba(20,28,60,.05), 0 10px 28px rgba(20,28,60,.06);
  --sh-lg: 0 18px 44px rgba(18,26,60,.16);
  --sh-blue:0 10px 22px rgba(46,61,214,.30);

  /* ---- Tipografía ---- */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-brand: 'Chakra Petch', 'Plus Jakarta Sans', sans-serif;
}

/* ============================================================
   Base
   ============================================================ */
*,*::before,*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--slate-700);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,h2,h3,h4 { color: var(--ink); margin: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
a { color: var(--blue-600); text-decoration: none; }

/* ---- Wordmark ---- */
.brand {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
  text-transform: lowercase;
  display: inline-flex;
  align-items: center;
  gap: .5ch;
}
.brand .dot { color: var(--blue-600); }
.brand--blue { color: var(--blue-600); }
.brand--white { color: #fff; }

/* ============================================================
   Tipografía: escala
   ============================================================ */
.t-display { font-size: 40px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1.05; }
.t-h1 { font-size: 30px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); }
.t-h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.t-h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.t-body { font-size: 15px; font-weight: 500; color: var(--slate-700); line-height: 1.55; }
.t-sm { font-size: 13px; font-weight: 500; color: var(--slate-500); }
.t-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--slate-400);
}

/* ============================================================
   Botones
   ============================================================ */
.btn {
  --bh: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: var(--bh); padding: 0 18px;
  font-family: var(--font); font-size: 14.5px; font-weight: 700; letter-spacing: -.01em;
  border-radius: var(--r); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; user-select: none;
  text-transform: none;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .08s ease, color .16s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary, .btn-primary { background: var(--blue-600); color: #fff; box-shadow: var(--sh-blue); }
.btn--primary:hover, .btn-primary:hover { background: var(--blue-700); color: #fff; }

.btn--secondary, .btn-secondary, .btn-default, .btn-outline-primary, .btn-outline-secondary {
  background: var(--surface); color: var(--slate-700); border-color: var(--line); box-shadow: var(--sh-xs);
}
.btn--secondary:hover, .btn-secondary:hover, .btn-default:hover, .btn-outline-primary:hover, .btn-outline-secondary:hover {
  background: var(--surface-2); border-color: #D7DCE8; color: var(--ink);
}

.btn--soft { background: var(--blue-50); color: var(--blue-700); }
.btn--soft:hover { background: var(--blue-100); color: var(--blue-800); }

.btn--ghost { background: transparent; color: var(--slate-500); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn--danger, .btn-danger { background: var(--red-600); color: #fff; box-shadow: 0 8px 18px rgba(224,68,68,.28); }
.btn--danger:hover, .btn-danger:hover { background: var(--red-700); color: #fff; }

.btn--danger-soft { background: var(--red-50); color: var(--red-700); }
.btn--danger-soft:hover { background: #FBDDDE; }

.btn--success, .btn-success { background: var(--green-600); color: #fff; box-shadow: 0 8px 18px rgba(46,158,91,.26); }
.btn--success:hover, .btn-success:hover { background: var(--green-700); color: #fff; }

/* Otros colores legados unificados al sistema azul */
.btn-warning, .btn-info { background: var(--blue-50); color: var(--blue-700); border-color: transparent; }
.btn-warning:hover, .btn-info:hover { background: var(--blue-100); color: var(--blue-800); }

.btn--sm, .btn-sm, .btn-xs { --bh: 36px; height: var(--bh); padding: 0 13px; font-size: 13px; border-radius: var(--r-sm); }
.btn--sm svg, .btn-sm svg, .btn-xs svg { width: 16px; height: 16px; }
.btn--lg, .btn-lg { --bh: 52px; height: var(--bh); padding: 0 24px; font-size: 15.5px; border-radius: var(--r-lg); }
.btn--block { width: 100%; }
.btn--pill { border-radius: var(--r-pill); }

/* Botón-icono cuadrado (acciones de tabla) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--slate-500);
  cursor: pointer; box-shadow: var(--sh-xs);
  transition: background .16s, color .16s, border-color .16s, transform .08s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: #D7DCE8; }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg, .icon-btn i { width: 17px; height: 17px; font-size: 17px; }
.icon-btn--primary { background: var(--blue-50); color: var(--blue-600); border-color: transparent; }
.icon-btn--primary:hover { background: var(--blue-100); color: var(--blue-700); }
.icon-btn--danger { background: var(--red-50); color: var(--red-600); border-color: transparent; }
.icon-btn--danger:hover { background: #FBDDDE; color: var(--red-700); }

/* ============================================================
   Formularios
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-size: 13px; font-weight: 600; color: var(--slate-700); letter-spacing: -.01em;
}
.field .hint { font-size: 12.5px; color: var(--slate-400); }

.input, .select, .textarea,
.form-control, .form-select {
  width: 100%; height: 48px; padding: 0 15px;
  font-family: var(--font); font-size: 14.5px; font-weight: 500; color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r);
  transition: border-color .16s, background .16s, box-shadow .16s;
  outline: none;
}
.textarea, textarea.form-control { height: auto; padding: 13px 15px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder, .form-control::placeholder { color: var(--slate-400); font-weight: 500; }
.input:focus, .select:focus, .textarea:focus,
.form-control:focus, .form-select:focus {
  border-color: var(--blue-500); background: #fff;
  box-shadow: 0 0 0 4px rgba(58,73,230,.13);
}
.select, .form-select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2369728A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px;
}

/* Input con icono al frente (como la app) */
.input-icon { position: relative; }
.input-icon > svg, .input-icon > [data-icon] { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--slate-400); pointer-events: none; display: inline-flex; }
.input-icon > [data-icon] svg { width: 19px; height: 19px; }
.input-icon .input, .input-icon .form-control { padding-left: 44px; }

/* Filepicker */
.filepick {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--surface-2);
}
.filepick .btn { flex: none; }
.filepick .fname { font-size: 13px; color: var(--slate-400); }

/* Checkbox */
.check { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--slate-700); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 21px; height: 21px; border-radius: 7px; border: 2px solid #CBD2E0; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  transition: background .14s, border-color .14s;
}
.check .box svg { width: 13px; height: 13px; color: #fff; opacity: 0; transform: scale(.6); transition: .14s; }
.check input:checked + .box { background: var(--blue-600); border-color: var(--blue-600); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px rgba(58,73,230,.15); }

/* ============================================================
   Badges / pills / estados
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--blue   { background: var(--blue-50);  color: var(--blue-700); }
.badge--green  { background: var(--green-50); color: var(--green-700); }
.badge--red    { background: var(--red-50);   color: var(--red-700); }
.badge--amber  { background: var(--amber-50); color: var(--amber-600); }
.badge--neutral{ background: var(--surface-2);color: var(--slate-500); border: 1px solid var(--line); }
.badge--count  { background: var(--blue-600); color: #fff; }
/* Compat con badges Bootstrap existentes */
.badge.bg-primary { background: var(--blue-600) !important; color: #fff; }
.badge.bg-success { background: var(--green-50) !important; color: var(--green-700); }
.badge.bg-danger  { background: var(--red-50) !important;   color: var(--red-700); }

/* Pastilla de conteo numérica (Historial) */
.count-pill { display:inline-flex; align-items:center; height:28px; padding:0 12px; border-radius:var(--r-pill); background:var(--blue-600); color:#fff; font-weight:800; font-size:12px; letter-spacing:.04em; }

/* ============================================================
   Tarjetas
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--sh-sm);
}
.card-pad { padding: 22px 24px; }
.card-head, .card .card-header {
  padding: 18px 24px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: transparent; border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.card .card-footer { background: transparent; border-top: 1px solid var(--line-2); }

/* Stat card (dashboard) */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 20px 22px; box-shadow: var(--sh-sm);
  display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden;
}
.stat .stat-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat .stat-label { font-size: 14px; font-weight: 600; color: var(--slate-500); }
.stat .stat-num { font-size: 38px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1.05; margin-top: 2px; }
.stat .stat-sub { font-size: 12.5px; color: var(--slate-400); margin-top: 6px; max-width: 80%; }
.stat .stat-ic {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #fff; background: var(--blue-600);
  box-shadow: var(--sh-blue);
}
.stat .stat-ic svg, .stat .stat-ic [data-icon] svg { width: 22px; height: 22px; }
.stat .stat-ic img { width: 22px; height: 22px; filter: brightness(0) invert(1); }

/* ============================================================
   Tabla
   ============================================================ */
.table-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl thead th {
  text-align: left; padding: 13px 18px;
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--slate-400);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl tbody td { padding: 15px 18px; border-bottom: 1px solid var(--line-2); font-size: 14px; color: var(--slate-700); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
.cell-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Identidad usuario en celda */
.u-cell { display: flex; align-items: center; gap: 13px; }
.u-avatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; background: var(--blue-100); display: grid; place-items: center; color: var(--blue-600); font-weight: 700; overflow: hidden; }
.u-avatar img { width: 100%; height: 100%; object-fit: cover; }
.u-name { font-weight: 700; color: var(--ink); font-size: 14.5px; line-height: 1.2; }
.u-mail { font-size: 12.5px; color: var(--slate-400); margin-top: 2px; }

/* ============================================================
   Layout: app shell (sidebar + main)
   ============================================================ */
.app { display: flex; min-height: 100vh; }

.psr-sidebar {
  position: sticky; top: 0; height: 100vh; width: 266px; flex: none;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px;
  z-index: 30;
}
.psr-sidebar .brand-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px 24px; }
.psr-sidebar .brand-row .mark { width: 34px; height: 34px; border-radius: 11px; background: var(--blue-600); display: grid; place-items: center; color: #fff; box-shadow: var(--sh-blue); }
.psr-sidebar .brand-row .mark svg { width: 19px; height: 19px; }
.psr-sidebar .brand-row .brand { font-size: 21px; }
.psr-sidebar .nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.psr-sidebar .nav-cap { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-400); padding: 12px 14px 6px; }

.psr-sidebar .nav-item {
  display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 14px; border-radius: var(--r);
  font-size: 14.5px; font-weight: 600; color: var(--slate-500); cursor: pointer;
  transition: background .14s, color .14s; position: relative;
}
.psr-sidebar .nav-item svg, .psr-sidebar .nav-item [data-icon] { width: 19px; height: 19px; flex: none; display: inline-flex; }
.psr-sidebar .nav-item [data-icon] svg { width: 19px; height: 19px; }
.psr-sidebar .nav-item:hover { background: var(--surface-2); color: var(--ink); }
.psr-sidebar .nav-item.active { background: var(--blue-600); color: #fff; box-shadow: var(--sh-blue); }
.psr-sidebar .nav-item.active:hover { background: var(--blue-600); color: #fff; }

.psr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.psr-topbar { height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 40px; position: sticky; top: 0; background: rgba(236,239,246,.82); backdrop-filter: blur(10px); z-index: 20; }
.psr-content { padding: 4px 40px 64px; width: 100%; flex: 1; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 6px 0 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; }
.page-head .breadcrumb { margin-top: 7px; }

.acct-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--slate-500); display: grid; place-items: center; cursor: pointer; }
.acct-btn svg, .acct-btn [data-icon] svg { width: 21px; height: 21px; }

.psr-footer { padding: 18px 40px; text-align: center; font-size: 12.5px; color: var(--slate-400); }
.psr-footer a { font-weight: 700; }

@media (max-width: 860px) {
  .psr-sidebar { position: fixed; left: -280px; transition: left .2s ease; box-shadow: var(--sh-lg); }
  .psr-sidebar.open { left: 0; }
  .psr-topbar { justify-content: space-between; }
}

/* Grids de página */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
@media (max-width: 1100px){ .stat-grid{ grid-template-columns: repeat(2,1fr);} .two-col{ grid-template-columns:1fr; } }
@media (max-width: 640px){ .stat-grid{ grid-template-columns: 1fr;} }

.form-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px 20px; }
.form-grid .col-2 { grid-column: span 2; }
@media (max-width: 900px){ .form-grid{ grid-template-columns:1fr; } .form-grid .col-2{ grid-column:span 1; } }

.split { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
@media (max-width: 980px){ .split{ grid-template-columns:1fr; } }

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   Navegación / misc
   ============================================================ */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--slate-400); font-weight: 600; background: transparent; margin: 0; padding: 0; }
.breadcrumb .sep { color: var(--slate-400); }
.breadcrumb .cur { color: var(--slate-700); }
.breadcrumb a { color: var(--slate-400); }
.breadcrumb a:hover { color: var(--blue-600); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--slate-400); }

.section-title {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 800; color: var(--blue-600); letter-spacing: -.01em;
}
.section-title [data-icon] { display: inline-flex; width: 18px; height: 18px; }
.section-title [data-icon] svg { width: 18px; height: 18px; }

/* Segmented tabs (como la app) */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px; gap: 4px; box-shadow: var(--sh-xs); }
.seg button, .seg a {
  border: none; background: transparent; cursor: pointer;
  height: 36px; padding: 0 18px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center;
  font-family: var(--font); font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--slate-500);
  transition: background .15s, color .15s;
}
.seg button.active, .seg a.active { background: var(--blue-600); color: #fff; }

/* Pagination */
.pager { display: flex; align-items: center; gap: 6px; }
.pager button, .pager a {
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--slate-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); font-weight: 700; font-size: 13.5px; cursor: pointer; transition: .14s;
}
.pager button:hover:not(.active), .pager a:hover:not(.active) { background: var(--surface-2); }
.pager button.active, .pager a.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.pager button.muted, .pager a.muted { color: var(--slate-400); font-weight: 600; }

/* ============================================================
   Modal — estiliza el modal de BOOTSTRAP para verse como el diseño
   (estructura .modal > .modal-dialog > .modal-content intacta,
    el JS de Bootstrap sigue funcionando)
   ============================================================ */
.modal { backdrop-filter: none; }
.modal-backdrop.show { opacity: .46; background: #101428; }
.modal-content {
  background: var(--surface); border: none; border-radius: var(--r-2xl); box-shadow: var(--sh-lg);
  overflow: hidden;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--line-2); }
.modal-header .modal-title { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; border-top: none; }
.modal .btn-close, .modal .x {
  width: 36px; height: 36px; border-radius: 10px; border: none; background: var(--surface-2);
  color: var(--slate-500); cursor: pointer; display: grid; place-items: center; transition: .14s;
  opacity: 1; padding: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2369728A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
  background-color: var(--surface-2); background-repeat: no-repeat; background-position: center; background-size: 18px;
}
.modal .btn-close:hover { background-color: var(--red-50); }

/* ============================================================
   Alerts (flash) — compat Bootstrap
   ============================================================ */
.alert { border: none; border-radius: var(--r-lg); padding: 14px 18px; font-size: 14px; font-weight: 600; }
.alert-success { background: var(--green-50); color: var(--green-700); }
.alert-danger  { background: var(--red-50);   color: var(--red-700); }
.alert-warning { background: var(--amber-50); color: var(--amber-600); }
.alert-info    { background: var(--blue-50);  color: var(--blue-700); }

/* ============================================================
   Componentes de pantalla (Historial / Fraccionamientos / Llaves)
   ============================================================ */
/* chips multiselect */
.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; min-height: 48px; padding: 8px 12px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: var(--r-pill); background: var(--blue-600); color: #fff; font-size: 12.5px; font-weight: 700; }
.chip button { width: 19px; height: 19px; border: none; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; cursor: pointer; display: grid; place-items: center; }
.chip button svg { width: 11px; height: 11px; }
.chips input { border: none; background: transparent; outline: none; flex: 1; min-width: 120px; height: 30px; font-family: var(--font); font-size: 14px; color: var(--ink); }

/* historial: lista de personas */
.people { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; padding-right: 4px; }
.person { text-align: left; cursor: pointer; padding: 15px 16px; border-radius: var(--r-lg); border: 1.5px solid var(--line); background: var(--surface); transition: .15s; width: 100%; font-family: var(--font); }
.person:hover { border-color: var(--blue-300); }
.person.active { background: var(--blue-600); border-color: var(--blue-600); box-shadow: var(--sh-blue); }
.person.active .pname, .person.active .pphone, .person.active .pcount { color: #fff; }
.person.active .pcount { opacity: .85; }
.pname { font-weight: 700; color: var(--ink); font-size: 15px; }
.pphone { color: var(--slate-500); font-size: 13.5px; margin-top: 1px; font-family: var(--font-brand); letter-spacing: .02em; }
.pcount { color: var(--slate-400); font-size: 12.5px; margin-top: 9px; }

/* accordion */
.acc { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 12px; background: var(--surface); }
.acc-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; }
.acc-head .ttl { font-weight: 700; color: var(--ink); font-size: 15.5px; flex: 1; }
.acc-head .chev { color: var(--slate-400); transition: transform .2s; display: inline-flex; }
.acc-head .chev svg { width: 18px; height: 18px; }
.acc.open .acc-head .chev { transform: rotate(90deg); }
.acc-body { display: none; padding: 0 18px 18px; }
.acc.open .acc-body { display: block; }
.log { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.log .lt { color: var(--slate-400); font-family: var(--font-brand); width: 150px; flex: none; }
.log .lg { color: var(--slate-700); flex: 1; }

/* fraccionamiento list */
.fracc-list { display: flex; flex-direction: column; gap: 12px; }
.fracc-card { position: relative; height: 102px; border-radius: var(--r-lg); overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: .15s; }
.fracc-card .ph { position: absolute; inset: 0; background-image: repeating-linear-gradient(45deg,#c7cedb 0 11px,#d4dae6 11px 22px); background-size: cover; background-position: center; }
.fracc-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.fracc-card .ov { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,19,32,.15), rgba(15,19,32,.78)); }
.fracc-card .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 13px 15px; color: #fff; }
.fracc-card .fn { font-weight: 800; font-size: 15.5px; letter-spacing: -.01em; }
.fracc-card .fa { font-size: 11.5px; opacity: .85; margin-top: 2px; line-height: 1.35; }
.fracc-card.active { border-color: var(--blue-600); box-shadow: var(--sh-blue); }
.fracc-card .tag { position: absolute; top: 10px; left: 11px; font-size: 9px; font-weight: 800; letter-spacing: .14em; color: rgba(255,255,255,.8); background: rgba(0,0,0,.25); padding: 3px 7px; border-radius: 5px; }

/* key user card (modal usuarios añadidos) */
.keyuser { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.keyuser .kh { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.keyuser .kactions { display: flex; gap: 8px; }
.keyuser .ic-sq { width: 40px; height: 40px; border-radius: 11px; border: none; display: grid; place-items: center; cursor: pointer; color: #fff; }
.keyuser .ic-sq svg { width: 18px; height: 18px; }
.keyuser .kgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.keyuser .kgrid .kl { font-size: 12.5px; color: var(--slate-400); }
.keyuser .kgrid .kv { font-size: 14.5px; color: var(--ink); font-weight: 700; margin-top: 2px; }

/* Avatar circular (chip de listas/llaves) */
.chip-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.chip-ic--blue { background: var(--blue-50); color: var(--blue-600); }
.chip-ic--green { background: var(--green-50); color: var(--green-700); }
.chip-ic--red { background: var(--red-50); color: var(--red-600); }

.divider { height: 1px; background: var(--line-2); border: none; margin: 0; }

/* ============================================================
   DataTables — controles alineados al design system
   ============================================================ */
.dataTables_wrapper { padding: 0 24px 18px; }
.dataTables_filter label, .dataTables_length label {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--slate-500); padding: 12px 0;
}
.dataTables_filter input, .dataTables_length select {
  display: inline-block; width: auto; margin: 0;
  height: 40px; padding: 0 12px;
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 10px;
  font-family: var(--font); font-size: 13.5px; color: var(--ink); outline: none;
}
.dataTables_filter input:focus { border-color: var(--blue-500); background: #fff; box-shadow: 0 0 0 4px rgba(58,73,230,.13); }
.dataTables_info { font-size: 13px; color: var(--slate-500); padding-top: 14px; background: transparent; }
.dataTables_paginate { display: flex; gap: 6px; justify-content: flex-end; padding-top: 10px; flex-wrap: wrap; }
.dataTables_paginate .button.primary_button a,
.dataTables_paginate a.paginate_button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--slate-700) !important;
  font-weight: 700; font-size: 13.5px; cursor: pointer; transition: .14s;
}
.dataTables_paginate .button.primary_button a:hover,
.dataTables_paginate a.paginate_button:hover { background: var(--surface-2); border: 1px solid var(--line); }
.dataTables_paginate .button.primary_button.active a,
.dataTables_paginate a.paginate_button.current {
  background: var(--blue-600) !important; border-color: var(--blue-600); color: #fff !important;
}
.dataTables_paginate .button.primary_button.disabled a,
.dataTables_paginate a.paginate_button.disabled { color: var(--slate-400) !important; cursor: default; }
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after { opacity: .35; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 60px; text-align: center; }
.empty-state .chip-ic { width: 56px; height: 56px; border-radius: 16px; }
.empty-state .chip-ic [data-icon] { display: inline-flex; width: 26px; height: 26px; }
.empty-state .chip-ic [data-icon] svg { width: 26px; height: 26px; }

/* ============================================================
   Select2 — alineado al design system (global)
   ============================================================ */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  min-height: 48px;
  padding: 6px 10px;
  font-family: var(--font);
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.select2-container--default .select2-selection--single {
  display: flex; align-items: center; padding: 0 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--ink); font-weight: 500; font-size: 14.5px; line-height: normal; padding: 0;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; right: 10px; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--slate-400); }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
  border-color: var(--blue-500);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(58,73,230,.13);
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: var(--blue-600);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12.5px;
  font-weight: 700;
  margin: 4px 4px 0 0;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: rgba(255,255,255,.8); margin-right: 6px; font-weight: 700; border: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: #fff; background: transparent; }
.select2-container--default .select2-selection--multiple .select2-selection__placeholder { color: var(--slate-400); }
.select2-dropdown {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--sh-lg);
  font-family: var(--font);
  overflow: hidden;
}
.select2-container--default .select2-results__option { font-size: 14px; color: var(--slate-700); }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--blue-600); color: #fff; }
.select2-search--dropdown .select2-search__field {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font);
  outline: none;
}

/* ============================================================
   Login (página completa)
   ============================================================ */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.login-card { width: 100%; max-width: 420px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 26px; }
.login-brand .mark { width: 42px; height: 42px; border-radius: 13px; background: var(--blue-600); display: grid; place-items: center; color: #fff; box-shadow: var(--sh-blue); }
.login-brand .mark svg { width: 23px; height: 23px; }
.login-brand .brand { font-size: 27px; }
.login-help { font-size: 13px; color: var(--slate-400); }
.field-error { font-size: 12.5px; color: var(--red-600); font-weight: 600; }
