:root{
  /* Permite controles del navegador en light/dark sin forzarlos a dark */
  color-scheme: light dark;

  /* ✅ TOKENS QUE FALTABAN (importante) */
  --bg: #d6dee1;
  --text: #0b1220;
  --btn: #0b5bd3;
  --btnText: #ffffff;

  /* Layout tokens */
  --max: 1180px;
  --r: 16px;
  --r2: 20px;

  /* Líneas y sombras para UI light */
  --line: rgba(11, 18, 32, .10);
  --line2: rgba(11, 18, 32, .14);
  --shadow: 0 18px 60px rgba(0,0,0,.12);
  --shadow2: 0 12px 28px rgba(0,0,0,.10);
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

a{ color:inherit; }
.wrap{ min-height:100vh; display:flex; flex-direction:column; }

/* =========================
   TOPBAR (NAV negro)
   ========================= */
.topbar{
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 16px;

  background:#0b0f16;                /* 👈 nav negro */
  border-bottom:1px solid rgba(255,255,255,.10);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  position: sticky;
  top: 0;
  z-index: 50;
}

/* Brand link (soporta logo + textos) */
.brand-link{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  font-weight:900;
  letter-spacing:.2px;
  color:#e7ecf3;
}
.brand-logo{
  height:74px;
  width:auto;
  max-width:240px;
  object-fit:contain;
  display:block;
  padding:12px 9px;
  border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  box-shadow: 0 14px 28px rgba(0,0,0,.28);
}
.brand-text{ display:flex; flex-direction:column; line-height:1.05; }
.brand-app{ font-size:18px; font-weight:950; color:#e7ecf3; letter-spacing:.2px; }
.brand-building{
  margin-top:4px;
  font-size:11px;
  font-weight:900;
  letter-spacing:.18em;
  text-transform:uppercase;
  color: rgba(231,236,243,.72);
}

.me{ font-weight:700; opacity:.92; color:#e7ecf3; }

/* ✅ Evitar conflicto: pill del TOPBAR solo aquí */
.topbar .pill{
  padding:4px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.12);
  color:#e7ecf3;
  opacity: 1;
}

/* =========================
   CONTENT (centrado + light)
   ========================= */
.content{
  flex:1;
  width:100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 18px 28px;
}

/* Card default: blanca y moderna */
.card{
  background: rgba(255,255,255,.86);
  border:1px solid var(--line);
  border-radius: var(--r2);
  padding: 16px;
  box-shadow: var(--shadow2);
  color: #0b1220;
}

/* Grid */
.grid{ display:grid; gap:14px; }
.grid-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 980px){ .grid-3{ grid-template-columns: 1fr; } }
@media (max-width: 820px){ .grid-2{ grid-template-columns: 1fr; } }

/* Forms */
label{ display:block; font-size:.9rem; opacity:.85; margin:10px 0 6px; color: #0b1220; }

input, select, textarea{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line2);
  background: rgba(255,255,255,.92);
  color: #0b1220;
  outline: none;
}
input::placeholder, textarea::placeholder{ color: rgba(11,18,32,.55); }
input:focus, select:focus, textarea:focus{
  border-color: rgba(124,58,237,.55);
  box-shadow: 0 0 0 4px rgba(124,58,237,.18);
}
textarea{ min-height: 110px; resize: vertical; }

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; padding:12px 14px; border-radius:12px; border:0; cursor:pointer;
  background:var(--btn); color:var(--btnText); font-weight:900; text-decoration:none;
  box-shadow: 0 12px 26px rgba(0,0,0,.12);
}
.btn:hover{ filter: brightness(.98); }
.btn-ghost{
  background: rgba(11, 18, 32, .06);
  color: #0b1220;
  border: 1px solid rgba(11, 18, 32, .12);
  box-shadow: none;
}
.btn-danger{ background:#e25146; color:#fff; }
.btn-ok{ background:#1f9d55; color:#fff; }
.btn-sm{ padding:8px 10px; border-radius:10px; font-size:.92rem; font-weight:900; }
.row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.right{ margin-left:auto; }

/* Alerts */
.alert{
  padding:12px 14px;
  border-radius:12px;
  background: rgba(255,255,255,.86);
  border:1px solid var(--line);
  color:#0b1220;
}
.alert.bad{ background: rgba(226,81,70,.12); border:1px solid rgba(226,81,70,.28); }
.alert.ok{ background: rgba(40,167,69,.12); border:1px solid rgba(40,167,69,.24); }

.small{ font-size:.92rem; opacity:.85; }
hr{ border:0; border-top:1px solid var(--line); margin:14px 0; }

/* Tables */
.table{ width:100%; border-collapse: collapse; }
.table th, .table td{
  padding:10px;
  border-bottom:1px solid var(--line);
  text-align:left; vertical-align:top;
  color:#0b1220;
}
.table th{ font-size:.92rem; opacity:.85; }

/* Badges */
.badge{
  display:inline-flex; padding:4px 10px; border-radius:999px;
  background: rgba(11,18,32,.06);
  border:1px solid rgba(11,18,32,.12);
  font-weight:900; font-size:.86rem;
  color:#0b1220;
}
.badge.ok{ background: rgba(40,167,69,.12); border:1px solid rgba(40,167,69,.24); }
.badge.bad{ background: rgba(226,81,70,.12); border:1px solid rgba(226,81,70,.28); }
.badge.warn{ background: rgba(255,193,7,.18); border:1px solid rgba(255,193,7,.28); }

/* =========================
   ===== KIOSK ===== (se queda dark)
   ========================= */
.kiosk{
  position:fixed; inset:0; background:#000; color:#fff; overflow:hidden;
}
.kiosk-logo{
  position:absolute; top:14px; left:14px; z-index:10;
  display:flex; align-items:center; gap:10px;
}
.kiosk-logo img{ height:46px; width:auto; border-radius:12px; background:rgba(255,255,255,.08); padding:6px; }
.kiosk-stage{ position:absolute; inset:0; }
.kiosk-media{ width:100%; height:100%; object-fit:cover; }
.kiosk-overlay{
  position:absolute; inset:0; display:none; padding:18px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
}
.kiosk-overlay.show{ display:block; }
.kiosk-card{
  max-width: 980px; margin: 70px auto 0; background: rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.18); border-radius:16px; padding:16px;
}
.kiosk-h1{ font-size: 1.55rem; font-weight:900; margin:0 0 10px; letter-spacing:.2px; }
.kiosk-grid{ display:grid; grid-template-columns: 170px 1fr; gap:14px; }
@media (max-width: 820px){ .kiosk-grid{ grid-template-columns: 1fr; } }
.kiosk-photo{ width:170px; height:170px; border-radius:16px; object-fit:cover; background:rgba(255,255,255,.08); }
.kiosk-actions{ margin-top:12px; display:flex; gap:10px; flex-wrap:wrap; }
.kiosk-actions .btn{ background:#fff; color:#000; }
.kiosk-log{ margin-top:12px; max-height: 240px; overflow:auto; background:rgba(0,0,0,.22); border:1px solid rgba(255,255,255,.14); border-radius:12px; padding:10px; }
.kiosk-log table{ color:#fff; }
.kiosk-log .table th, .kiosk-log .table td{ border-bottom:1px solid rgba(255,255,255,.12); padding:8px; color:#fff; }

/* =========================
   ===== LOGIN fullscreen video ===== (se queda dark)
   ========================= */
.login-page{
  min-height:100vh;
  margin:0;
  background:#000;
  color:#fff;
  overflow:hidden;
  position:relative;
}
.login-video{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  z-index:0;
  filter:saturate(1.05) contrast(1.05);
}
.login-shade{
  position:fixed;
  inset:0;
  z-index:1;
  /*background:
    radial-gradient(1200px 800px at 20% 20%, rgba(0,0,0,.35), rgba(0,0,0,.78)),
    linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.75));*/
}
.login-logo{
  position:fixed;
  top:14px;
  left:14px;
  z-index:2;
  display:flex;
  align-items:center;
  gap:10px;
}
.login-logo img{
  height:92px;
  width:auto;
  border-radius:18px;
  background:rgba(255,255,255,.10);
  padding:12px;
  border:1px solid rgba(255,255,255,.16);
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.login-logo-text{
  font-weight:900;
  letter-spacing:.2px;
  font-size:1.15rem;
  padding:14px 16px;
  border-radius:18px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
}
.login-center{
  position:relative;
  z-index:2;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
}
.login-card{
  width:min(520px, 100%);
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.18);
  color:#fff;
  box-shadow:0 30px 80px rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
}
.login-title{
  margin:0;
  font-weight:900;
  letter-spacing:.2px;
}
.login-sub{
  margin-top:6px;
  font-size:.95rem;
  opacity:.9;
}
.login-card input{
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.20);
  color:#fff;
}
.login-card input::placeholder{ color: rgba(255,255,255,.7); }
.login-card label{ opacity:.9; color:#fff; }
.login-card .btn{ background:#ffffff; color:#000; }
.login-card .btn:hover{ filter:brightness(.96); }
.login-card-logo{ display:flex; justify-content:center; margin-bottom:10px; }

@media (max-width: 480px){
  .login-logo img{ height:74px; padding:10px; }
  .brand-logo{ height:40px; }
}

/* =========================================================
   LEGACY DARK OVERRIDES (ADMIN)
   ========================================================= */
body.ui-light{
  background: var(--bg) !important;
  color: var(--text) !important;
}

.ui-light .dashboard-dark,
.ui-light .vp,
.ui-light .shell{
  background: transparent !important;
}

.ui-light .panel,
.ui-light .card,
.ui-light .kpi,
.ui-light .filters,
.ui-light .box,
.ui-light .wrap-card{
  background: rgba(255,255,255,.90) !important;
  border: 1px solid rgba(11,18,32,.10) !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.08) !important;
  color: #0b1220 !important;
}

.ui-light h1, .ui-light h2, .ui-light h3, .ui-light h4,
.ui-light .h1, .ui-light .h2, .ui-light .h3{
  color: #0b1220 !important;
}
.ui-light .small,
.ui-light .sub,
.ui-light .muted{
  color: rgba(11,18,32,.72) !important;
}

.ui-light input,
.ui-light select,
.ui-light textarea{
  background: rgba(255,255,255,.92) !important;
  border-color: rgba(11,18,32,.14) !important;
  color: #0b1220 !important;
}
.ui-light input::placeholder,
.ui-light textarea::placeholder{
  color: rgba(11,18,32,.55) !important;
}

.ui-light .table,
.ui-light table{
  color: #0b1220 !important;
}
.ui-light .table th,
.ui-light .table td,
.ui-light table th,
.ui-light table td{
  border-bottom: 1px solid rgba(11,18,32,.10) !important;
  color: #0b1220 !important;
}

.ui-light .btn-ghost,
.ui-light .btn.ghost{
  background: rgba(11,18,32,.06) !important;
  border: 1px solid rgba(11,18,32,.12) !important;
  color: #0b1220 !important;
  box-shadow: none !important;
}

.ui-light .badge{
  background: rgba(11,18,32,.06) !important;
  border: 1px solid rgba(11,18,32,.12) !important;
  color: #0b1220 !important;
}

/* ===== FIX overflow tablas en tarjetas ===== */
.card{ overflow: hidden; } /* evita que elementos se salgan del borde */

.table-wrap{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
}

.table{ width: 100%; }

.users-table{
  min-width: 860px;
  table-layout: fixed;
}
.users-table th,
.users-table td{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.users-table th:nth-child(4),
.users-table td:nth-child(4){
  white-space: normal;
  word-break: break-word;
}
.users-table th:last-child,
.users-table td:last-child{
  text-align: right;
}

/* =========================
   ✅ FIX: Rol / Activo en TABLAS (pill)
   ========================= */
.card .pill,
.table .pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 10px;
  border-radius:999px;
  font-weight:800;
  font-size:.78rem;
  letter-spacing:.2px;
  line-height:1;
  opacity:1 !important;
  background: rgba(0,0,0,.06);
  border:1px solid rgba(0,0,0,.14);
  color: rgba(0,0,0,.82);
}

.card .pill.ok,
.table .pill.ok{
  background: rgba(22,163,74,.12);
  border-color: rgba(22,163,74,.28);
  color: rgba(22,163,74,.95);
}
.card .pill.bad,
.table .pill.bad{
  background: rgba(220,38,38,.12);
  border-color: rgba(220,38,38,.28);
  color: rgba(220,38,38,.95);
}

.table td .pill{ opacity:1 !important; }

/* =========================================================
   ✅ HARD FIX: si algún JS/CSS oculta filas, aquí NO se ocultan
   (esto evita el “tabla sin resultados” aunque rows existan)
   ========================================================= */
.card table tbody,
.card .table tbody{
  display: table-row-group !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.card table tbody tr,
.card .table tbody tr{
  display: table-row !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
}
.card table td, .card table th,
.card .table td, .card .table th{
  display: table-cell !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.card table[hidden],
.card table tbody[hidden],
.card table tr[hidden]{
  display: table !important;
}
.card .btn, .card button, .card a{
  pointer-events: auto !important;
}
