/* ==========================================================================
   Valtek Optima — Design System v6
   Minimal · futurista · dos módulos: Aseo y Personal / Seguridad y Acceso
   ========================================================================== */

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

:root {
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #05070b;
  --bg2: #090c12;
  --surface: #0b0e15;
  --surface-2: #10141d;
  --surface-3: #161b26;
  --card: rgba(255, 255, 255, 0.022);
  --card-hover: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.13);
  --border-glow: rgba(110, 139, 255, 0.45);

  --primary: #6e8bff;
  --primary-dark: #5672f2;
  --primary-soft: rgba(110, 139, 255, 0.12);
  --accent: #46dcff;

  --clean: #2fd39a;
  --process: #f5b544;
  --dirty: #ff5d6c;

  --text: #e9ecf2;
  --text-dim: #a2a9b6;
  --text-muted: #6a7382;

  --p1: #46b8ff; --p2: #2fd39a; --p3: #b39cff; --common: #ff9a52;
  --gold: #e9c46a;

  /* Colores de módulo */
  --mod-clean: #2fd39a;
  --mod-access: #9d8cff;
  --mod-admin: #e9c46a;

  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(110, 139, 255, 0.35), 0 10px 30px rgba(110, 139, 255, 0.16);
  --radius: 14px;
  --radius-sm: 9px;

  --sidebar-w: 260px;
  --topbar-h: 64px;
  --site-header-h: 68px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { cursor: pointer; border: none; font-family: var(--font-body); color: inherit; background: none; }
input, select, textarea { font-family: var(--font-body); }
a { text-decoration: none; color: inherit; }
strong { font-weight: 600; color: var(--text); }
::selection { background: rgba(110, 139, 255, 0.35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* ==========================================================================
   SHELL — header público, sidebar y topbar de la aplicación
   ========================================================================== */

/* ---- Header público (landing) ---- */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--site-header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(5, 7, 11, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
#site-header.scrolled { border-bottom-color: var(--border); background: rgba(5, 7, 11, 0.88); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--text); }
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand small { font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; margin-left: 2px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { padding: 8px 14px; border-radius: 8px; font-size: 0.86rem; color: var(--text-dim); transition: color .2s, background .2s; }
.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.site-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 960px) { .site-nav { display: none; } }
.brand { white-space: nowrap; }
@media (max-width: 640px) {
  #site-header { padding: 0 14px; }
  .site-actions { gap: 6px; }
  .site-actions .btn { padding: 7px 11px; font-size: 0.8rem; }
}
@media (max-width: 420px) { .site-actions .btn-primary { display: none; } }

body.in-app #site-header { display: none; }

/* ---- Sidebar ---- */
#app-sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 950;
  width: var(--sidebar-w);
  display: none; flex-direction: column;
  background: linear-gradient(180deg, #080a10 0%, #06080c 100%);
  border-right: 1px solid var(--border);
}
body.in-app #app-sidebar { display: flex; }
.sb-brand { height: var(--topbar-h); display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--border); }
.sb-org { margin: 14px 14px 6px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); }
.sb-org-label { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.sb-org-name { font-size: 0.84rem; font-weight: 600; color: var(--text); margin-top: 3px; line-height: 1.3; }
.sb-org-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.sb-group { margin-top: 16px; }
.sb-group-title {
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px 8px; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted);
}
.sb-group-title i { width: 6px; height: 6px; border-radius: 2px; background: var(--text-muted); display: inline-block; }
.sb-group[data-mod="clean"] .sb-group-title i { background: var(--mod-clean); box-shadow: 0 0 10px var(--mod-clean); }
.sb-group[data-mod="access"] .sb-group-title i { background: var(--mod-access); box-shadow: 0 0 10px var(--mod-access); }
.sb-group[data-mod="admin"] .sb-group-title i { background: var(--mod-admin); }
.sb-item {
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; margin: 1px 0; border-radius: 9px;
  font-size: 0.86rem; font-weight: 500; color: var(--text-dim); text-align: left;
  transition: background .15s, color .15s;
  position: relative;
}
.sb-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; }
.sb-item:hover { background: rgba(255, 255, 255, 0.035); color: var(--text); }
.sb-item.active { background: rgba(255, 255, 255, 0.055); color: #fff; }
.sb-item.active svg { opacity: 1; }
.sb-item.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--primary); }
.sb-group[data-mod="clean"] .sb-item.active::before { background: var(--mod-clean); }
.sb-group[data-mod="access"] .sb-item.active::before { background: var(--mod-access); }
.sb-group[data-mod="admin"] .sb-item.active::before { background: var(--mod-admin); }
.sb-item .sb-badge { margin-left: auto; font-family: var(--font-mono); font-size: 0.66rem; padding: 1px 7px; border-radius: 99px; background: rgba(245, 181, 68, 0.14); color: var(--process); }
.sb-footer { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name { font-size: 0.84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: 0.72rem; color: var(--text-muted); }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim); border: 1px solid var(--border); transition: all .15s; flex-shrink: 0; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---- Topbar ---- */
#app-topbar {
  position: fixed; top: 0; right: 0; left: var(--sidebar-w); z-index: 900;
  height: var(--topbar-h);
  display: none; align-items: center; gap: 16px;
  padding: 0 32px;
  background: rgba(5, 7, 11, 0.78);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
body.in-app #app-topbar { display: flex; }
.tb-menu { display: none; }
.tb-titles { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.tb-module {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--text-dim);
}
.tb-module i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.tb-module[data-mod="clean"] { color: var(--mod-clean); border-color: rgba(47, 211, 154, 0.25); background: rgba(47, 211, 154, 0.06); }
.tb-module[data-mod="clean"] i { background: var(--mod-clean); }
.tb-module[data-mod="access"] { color: var(--mod-access); border-color: rgba(157, 140, 255, 0.28); background: rgba(157, 140, 255, 0.07); }
.tb-module[data-mod="access"] i { background: var(--mod-access); }
.tb-module[data-mod="admin"] { color: var(--mod-admin); border-color: rgba(233, 196, 106, 0.25); background: rgba(233, 196, 106, 0.06); }
.tb-module[data-mod="admin"] i { background: var(--mod-admin); }
.tb-title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.tb-clock { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-dim); text-align: right; line-height: 1.3; }
.tb-clock span { display: block; color: var(--text-muted); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; color: var(--clean); padding: 5px 10px; border-radius: 99px; border: 1px solid rgba(47, 211, 154, 0.25); background: rgba(47, 211, 154, 0.06); }
.live-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--clean); box-shadow: 0 0 8px var(--clean); animation: blink 1.6s infinite; }

#sb-overlay { display: none; }

@media (max-width: 960px) {
  #app-sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  body.sb-open #app-sidebar { transform: translateX(0); }
  body.sb-open #sb-overlay { display: block; position: fixed; inset: 0; z-index: 940; background: rgba(0,0,0,.55); }
  #app-topbar { left: 0; padding: 0 16px; }
  .tb-menu { display: inline-flex; }
  .tb-sub, .tb-clock, .tb-module { display: none; }
}

/* ==========================================================================
   VISTAS
   ========================================================================== */
.app-view { display: none; min-height: 100vh; }
.app-view.active { display: block; }
body.in-app .app-view { margin-left: var(--sidebar-w); padding-top: var(--topbar-h); }
@media (max-width: 960px) { body.in-app .app-view { margin-left: 0; } }

.page, .jefe-body, .sa-body, .prov-body, .port-container {
  max-width: 1280px; margin: 0 auto; padding: 28px 32px 64px;
}
@media (max-width: 700px) {
  .page, .jefe-body, .sa-body, .prov-body, .port-container { padding: 20px 16px 48px; }
}

/* Los encabezados internos antiguos se reemplazan por la topbar */
.jefe-header, .sa-header, .port-tabs, .prov-header .sa-header-top { display: none !important; }

/* Sub-navegación segmentada (portal proveedor) */
.prov-header { max-width: 1280px; margin: 0 auto; padding: 24px 32px 0; border: none; background: none; }
.prov-tabs, .seg-tabs {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px;
  background: var(--card); border: 1px solid var(--border); overflow-x: auto; max-width: 100%;
}
.prov-tab, .seg-tab {
  padding: 7px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 500; color: var(--text-dim); white-space: nowrap;
  border: none; background: transparent; transition: all .15s;
}
.prov-tab:hover:not(.active), .seg-tab:hover:not(.active) { color: var(--text); }
.prov-tab.active, .seg-tab.active { background: rgba(255, 255, 255, 0.07); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset; }
.prov-body { padding-top: 20px; }

.sa-tab-content, .jefe-tab-content, .prov-tab-content, .port-tab-panel { display: none; }
.sa-tab-content.active, .jefe-tab-content.active, .prov-tab-content.active, .port-tab-panel.active { display: block; animation: viewIn .28s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   COMPONENTES COMPARTIDOS
   ========================================================================== */

/* ---- Tarjetas ---- */
.j-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.j-card-title {
  font-family: var(--font-display); font-size: 0.98rem; font-weight: 600; letter-spacing: -0.005em;
  margin-bottom: 18px; color: var(--text);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.j-card-title svg { flex-shrink: 0; }
.card-hint { font-size: 0.82rem; color: var(--text-muted); margin: -10px 0 18px; line-height: 1.55; }
.j-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.j-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 992px) { .j-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .j-grid-2 { grid-template-columns: 1fr; } }

/* ---- Formularios ---- */
.f-group, .form-group { margin-bottom: 14px; }
.f-label, .form-label {
  display: block; margin-bottom: 6px;
  font-size: 0.74rem; font-weight: 500; color: var(--text-dim); letter-spacing: 0.01em;
}
.f-input, .form-input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
  color: var(--text); font-size: 0.88rem; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.f-input::placeholder, .form-input::placeholder { color: #4d5563; }
.f-input:hover, .form-input:hover { border-color: var(--border-strong); }
.f-input:focus, .form-input:focus { border-color: rgba(110, 139, 255, 0.6); box-shadow: 0 0 0 3px rgba(110, 139, 255, 0.14); background: rgba(255, 255, 255, 0.045); }
.form-input { padding: 12px 14px; font-size: 0.92rem; }
textarea.f-input { resize: vertical; min-height: 84px; line-height: 1.5; }
input[type="date"].f-input, input[type="time"].f-input { color-scheme: dark; }
.f-select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a2a9b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.f-select option { background: var(--surface-2); color: var(--text); }
.phone-input-wrapper { display: flex; align-items: center; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: var(--radius-sm); padding-left: 12px; width: 100%; transition: all .15s; }
.phone-input-wrapper:focus-within { border-color: rgba(110, 139, 255, 0.6); box-shadow: 0 0 0 3px rgba(110, 139, 255, 0.14); }
.flex-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.flex-row .f-group { flex: 1; min-width: 130px; margin-bottom: 0; }
.error-msg { color: var(--dirty); font-size: 0.8rem; margin-top: 6px; display: none; }
.error-msg.show { display: block; }

/* ---- Botones ---- */
.btn, .btn-sm, .btn-gold-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 0.83rem; font-weight: 500; line-height: 1.2; white-space: nowrap;
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.03); color: var(--text);
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn:hover, .btn-sm:hover, .btn-gold-sm:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.2); }
.btn:active, .btn-sm:active { transform: translateY(1px); }
.btn svg, .btn-sm svg { width: 15px; height: 15px; }

/* Acción principal */
.btn-primary, .btn-green, .btn-hero-primary, .nav-btn-primary, .btn-port-search {
  background: linear-gradient(180deg, #7f98ff 0%, #5d79f4 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 6px 20px rgba(93, 121, 244, 0.25);
}
.btn-primary:hover, .btn-green:hover, .btn-hero-primary:hover, .nav-btn-primary:hover, .btn-port-search:hover {
  filter: brightness(1.08); box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 8px 28px rgba(93, 121, 244, 0.35);
}
/* Secundarias */
.btn-blue { background: var(--primary-soft); color: #b7c5ff; border-color: rgba(110, 139, 255, 0.28); }
.btn-blue:hover { background: rgba(110, 139, 255, 0.2); border-color: rgba(110, 139, 255, 0.45); }
.btn-red { background: rgba(255, 93, 108, 0.08); color: #ff8a95; border-color: rgba(255, 93, 108, 0.22); }
.btn-red:hover { background: rgba(255, 93, 108, 0.15); border-color: rgba(255, 93, 108, 0.4); }
.btn-gold-sm { color: var(--text); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn-lg { padding: 13px 22px; font-size: 0.94rem; border-radius: 11px; }
.btn-full { width: 100%; padding: 12px; border-radius: 11px; font-size: 0.92rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* ---- Tablas ---- */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.84rem; }
.data-table th {
  padding: 10px 14px; text-align: left; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border); background: transparent;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); color: var(--text-dim); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover td { background: rgba(255, 255, 255, 0.018); }
.empty-row td { text-align: center; color: var(--text-muted); padding: 36px 14px !important; font-size: 0.86rem; }

/* ---- Badges ---- */
.badge, .badge-status-lg, .plan-badge, .role-chip, .task-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px; font-size: 0.7rem; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); color: var(--text-dim); background: rgba(255,255,255,0.03);
  text-transform: none; letter-spacing: 0;
}
.badge-clean, .badge-authorized, .badge-status-lg.aprobado, .task-status-badge.limpio { background: rgba(47, 211, 154, 0.09); color: var(--clean); border-color: rgba(47, 211, 154, 0.22); }
.badge-process, .badge-expired, .badge-status-lg.pendiente, .task-status-badge.en-proceso { background: rgba(245, 181, 68, 0.09); color: var(--process); border-color: rgba(245, 181, 68, 0.24); }
.badge-rejected, .badge-status-lg.rechazado { background: rgba(255, 93, 108, 0.09); color: #ff8a95; border-color: rgba(255, 93, 108, 0.24); }
.badge-pending, .task-status-badge.pendiente { background: rgba(255,255,255,0.03); color: var(--text-muted); border-color: var(--border); }
.plan-basico { color: var(--text-dim); }
.plan-profesional { color: #b7c5ff; background: var(--primary-soft); border-color: rgba(110, 139, 255, 0.28); }
.plan-enterprise { color: var(--gold); background: rgba(233, 196, 106, 0.08); border-color: rgba(233, 196, 106, 0.25); }
.role-chip.superadmin { color: var(--gold); border-color: rgba(233, 196, 106, 0.3); }
.role-chip.admin { color: #b7c5ff; border-color: rgba(110, 139, 255, 0.3); }
.role-chip.jefe, .role-chip.trabajador { color: var(--mod-clean); border-color: rgba(47, 211, 154, 0.3); }
.role-chip.proveedor, .role-chip.porteria { color: var(--mod-access); border-color: rgba(157, 140, 255, 0.3); }

/* ---- Avatar ---- */
.user-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; color: #fff;
  background: linear-gradient(135deg, #3a4a8f, #1d2547); border: 1px solid rgba(255,255,255,0.1);
}
.user-avatar.gold { background: linear-gradient(135deg, #8a6d2b, #3d3016); }

/* ---- KPIs ---- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; text-align: left; position: relative; overflow: hidden; }
.kpi-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-label { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-muted); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.12em; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-card-value { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.01em; }
.stat-card-label { font-size: 0.74rem; color: var(--text-muted); margin-top: 4px; }

/* ---- Anillo de eficiencia ---- */
.circle-wrapper { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.circle-svg-area { position: relative; }
.circle-center-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.circle-pct { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; }
.circle-sub { font-family: var(--font-mono); font-size: 0.58rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.14em; }
.circle-bg { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 8; }
.circle-progress { fill: none; stroke: url(#progressGradient); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 440; stroke-dashoffset: 440; transition: stroke-dashoffset .8s ease; transform: rotate(-90deg); transform-origin: 50% 50%; }

/* ---- Pasos ---- */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .steps-grid { grid-template-columns: 1fr; } }
.step-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; padding: 18px; text-align: left; }
.step-num { width: 28px; height: 28px; border-radius: 8px; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; color: var(--mod-clean); border: 1px solid rgba(47, 211, 154, 0.3); background: rgba(47, 211, 154, 0.07); }
.step-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.step-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.55; }

/* ---- Asignación de zonas ---- */
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 14px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.zone-check-item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); font-size: 0.8rem; color: var(--text-dim); cursor: pointer; transition: all .12s; }
.zone-check-item:hover { border-color: var(--border-strong); color: var(--text); }
.zone-check-item input[type=checkbox] { accent-color: var(--mod-clean); width: 14px; height: 14px; cursor: pointer; }
.zone-check-item.checked { border-color: rgba(47, 211, 154, 0.35); background: rgba(47, 211, 154, 0.06); color: var(--text); }

/* ---- Monitor en vivo ---- */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.live-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; position: relative; overflow: hidden; transition: all .3s; }
.live-card.active { border-color: rgba(245, 181, 68, 0.35); background: linear-gradient(180deg, rgba(245, 181, 68, 0.06), transparent 70%); }
.live-card.idle { opacity: .6; }
.live-card .live-dot { width: 7px; height: 7px; border-radius: 50%; position: absolute; top: 18px; right: 18px; }
.live-dot.on { background: var(--process); box-shadow: 0 0 10px var(--process); animation: blink 1.4s infinite; }
.live-dot.off { background: var(--text-muted); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(1.3); } }
.live-name { font-family: var(--font-display); font-size: 0.98rem; font-weight: 600; margin-bottom: 6px; }
.live-zone { font-size: 0.8rem; color: var(--process); font-weight: 500; margin-bottom: 4px; }
.live-info { font-size: 0.74rem; color: var(--text-muted); }
.live-stats { font-size: 0.74rem; color: var(--text-dim); margin-top: 10px; display: flex; gap: 12px; }
.live-stats span { display: flex; align-items: center; gap: 4px; }

/* ---- Rankings / informes ---- */
.rank-medal { font-size: 1.1rem; margin-right: 4px; }
.rank-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.06); overflow: hidden; margin-top: 6px; }
.rank-bar-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }
.report-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.report-header h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }

/* ---- Documentos ---- */
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; gap: 14px; flex-wrap: wrap; }
.doc-info { display: flex; flex-direction: column; gap: 3px; }
.doc-name { font-weight: 600; font-size: 0.88rem; }
.doc-meta { font-size: 0.74rem; color: var(--text-muted); }
.doc-thumbnail { height: 28px; padding: 0 9px; border-radius: 7px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 500; color: var(--text-dim); gap: 4px; cursor: pointer; transition: all .15s; margin-right: 4px; }
.doc-thumbnail:hover { border-color: rgba(70, 220, 255, 0.5); color: #fff; }

/* ==========================================================================
   LANDING — speech comercial
   ========================================================================== */
#view-landing { padding-top: 0; position: relative; }
.lp-container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.lp-section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.lp-section + .lp-section { border-top: 1px solid var(--border); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 18px;
}
.eyebrow i { width: 18px; height: 1px; background: currentColor; display: inline-block; opacity: .6; }
.eyebrow.clean { color: var(--mod-clean); }
.eyebrow.access { color: var(--mod-access); }
.lp-h2 { font-family: var(--font-display); font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; max-width: 820px; }
.lp-h2 .muted { color: var(--text-muted); }
.lp-lead { font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--text-dim); max-width: 640px; line-height: 1.65; margin-top: 18px; }

/* Fondo grid */
.grid-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.grid-bg::before {
  content: ''; position: absolute; inset: -1px;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}
.grid-bg::after {
  content: ''; position: absolute; left: 50%; top: -10%; width: 1100px; height: 700px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(110, 139, 255, 0.18), transparent 70%);
  filter: blur(10px);
}

/* Hero */
.hero { position: relative; padding: calc(var(--site-header-h) + clamp(56px, 9vw, 110px)) 0 clamp(56px, 8vw, 96px); overflow: hidden; }
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px; border-radius: 99px; margin-bottom: 28px;
  font-size: 0.8rem; color: var(--text-dim);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
}
@media (max-width: 560px) { .hero-badge { font-size: 0.72rem; text-align: left; } }
.hero-badge b { white-space: nowrap; flex-shrink: 0; font-family: var(--font-mono); font-weight: 500; font-size: 0.62rem; letter-spacing: 0.12em; padding: 3px 8px; border-radius: 99px; color: var(--clean); background: rgba(47, 211, 154, 0.1); border: 1px solid rgba(47, 211, 154, 0.25); }
.hero-title {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.045em; line-height: 0.98;
  font-size: clamp(2.6rem, 7.2vw, 5.6rem); max-width: 980px; margin: 0 auto;
  background: linear-gradient(180deg, #ffffff 30%, #9aa6c4 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-title em { font-style: normal; background: linear-gradient(90deg, var(--mod-clean), var(--accent) 45%, var(--mod-access)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: clamp(1.02rem, 1.8vw, 1.22rem); color: var(--text-dim); max-width: 680px; margin: 26px auto 0; line-height: 1.6; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }
.hero-note { margin-top: 18px; font-size: 0.78rem; color: var(--text-muted); }

/* Mock dashboard en el hero */
.hero-visual { position: relative; z-index: 1; margin: clamp(48px, 7vw, 80px) auto 0; max-width: 1080px; }
.hv-frame {
  border-radius: 18px; padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 120px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.4);
}
.hv-screen { border-radius: 12px; background: #070a10; border: 1px solid var(--border); overflow: hidden; }
.hv-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.hv-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.12); }
.hv-bar span { margin-left: 10px; font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-muted); letter-spacing: 0.06em; }
.hv-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; background: var(--border); }
.hv-pane { background: #070a10; padding: 22px 22px 24px; text-align: left; }
.hv-pane h4 { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px; }
.hv-pane h4 i { width: 6px; height: 6px; border-radius: 50%; }
.hv-big { font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.hv-big small { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.hv-caption { font-size: 0.76rem; color: var(--text-muted); margin-top: 6px; }
.hv-bars { display: flex; align-items: flex-end; gap: 5px; height: 64px; margin-top: 18px; }
.hv-bars span { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, rgba(47, 211, 154, 0.9), rgba(47, 211, 154, 0.15)); transform-origin: bottom; animation: growBar 1.2s ease-out both; }
@keyframes growBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.hv-rows { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.hv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 9px; background: rgba(255,255,255,0.025); border: 1px solid var(--border); font-size: 0.78rem; color: var(--text-dim); }
.hv-row b { font-family: var(--font-mono); font-weight: 500; font-size: 0.66rem; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 99px; }
.hv-row b.ok { color: var(--clean); background: rgba(47, 211, 154, 0.1); }
.hv-row b.no { color: #ff8a95; background: rgba(255, 93, 108, 0.1); }
.hv-row b.wait { color: var(--process); background: rgba(245, 181, 68, 0.1); }
.hv-row .mono { color: var(--text-muted); font-size: 0.7rem; }
@media (max-width: 760px) { .hv-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .hv-pane { padding: 18px 16px; } .hv-row { flex-wrap: wrap; } .hv-frame { padding: 6px; } }

/* Franja de sectores */
.sector-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px; margin-top: clamp(48px, 6vw, 72px); color: var(--text-muted); font-size: 0.86rem; }
.sector-strip span { display: inline-flex; align-items: center; gap: 8px; }
.sector-strip svg { width: 16px; height: 16px; opacity: .7; }
.sector-strip-label { width: 100%; text-align: center; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 6px; color: #4f5866; }

/* Problema */
.pain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 56px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pain { background: var(--bg); padding: 30px 28px; }
.pain-q { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.pain-a { font-size: 0.88rem; color: var(--text-muted); margin-top: 12px; line-height: 1.6; }
.pain-num { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-muted); letter-spacing: 0.1em; margin-bottom: 20px; display: block; }
@media (max-width: 860px) { .pain-grid { grid-template-columns: 1fr; } }

/* Módulos */
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 56px; }
@media (max-width: 920px) { .module-grid { grid-template-columns: 1fr; } }
.module-card {
  position: relative; border-radius: 18px; padding: 34px 32px 30px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
}
.module-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, var(--mc), transparent); opacity: .8; }
.module-card::after { content: ''; position: absolute; top: -120px; right: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(closest-side, var(--mc-soft), transparent); pointer-events: none; }
.module-card.clean { --mc: var(--mod-clean); --mc-soft: rgba(47, 211, 154, 0.14); }
.module-card.access { --mc: var(--mod-access); --mc-soft: rgba(157, 140, 255, 0.16); }
.module-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mc); }
.module-tag i { width: 7px; height: 7px; border-radius: 2px; background: var(--mc); box-shadow: 0 0 12px var(--mc); }
.module-name { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.025em; margin-top: 16px; }
.module-pitch { font-size: 0.95rem; color: var(--text-dim); margin-top: 10px; line-height: 1.6; max-width: 480px; }
.module-features { list-style: none; margin-top: 26px; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.module-features li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.module-features li:last-child { border-bottom: none; }
.module-features svg { width: 18px; height: 18px; color: var(--mc); margin-top: 2px; }
.module-features b { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.module-features span { display: block; font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.module-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.module-roles span { font-size: 0.72rem; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--text-dim); }

/* Flujo de acceso P1 → P2 */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 56px; position: relative; }
.flow::before { content: ''; position: absolute; top: 22px; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, var(--mod-access), var(--accent), var(--mod-clean)); opacity: .5; }
.flow-step { text-align: center; padding: 0 10px; position: relative; }
.flow-dot { width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border-strong); font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); position: relative; z-index: 1; }
.flow-step:nth-child(3) .flow-dot, .flow-step:nth-child(4) .flow-dot { border-color: rgba(157, 140, 255, 0.5); box-shadow: 0 0 20px rgba(157, 140, 255, 0.25); color: var(--mod-access); }
.flow-step:last-child .flow-dot { border-color: rgba(47, 211, 154, 0.5); box-shadow: 0 0 20px rgba(47, 211, 154, 0.25); color: var(--clean); }
.flow-title { font-weight: 600; font-size: 0.88rem; }
.flow-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
@media (max-width: 820px) {
  .flow { grid-template-columns: 1fr; gap: 22px; }
  .flow::before { top: 0; bottom: 0; left: 22px; right: auto; width: 1px; height: auto; }
  .flow-step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; text-align: left; padding: 0; }
  .flow-dot { margin: 0; }
}

/* Cómo funciona */
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 56px; }
@media (max-width: 920px) { .how-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .how-grid { grid-template-columns: 1fr; } }
.how-card { padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); }
.how-card .n { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); letter-spacing: 0.1em; }
.how-card h3 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; margin-top: 18px; }
.how-card p { font-size: 0.84rem; color: var(--text-muted); margin-top: 8px; line-height: 1.6; }

/* Sectores */
.sector-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 56px; }
@media (max-width: 1000px) { .sector-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .sector-grid { grid-template-columns: 1fr; } }
.sector-card { padding: 26px 24px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); transition: border-color .2s, background .2s; }
.sector-card:hover { border-color: var(--border-strong); background: var(--card-hover); }
.sector-card svg { width: 22px; height: 22px; color: var(--text-dim); }
.sector-card h3 { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; margin-top: 18px; }
.sector-card p { font-size: 0.84rem; color: var(--text-muted); margin-top: 8px; line-height: 1.6; }
.sector-card ul { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.sector-card li { font-size: 0.8rem; color: var(--text-dim); display: flex; gap: 8px; }
.sector-card li::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex-shrink: 0; }

/* Cifras del producto */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 56px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.figure { padding: 30px 24px; }
.figure + .figure { border-left: 1px solid var(--border); }
.figure b { display: block; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 600; letter-spacing: -0.03em; }
.figure span { display: block; font-size: 0.84rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
@media (max-width: 860px) { .figures { grid-template-columns: 1fr 1fr; } .figure:nth-child(3) { border-left: none; } .figure:nth-child(n+3) { border-top: 1px solid var(--border); } }

/* Seguridad y cumplimiento */
.trust-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .trust-grid { grid-template-columns: 1fr; } }
.trust-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.trust-item { background: var(--bg); padding: 20px 22px; display: grid; grid-template-columns: 22px 1fr; gap: 14px; }
.trust-item svg { width: 18px; height: 18px; color: var(--accent); margin-top: 2px; }
.trust-item b { font-size: 0.92rem; font-weight: 600; }
.trust-item span { display: block; font-size: 0.82rem; color: var(--text-muted); margin-top: 3px; line-height: 1.55; }

/* Planes */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
@media (max-width: 920px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { padding: 30px 28px; border-radius: 18px; border: 1px solid var(--border); background: var(--card); display: flex; flex-direction: column; }
.plan-card.featured { border-color: rgba(110, 139, 255, 0.45); background: linear-gradient(180deg, rgba(110, 139, 255, 0.09), rgba(110, 139, 255, 0.01)); box-shadow: 0 30px 80px rgba(93, 121, 244, 0.12); }
.plan-card .plan-kicker { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.plan-card h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin-top: 12px; letter-spacing: -0.02em; }
.plan-card p { font-size: 0.86rem; color: var(--text-muted); margin-top: 8px; line-height: 1.55; }
.plan-card ul { list-style: none; margin: 22px 0 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan-card li { font-size: 0.84rem; color: var(--text-dim); display: grid; grid-template-columns: 16px 1fr; gap: 10px; }
.plan-card li svg { width: 15px; height: 15px; color: var(--clean); margin-top: 2px; }

/* Demo / CTA final */
.cta-box { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid var(--border-strong); padding: clamp(36px, 6vw, 64px); background: radial-gradient(ellipse 80% 120% at 50% 0%, rgba(110, 139, 255, 0.16), transparent 60%), var(--surface); text-align: center; }
.demo-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 36px auto 0; max-width: 860px; text-align: left; }
@media (max-width: 760px) { .demo-roles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .demo-roles { grid-template-columns: 1fr; } }
.demo-role { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,0.025); transition: all .15s; text-align: left; width: 100%; }
.demo-role:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.05); transform: translateY(-1px); }
.demo-role .dr-ico { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--border); }
.demo-role .dr-ico svg { width: 16px; height: 16px; }
.demo-role[data-mod="clean"] .dr-ico { color: var(--mod-clean); background: rgba(47, 211, 154, 0.07); border-color: rgba(47, 211, 154, 0.22); }
.demo-role[data-mod="access"] .dr-ico { color: var(--mod-access); background: rgba(157, 140, 255, 0.08); border-color: rgba(157, 140, 255, 0.25); }
.demo-role[data-mod="admin"] .dr-ico { color: var(--gold); background: rgba(233, 196, 106, 0.07); border-color: rgba(233, 196, 106, 0.22); }
.demo-role b { display: block; font-size: 0.86rem; font-weight: 600; }
.demo-role span { display: block; font-size: 0.74rem; color: var(--text-muted); margin-top: 1px; }

.site-footer { border-top: 1px solid var(--border); padding: 36px 0 48px; color: var(--text-muted); font-size: 0.8rem; }
.site-footer .lp-container { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* Revelado al hacer scroll */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .hv-bars span { animation: none; } }

/* ==========================================================================
   LOGIN
   ========================================================================== */
#view-auth { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 4, 7, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow-y: auto; }
#view-auth.hidden { display: none; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; padding: 32px 30px 28px; box-shadow: 0 40px 120px rgba(0,0,0,0.7); position: relative; animation: viewIn .3s ease-out; }
.auth-close { position: absolute; top: 16px; right: 16px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; text-align: center; letter-spacing: -0.02em; }
.auth-tagline { text-align: center; color: var(--text-muted); font-size: 0.84rem; margin: 6px 0 26px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.auth-quick button { display: flex; flex-direction: column; align-items: flex-start; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border); background: rgba(255,255,255,0.02); text-align: left; transition: all .15s; }
.auth-quick button:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.05); }
.auth-quick b { font-size: 0.78rem; font-weight: 600; }
.auth-quick span { font-size: 0.68rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ==========================================================================
   CENTRO DE CONTROL (overview)
   ========================================================================== */
.ov-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.ov-hello h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.025em; }
.ov-hello p { color: var(--text-muted); font-size: 0.88rem; margin-top: 4px; }
.ov-modules { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 1100px) { .ov-modules { grid-template-columns: 1fr; } }
.ov-mod { position: relative; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: var(--card); padding: 22px 24px; }
.ov-mod::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, var(--mc), transparent); }
.ov-mod.clean { --mc: var(--mod-clean); }
.ov-mod.access { --mc: var(--mod-access); }
.ov-mod-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.ov-mod-head h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.ov-mod-main { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
@media (max-width: 560px) { .ov-mod-main { grid-template-columns: 1fr; } }
.ov-ring { position: relative; width: 132px; height: 132px; }
.ov-ring svg { width: 132px; height: 132px; transform: rotate(-90deg); }
.ov-ring .ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 9; }
.ov-ring .ring-fg { fill: none; stroke: var(--mc); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s ease; filter: drop-shadow(0 0 6px var(--mc)); }
.ov-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ov-ring-c b { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; }
.ov-ring-c span { font-family: var(--font-mono); font-size: 0.56rem; color: var(--text-muted); letter-spacing: 0.14em; text-transform: uppercase; }
.ov-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ov-metric { padding: 12px 14px; border-radius: 11px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); }
.ov-metric b { display: block; font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.ov-metric span { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.ov-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.ov-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .ov-bottom { grid-template-columns: 1fr; } }
.alert-list, .feed-list { display: flex; flex-direction: column; }
.alert-item, .feed-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.045); }
.alert-item:last-child, .feed-item:last-child { border-bottom: none; }
.alert-ico, .feed-ico { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); }
.alert-ico svg, .feed-ico svg { width: 15px; height: 15px; }
.alert-item.warn .alert-ico { color: var(--process); background: rgba(245, 181, 68, 0.08); border-color: rgba(245, 181, 68, 0.22); }
.alert-item.bad .alert-ico { color: #ff8a95; background: rgba(255, 93, 108, 0.08); border-color: rgba(255, 93, 108, 0.22); }
.alert-item.info .alert-ico { color: #b7c5ff; background: var(--primary-soft); border-color: rgba(110, 139, 255, 0.25); }
.feed-item.clean .feed-ico { color: var(--mod-clean); background: rgba(47, 211, 154, 0.07); border-color: rgba(47, 211, 154, 0.2); }
.feed-item.access .feed-ico { color: var(--mod-access); background: rgba(157, 140, 255, 0.08); border-color: rgba(157, 140, 255, 0.22); }
.alert-text b, .feed-text b { display: block; font-size: 0.84rem; font-weight: 600; color: var(--text); }
.alert-text span, .feed-text span { display: block; font-size: 0.76rem; color: var(--text-muted); margin-top: 1px; }
.feed-time { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.empty-state { text-align: center; padding: 28px 12px; color: var(--text-muted); font-size: 0.86rem; }

/* ==========================================================================
   SUPER ADMIN
   ========================================================================== */
#view-superadmin, #view-proveedor, #view-porteria, #view-jefe, #view-overview { background: transparent; }

/* ==========================================================================
   PORTERÍA
   ========================================================================== */
.port-search-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: clamp(24px, 4vw, 40px); text-align: center; margin: 0 auto 20px; max-width: 860px; position: relative; overflow: hidden; }
.port-search-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, var(--mod-access), transparent); }
.port-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.port-subtitle { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 26px; }
.port-input-wrapper { display: flex; gap: 10px; max-width: 520px; margin: 0 auto; }
.port-input { flex: 1; min-width: 0; padding: 14px 18px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-strong); color: #fff; font-family: var(--font-mono); font-size: 1.05rem; text-align: center; letter-spacing: 0.06em; outline: none; transition: all .15s; }
.port-input:focus { border-color: rgba(157, 140, 255, 0.6); box-shadow: 0 0 0 4px rgba(157, 140, 255, 0.12); }
.btn-port-search { padding: 0 22px; border-radius: 12px; font-weight: 600; font-size: 0.9rem; }

.status-screen { padding: 24px; border-radius: 14px; margin-top: 22px; border: 1px solid transparent; text-align: left; display: none; }
.status-screen.active { display: block; animation: slideDown .3s ease-out; }
.status-authorized { background: linear-gradient(180deg, rgba(47, 211, 154, 0.1), rgba(47, 211, 154, 0.02)); border-color: rgba(47, 211, 154, 0.3); }
.status-blocked { background: linear-gradient(180deg, rgba(255, 93, 108, 0.1), rgba(255, 93, 108, 0.02)); border-color: rgba(255, 93, 108, 0.3); }
.status-notfound { background: rgba(255,255,255,0.025); border-color: var(--border); }
.status-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.status-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 600; }
.status-authorized .status-icon { background: rgba(47, 211, 154, 0.15); color: var(--clean); }
.status-blocked .status-icon { background: rgba(255, 93, 108, 0.15); color: var(--dirty); }
.status-notfound .status-icon { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.status-text { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.status-authorized .status-text { color: var(--clean); }
.status-blocked .status-text { color: #ff8a95; }
.worker-detail-grid { display: grid; grid-template-columns: auto 1fr; gap: 20px; margin-bottom: 20px; align-items: center; }
@media (max-width: 500px) { .worker-detail-grid { grid-template-columns: 1fr; text-align: center; justify-items: center; } }
.worker-avatar-lg { width: 72px; height: 72px; border-radius: 16px; background: linear-gradient(135deg, #3a4a8f, #1d2547); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.8rem; color: #fff; font-weight: 600; border: 1px solid rgba(255,255,255,0.12); }
.worker-info-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 400px) { .worker-info-fields { grid-template-columns: 1fr; } }
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; font-weight: 500; letter-spacing: 0.12em; }
.info-val { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.status-reasons { background: rgba(0,0,0,0.25); border: 1px solid rgba(255, 93, 108, 0.2); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.reason-title { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 500; color: #ff8a95; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.12em; }
.reason-list { font-size: 0.8rem; color: var(--text-dim); padding-left: 18px; }
.action-buttons { display: flex; gap: 10px; }
.btn-action { flex: 1; padding: 12px; border-radius: 11px; font-weight: 600; text-align: center; font-size: 0.9rem; transition: all .15s; border: 1px solid transparent; }
.btn-action-in { background: var(--clean); color: #04140d; }
.btn-action-out { background: rgba(255,255,255,0.06); color: var(--text); border-color: var(--border-strong); }
.btn-action:hover { filter: brightness(1.08); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Acceso automatizado P1 / P2 */
.auto-access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
@media (max-width: 640px) { .auto-access-grid { grid-template-columns: 1fr; } }
.auto-reader-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 14px; padding: 20px; text-align: center; position: relative; transition: all .3s; }
.auto-reader-card.active-scan { border-color: rgba(70, 220, 255, 0.6); box-shadow: 0 0 0 4px rgba(70, 220, 255, 0.08); }
.auto-reader-card.success-scan { border-color: rgba(47, 211, 154, 0.5); background: rgba(47, 211, 154, 0.04); box-shadow: 0 0 0 4px rgba(47, 211, 154, 0.08); }
.auto-reader-card.error-scan { border-color: rgba(255, 93, 108, 0.5); background: rgba(255, 93, 108, 0.04); box-shadow: 0 0 0 4px rgba(255, 93, 108, 0.08); }
.reader-status-indicator { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.08em; margin: 16px 0; padding: 10px; border-radius: 10px; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); }
.reader-status-indicator.closed { color: var(--text-muted); }
.reader-status-indicator.open { color: var(--clean); border-color: rgba(47, 211, 154, 0.3); background: rgba(47, 211, 154, 0.06); }
.reader-status-indicator.denied { color: #ff8a95; border-color: rgba(255, 93, 108, 0.3); background: rgba(255, 93, 108, 0.06); }
.demo-timeline-container { background: rgba(255,255,255,0.015); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.demo-timeline { display: flex; justify-content: space-between; margin: 22px 0 12px; position: relative; padding: 6px 0; }
.demo-timeline::before { content: ""; position: absolute; top: 50%; left: 14px; right: 14px; height: 2px; background: rgba(255,255,255,0.06); z-index: 1; transform: translateY(-50%); }
.demo-timeline-progress { position: absolute; top: 50%; left: 14px; width: 0%; height: 2px; background: linear-gradient(90deg, var(--mod-access), var(--accent)); z-index: 2; transform: translateY(-50%); transition: width .3s ease; box-shadow: 0 0 10px var(--accent); }
.demo-timeline-step { width: 32px; height: 32px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.78rem; z-index: 3; position: relative; transition: all .3s; color: var(--text-dim); }
.demo-timeline-step.active { border-color: var(--accent); color: #fff; box-shadow: 0 0 14px rgba(70, 220, 255, 0.4); }
.demo-timeline-step.completed { border-color: var(--clean); background: var(--clean); color: #04140d; }
.demo-timeline-step.failed { border-color: var(--dirty); background: var(--dirty); color: #fff; }
.demo-timeline-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }
.demo-timeline-label { width: 84px; text-align: center; line-height: 1.35; }
.demo-timeline-label.active { color: #fff; }
.demo-timeline-label.completed { color: var(--clean); }
.demo-timeline-label.failed { color: #ff8a95; }

.ws-feed { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.ws-feed-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 11px; border: 1px solid rgba(47, 211, 154, 0.2); background: rgba(47, 211, 154, 0.04); animation: wsFadeIn .4s ease-out; }
.ws-feed-card.denied { border-color: rgba(255, 93, 108, 0.22); background: rgba(255, 93, 108, 0.04); }
@keyframes wsFadeIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.ws-feed-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.ws-feed-card .ws-feed-icon { background: rgba(47, 211, 154, 0.12); }
.ws-feed-card.denied .ws-feed-icon { background: rgba(255, 93, 108, 0.12); }
.ws-feed-info { flex: 1; }
.ws-feed-name { font-weight: 600; font-size: 0.86rem; }
.ws-feed-detail { font-size: 0.76rem; color: var(--text-muted); }
.ws-feed-time { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); text-align: right; }
.qr-scanner-sim { background: rgba(157, 140, 255, 0.04); border: 1px dashed rgba(157, 140, 255, 0.25); border-radius: 14px; padding: 22px; text-align: center; margin-bottom: 20px; }
.qr-scanner-sim .scan-icon { font-size: 2.2rem; margin-bottom: 8px; }

/* Eventos */
.evento-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 10px; transition: border-color .15s; }
.evento-card:hover { border-color: var(--border-strong); }
.evento-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.evento-card-title { font-family: var(--font-display); font-size: 0.98rem; font-weight: 600; }
.evento-card-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.evento-card-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 12px; }
.evento-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ==========================================================================
   APP OPERARIO (celular)
   ========================================================================== */
#view-trabajador.active { display: flex; justify-content: center; align-items: flex-start; padding-bottom: 48px; }
body.in-app #view-trabajador.active { padding-top: calc(var(--topbar-h) + 28px); }
.phone-frame { width: 100%; max-width: 390px; background: #0a0d13; border-radius: 44px; overflow: hidden; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 50px 120px rgba(0,0,0,0.7), 0 0 0 8px #0d1017, 0 0 0 9px rgba(255,255,255,0.08); min-height: 720px; }
.phone-notch { background: #0a0d13; height: 30px; display: flex; align-items: center; justify-content: center; padding-top: 10px; }
.notch-bar { width: 96px; height: 24px; border-radius: 99px; background: #000; }
.phone-status-bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 24px 8px; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dim); }
.phone-header { margin: 4px 14px 0; border-radius: 16px; background: linear-gradient(135deg, rgba(47, 211, 154, 0.18), rgba(47, 211, 154, 0.04)); border: 1px solid rgba(47, 211, 154, 0.25); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.phone-user-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: #fff; }
.phone-role-badge { display: inline-block; margin-top: 3px; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mod-clean); }
.msg-banner { margin: 12px 14px 0; background: var(--primary-soft); border: 1px solid rgba(110, 139, 255, 0.25); border-radius: 12px; padding: 11px 13px; font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; display: none; }
.msg-banner.show { display: block; }
.msg-banner strong { color: #b7c5ff; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; display: block; margin-bottom: 3px; }
.phone-body { padding: 0 14px 18px; overflow-y: auto; max-height: 560px; }
.phone-section-title { font-family: var(--font-display); font-size: 0.9rem; font-weight: 600; color: var(--text-dim); margin: 16px 2px 10px; display: flex; justify-content: space-between; align-items: center; }
.phone-counter { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.task-card { border-radius: 14px; padding: 13px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-left: 3px solid; background: rgba(255,255,255,0.025); transition: background .15s; }
.task-card:hover { background: rgba(255,255,255,0.04); }
.task-card.p1 { border-left-color: var(--p1); } .task-card.p2 { border-left-color: var(--p2); } .task-card.p3 { border-left-color: var(--p3); } .task-card.pc { border-left-color: var(--common); }
.task-card.limpio { border-left-color: var(--clean); background: rgba(47, 211, 154, 0.05); }
.task-card.en-proceso { border-left-color: var(--process); background: rgba(245, 181, 68, 0.06); }
.task-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 8px; }
.task-card-meta { display: flex; align-items: center; gap: 10px; }
.task-icon { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.task-icon svg { width: 17px; height: 17px; }
.task-icon.p1 { background: rgba(70, 184, 255, 0.12); color: var(--p1); } .task-icon.p2 { background: rgba(47, 211, 154, 0.12); color: var(--p2); } .task-icon.p3 { background: rgba(179, 156, 255, 0.12); color: var(--p3); } .task-icon.pc { background: rgba(255, 154, 82, 0.12); color: var(--common); }
.task-name { font-weight: 600; font-size: 0.86rem; }
.task-floor { font-size: 0.7rem; color: var(--text-muted); }
.task-action-row { display: flex; gap: 6px; margin-top: 10px; }
.task-btn { flex: 1; padding: 10px 12px; border-radius: 10px; font-size: 0.8rem; font-weight: 600; transition: all .15s; text-align: center; }
.task-btn-start { background: linear-gradient(180deg, #7f98ff, #5d79f4); color: #fff; }
.task-btn-finish { background: var(--clean); color: #04140d; }
.task-btn-start:hover, .task-btn-finish:hover { filter: brightness(1.08); }
.task-time-info { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.task-time-info span { color: var(--process); font-weight: 600; }
.empty-tasks { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 0.85rem; }

/* ==========================================================================
   MODALES
   ========================================================================== */
#diagnostic-modal, #finish-modal, #photo-comparison-modal, #upload-modal, #doc-viewer-modal {
  position: fixed; inset: 0; z-index: 2000; background: rgba(3, 4, 7, 0.78);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
#diagnostic-modal.open, #finish-modal.open, #photo-comparison-modal.open, #upload-modal.open, #doc-viewer-modal.open { display: flex; }
.diag-card { background: var(--surface) !important; border: 1px solid var(--border-strong) !important; border-radius: 20px !important; padding: 28px; max-width: 380px; width: 100%; text-align: center; box-shadow: 0 40px 120px rgba(0,0,0,0.7); animation: viewIn .25s ease-out; }
.diag-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.diag-subtitle { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 24px; }
.diag-emojis { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }
.diag-emoji-btn { width: 84px; height: 84px; border-radius: 16px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-strong); font-size: 2rem; transition: all .15s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.diag-emoji-btn:hover { transform: translateY(-2px); }
.diag-emoji-btn.good:hover, .diag-emoji-btn.good.selected { border-color: var(--clean); background: rgba(47, 211, 154, 0.12); }
.diag-emoji-btn.mid:hover, .diag-emoji-btn.mid.selected { border-color: var(--process); background: rgba(245, 181, 68, 0.12); }
.diag-emoji-btn.bad:hover, .diag-emoji-btn.bad.selected { border-color: var(--dirty); background: rgba(255, 93, 108, 0.12); }
.diag-emoji-btn.selected { transform: translateY(-2px); }
.diag-emoji-label { font-size: 0.64rem; font-weight: 500; color: var(--text-muted); }
.diag-cancel { font-size: 0.82rem; color: var(--text-muted); cursor: pointer; }
.diag-cancel:hover { color: var(--text); }
.photo-upload-section { margin: 14px 0 20px; text-align: left; }
.photo-preview-container { margin-top: 8px; border: 1px dashed var(--border-strong); border-radius: 12px; height: 110px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.02); overflow: hidden; position: relative; cursor: pointer; }
.photo-preview-container:hover { background: rgba(255,255,255,0.045); }
.photo-preview-container img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-placeholder { font-size: 0.74rem; color: var(--text-muted); text-align: center; padding: 8px; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.comparison-pane { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,0.02); }
.comparison-pane-title { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; padding: 8px; background: rgba(0,0,0,0.35); text-align: center; border-bottom: 1px solid var(--border); }
.comparison-pane-image { height: 180px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.comparison-pane-image img { width: 100%; height: 100%; object-fit: cover; }
.comparison-pane-image span { font-size: 0.8rem; color: var(--text-muted); }
.table-photos-col { display: flex; gap: 5px; align-items: center; }
.table-photo-thumb { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: #0d0f14; overflow: hidden; cursor: pointer; transition: transform .15s; display: flex; align-items: center; justify-content: center; font-size: 0.62rem; }
.table-photo-thumb:hover { transform: scale(1.15); }
.table-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.table-photo-thumb.empty { color: var(--text-muted); border-style: dashed; cursor: default; }
.table-photo-thumb.empty:hover { transform: none; }

#toast { position: fixed; bottom: 24px; right: 24px; z-index: 9999; max-width: calc(100vw - 48px); padding: 12px 18px; border-radius: 12px; font-size: 0.86rem; font-weight: 500; background: rgba(16, 20, 29, 0.96); color: var(--text); border: 1px solid rgba(47, 211, 154, 0.35); box-shadow: 0 20px 50px rgba(0,0,0,0.5); backdrop-filter: blur(10px); transform: translateY(20px); opacity: 0; transition: all .3s cubic-bezier(.34,1.56,.64,1); pointer-events: none; }
#toast.show { transform: none; opacity: 1; }
#toast.error { border-color: rgba(255, 93, 108, 0.45); }

/* Enrolamiento público */
#view-enrolamiento { position: fixed; inset: 0; z-index: 1050; background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(110, 139, 255, 0.14), transparent 60%), var(--bg); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
#view-enrolamiento.active { display: flex; }
.enrol-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; padding: 32px 28px; box-shadow: 0 40px 120px rgba(0,0,0,0.6); }
.enrol-success { text-align: center; }
.qr-display { width: 200px; height: 200px; margin: 24px auto; background: #fff; border-radius: 14px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.qr-grid { display: grid; grid-template-columns: repeat(21, 1fr); gap: 0; width: 180px; height: 180px; }
.qr-cell { aspect-ratio: 1; }
.qr-cell.dark { background: #111; }
.qr-cell.light { background: #fff; }
.event-detail-card { background: rgba(255,255,255,0.025); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 16px 0; text-align: left; }
.event-detail-card .ed-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 0.84rem; }
.event-detail-card .ed-label { color: var(--text-muted); }
.event-detail-card .ed-value { color: var(--text); font-weight: 600; text-align: right; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,0.025); border: 1px solid var(--border); margin: 16px 0; cursor: pointer; }
.consent-check input[type=checkbox] { accent-color: var(--primary); width: 17px; height: 17px; margin-top: 2px; flex-shrink: 0; }
.consent-check label { font-size: 0.76rem; color: var(--text-dim); line-height: 1.55; cursor: pointer; }
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.upload-box { background: rgba(255,255,255,0.02); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 14px 6px; text-align: center; cursor: pointer; transition: all .15s; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 96px; }
.upload-box:hover { border-color: rgba(110, 139, 255, 0.6); background: var(--primary-soft); }
.upload-box.uploaded { border-style: solid; border-color: rgba(47, 211, 154, 0.45); background: rgba(47, 211, 154, 0.05); }
.upload-icon { font-size: 1.4rem; margin-bottom: 4px; }
.upload-label { font-size: 0.68rem; font-weight: 500; color: var(--text-dim); }
.upload-filename { font-size: 0.62rem; color: var(--clean); font-weight: 500; margin-top: 4px; max-width: 90%; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }

/* Visor de documentos y ficha de acreditación */
#view-doc-modal, #view-profile-modal { position: fixed; inset: 0; z-index: 1200; background: rgba(3, 4, 7, 0.85); display: none; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow-y: auto; }
#view-doc-modal.active, #view-profile-modal.active { display: flex; }
.vdoc-card, .profile-card { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; width: 100%; padding: 24px; box-shadow: 0 40px 120px rgba(0,0,0,0.7); position: relative; }
.vdoc-card { max-width: 520px; text-align: center; }
.profile-card { max-width: 620px; padding: 28px; max-height: 90vh; overflow-y: auto; }
.vdoc-title, .profile-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin-bottom: 18px; color: #fff; }
.profile-title { text-align: center; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.vdoc-image-container { width: 100%; aspect-ratio: 4/3; background: #000; border-radius: 12px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.vdoc-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.vdoc-close, .profile-close { position: absolute; top: 14px; right: 16px; font-size: 1.5rem; line-height: 1; color: var(--text-muted); cursor: pointer; transition: color .15s; }
.vdoc-close:hover, .profile-close:hover { color: #fff; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; text-align: left; }
.profile-field { display: flex; flex-direction: column; }
.profile-field-label { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.profile-field-value { font-size: 0.88rem; color: #fff; font-weight: 600; }
.profile-docs-section { margin-bottom: 22px; text-align: left; }
.profile-docs-title { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 500; color: var(--accent); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.12em; }
.profile-docs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.profile-doc-box { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 10px; padding: 6px; text-align: center; cursor: pointer; transition: all .15s; }
.profile-doc-box:hover { border-color: rgba(70, 220, 255, 0.5); }
.profile-doc-label { font-size: 0.64rem; color: var(--text-dim); margin-top: 5px; font-weight: 500; }
.profile-doc-img-wrap { width: 100%; aspect-ratio: 4/3; background: #000; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.profile-doc-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.profile-actions { display: flex; gap: 10px; margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }

/* ==========================================================================
   IMPRESIÓN (informes PDF)
   ========================================================================== */
#report-print-area { display: none; }

/* La empresa contratista navega desde el menú lateral */
body.role-proveedor .prov-header { display: none; }

@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  #site-header, #app-sidebar, #app-topbar, #sb-overlay, #view-auth, #view-landing, #view-overview, #view-superadmin, #view-jefe, #view-trabajador, #view-proveedor, #view-porteria, #view-enrolamiento, #diagnostic-modal, #toast, #upload-modal, #finish-modal, #photo-comparison-modal, #doc-viewer-modal {
    display: none !important;
  }
  #report-print-area {
    display: block !important;
    padding: 0;
    margin: 0;
  }
  @page {
    margin: 1.6cm 1.2cm;
  }
  .page-break {
    page-break-before: always;
    break-before: page;
  }
  /* Typography & Headers */
  h1, h2, h3 {
    font-family: 'Space Grotesk', system-ui, sans-serif !important;
    color: #0f172a !important;
    font-weight: 700;
    margin-top: 0;
  }
  h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
  }
  h2 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.25rem;
  }
  p {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 1rem;
    line-height: 1.5;
  }
  
  /* Print Header bar */
  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #6366f1;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
  }
  .print-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #0f172a;
  }
  .print-logo span {
    color: #6366f1;
  }
  .print-report-meta {
    text-align: right;
    font-size: 0.8rem;
    color: #64748b;
  }

  /* KPI Cards Grid */
  .print-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  .print-kpi-card {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
  }
  .print-kpi-val {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: #6366f1;
  }
  .print-kpi-lbl {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
  }

  /* Tables styling */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    page-break-inside: auto;
  }
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  th, td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 0.82rem;
  }
  th {
    background: #1e1b4b !important;
    color: #ffffff !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
  }
  tbody tr:nth-child(even) {
    background: #f8fafc !important;
  }
  
  /* Badges */
  .print-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
  }
  .print-badge-success {
    background: #f0fdf4 !important;
    color: #16a34a !important;
    border: 1px solid #bbf7d0;
  }
  .print-badge-warning {
    background: #fffbeb !important;
    color: #d97706 !important;
    border: 1px solid #fef3c7;
  }
  .print-badge-danger {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fee2e2;
  }
  .print-badge-info {
    background: #eff6ff !important;
    color: #2563eb !important;
    border: 1px solid #dbeafe;
  }

  /* Thumbnail photos for evidence */
  .print-photos-container {
    display: flex;
    gap: 0.4rem;
  }
  .print-photo-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
  }
  .print-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .print-photo-thumb.empty {
    font-size: 0.6rem;
    color: #94a3b8;
  }

  /* Two Column layouts for rankings */
  .print-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
  }
}


/* Pantallas muy angostas */
@media (max-width: 420px) {
  .figures { grid-template-columns: minmax(0, 1fr); }
  .figure + .figure { border-left: none; border-top: 1px solid var(--border); }
  .plan-card .btn, .hero-ctas .btn { white-space: normal; text-align: center; }
  .plan-card { padding: 24px 20px; }
}

/* ==========================================================================
   VALTEK ACCESS · control de acceso industrial
   ========================================================================== */
@media print { #view-access, #ax-modal { display: none !important; } }
.demo-roles { grid-template-columns: repeat(3, 1fr); max-width: 940px; }
@media (max-width: 980px) { .demo-roles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .demo-roles { grid-template-columns: 1fr; } }

.ax-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ax-sim.on { color: var(--clean); border-color: rgba(47, 211, 154, 0.35); background: rgba(47, 211, 154, 0.07); }
.ax-sim svg { width: 12px; height: 12px; }
.ax-kpis .ax-kpi-main { border-color: rgba(157, 140, 255, 0.35); background: linear-gradient(180deg, rgba(157, 140, 255, 0.1), rgba(157, 140, 255, 0.02)); }
.ax-kpis .ax-kpi-main .kpi-value { color: #c9bfff; }
.ax-of { font-size: 0.55em; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.ax-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1100px) { .ax-grid { grid-template-columns: minmax(0, 1fr); } }
.ax-sub-title { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin: 22px 0 10px; }
.ax-muted { font-size: 0.74rem; color: var(--text-muted); }
.ax-clip { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.ax-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 10px; line-height: 1.5; }

/* Barras horizontales */
.ax-bars { display: flex; flex-direction: column; gap: 10px; }
.ax-bar-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 34px; gap: 12px; align-items: center; font-size: 0.82rem; color: var(--text-dim); }
.ax-bar-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-bar-row b { font-family: var(--font-display); font-weight: 600; text-align: right; color: var(--text); }
.ax-bars.compact .ax-bar-row { font-size: 0.78rem; }
.ax-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.05); overflow: hidden; }
.ax-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7d6cf0, var(--mod-access)); box-shadow: 0 0 10px rgba(157, 140, 255, 0.4); transition: width .5s ease; }
.ax-bar.alt i { background: linear-gradient(90deg, #3a8fd8, var(--accent)); box-shadow: none; }
.ax-bar.warn i { background: linear-gradient(90deg, #c98a2b, var(--process)); box-shadow: none; }

/* Gráfico por hora */
.ax-legend { margin-left: auto; display: inline-flex; gap: 12px; align-items: center; font-size: 0.72rem; font-weight: 400; color: var(--text-muted); font-family: var(--font-body); }
.ax-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: -6px; }
.ax-legend i.ok, .ax-hour-col i.ok { background: var(--mod-access); }
.ax-legend i.no, .ax-hour-col i.no { background: var(--dirty); }
.ax-hours { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 6px; }
.ax-hour { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.ax-hour-col { flex: 1; width: 100%; max-width: 30px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 2px 2px; overflow: hidden; background: rgba(255,255,255,0.025); }
.ax-hour-col i { display: block; width: 100%; transition: height .5s ease; }
.ax-hour-col i.ok { opacity: .85; }
.ax-hour span { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted); }

/* Feed: rechazos */
.feed-item.ax-denied .feed-ico { color: #ff8a95; background: rgba(255, 93, 108, 0.08); border-color: rgba(255, 93, 108, 0.22); }
.alert-ico { font-weight: 700; }

/* Control de acceso */
.ax-gate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .ax-gate { grid-template-columns: minmax(0, 1fr); } }
.ax-points { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .ax-point span:not(.ax-point-id) { display: none; } .ax-point { padding: 10px 12px; } }
.ax-point { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,0.02); transition: all .15s; position: relative; }
.ax-point:hover { border-color: var(--border-strong); }
.ax-point.active { border-color: rgba(157, 140, 255, 0.6); background: rgba(157, 140, 255, 0.08); box-shadow: 0 0 0 3px rgba(157, 140, 255, 0.1); }
.ax-point b { display: block; font-size: 0.86rem; font-weight: 600; margin-top: 6px; }
.ax-point span:not(.ax-point-id) { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.ax-point-id, .ax-pid { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(157, 140, 255, 0.35); color: var(--mod-access); background: rgba(157, 140, 255, 0.08); }
.ax-rut-row { display: flex; gap: 10px; }
.ax-rut-row .port-input { text-align: left; }
.ax-rut-row .f-input { flex: 1; }
.ax-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .ax-chips { grid-template-columns: 1fr; } }
.ax-chip { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.02); transition: all .15s; }
.ax-chip:hover { border-color: rgba(157, 140, 255, 0.45); background: rgba(157, 140, 255, 0.06); }
.ax-chip b { display: block; font-size: 0.8rem; font-weight: 600; }
.ax-chip span { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.ax-result-card { min-height: 360px; }
.ax-idle { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 310px; gap: 8px; color: var(--text-muted); font-size: 0.84rem; }
.ax-idle b { color: var(--text); font-size: 1rem; font-weight: 600; margin-top: 10px; }
.ax-idle-ring { width: 76px; height: 76px; border-radius: 22px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(157, 140, 255, 0.35); color: var(--mod-access); background: rgba(157, 140, 255, 0.06); animation: axPulse 2.4s ease-in-out infinite; }
.ax-idle-ring svg { width: 32px; height: 32px; }
@keyframes axPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(157, 140, 255, 0.25); } 50% { box-shadow: 0 0 0 14px rgba(157, 140, 255, 0); } }

.ax-verdict { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 14px; border: 1px solid; animation: viewIn .25s ease-out; }
.ax-verdict.ok { border-color: rgba(47, 211, 154, 0.4); background: linear-gradient(135deg, rgba(47, 211, 154, 0.16), rgba(47, 211, 154, 0.03)); }
.ax-verdict.no { border-color: rgba(255, 93, 108, 0.45); background: linear-gradient(135deg, rgba(255, 93, 108, 0.17), rgba(255, 93, 108, 0.03)); }
.ax-verdict.warn { border-color: rgba(245, 181, 68, 0.45); background: linear-gradient(135deg, rgba(245, 181, 68, 0.15), rgba(245, 181, 68, 0.03)); }
.ax-verdict-ico { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ax-verdict-ico svg { width: 26px; height: 26px; }
.ax-verdict.ok .ax-verdict-ico { background: var(--clean); color: #04140d; box-shadow: 0 0 24px rgba(47, 211, 154, 0.5); }
.ax-verdict.no .ax-verdict-ico { background: var(--dirty); color: #fff; box-shadow: 0 0 24px rgba(255, 93, 108, 0.5); }
.ax-verdict.warn .ax-verdict-ico { background: var(--process); color: #1a1204; }
.ax-verdict-t { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; }
.ax-verdict.ok .ax-verdict-t { color: var(--clean); }
.ax-verdict.no .ax-verdict-t { color: #ff8a95; }
.ax-verdict.warn .ax-verdict-t { color: var(--process); }
.ax-verdict-s { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }

.ax-id { display: flex; align-items: center; gap: 16px; margin: 18px 0 6px; }
.ax-id-fields { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; min-width: 0; }
.ax-id-fields span, .ax-detail-grid span { display: block; font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.ax-id-fields b, .ax-detail-grid b { display: block; font-size: 0.86rem; font-weight: 600; margin-top: 2px; }
.ax-checks { list-style: none; margin-top: 14px; border-top: 1px solid var(--border); }
.ax-checks li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.045); }
.ax-checks li i { width: 22px; height: 22px; border-radius: 7px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.ax-checks li i svg { width: 13px; height: 13px; }
.ax-checks li.ok i { color: var(--clean); background: rgba(47, 211, 154, 0.12); }
.ax-checks li.no i { color: #fff; background: var(--dirty); }
.ax-checks b { display: block; font-size: 0.84rem; font-weight: 600; }
.ax-checks li.no b { color: #ff8a95; }
.ax-checks span { display: block; font-size: 0.76rem; color: var(--text-muted); margin-top: 1px; line-height: 1.45; }
.ax-exception { margin-top: 16px; padding: 14px; border-radius: 12px; border: 1px dashed rgba(245, 181, 68, 0.35); background: rgba(245, 181, 68, 0.04); }

/* Avatares */
.ax-av { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 0.74rem; font-weight: 600; color: #fff; background: linear-gradient(135deg, #3a4a8f, #1d2547); border: 1px solid rgba(255,255,255,0.1); }
.ax-av.tipo-contratista { background: linear-gradient(135deg, #5b4aa8, #2a2152); }
.ax-av.tipo-visita { background: linear-gradient(135deg, #8a6d2b, #3d3016); }
.ax-av.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 1.3rem; }
.ax-person { display: flex; align-items: center; gap: 10px; }
.ax-person b { display: block; font-size: 0.84rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.ax-person span.mono { display: block; font-size: 0.7rem; color: var(--text-muted); }
.ax-row { cursor: pointer; }
.ax-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); margin-right: 7px; vertical-align: middle; }
.ax-dot.on { background: var(--clean); box-shadow: 0 0 8px var(--clean); }

/* Documentos */
.ax-docs { display: flex; gap: 4px; flex-wrap: wrap; max-width: 300px; }
.ax-doc { font-size: 0.64rem; font-weight: 500; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
.ax-doc.ok { color: var(--clean); border-color: rgba(47, 211, 154, 0.25); background: rgba(47, 211, 154, 0.06); }
.ax-doc.warn { color: var(--process); border-color: rgba(245, 181, 68, 0.3); background: rgba(245, 181, 68, 0.07); }
.ax-doc.bad, .ax-doc.miss { color: #ff8a95; border-color: rgba(255, 93, 108, 0.3); background: rgba(255, 93, 108, 0.07); }
.ax-doc.miss { border-style: dashed; }

/* Toolbar y filtros */
.ax-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ax-filters { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.ax-filters .f-input { width: auto; min-width: 170px; }
.ax-filters input.f-input { min-width: 240px; flex: 1; max-width: 340px; }
.ax-n { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-muted); margin-left: 4px; }

/* Empresas */
.ax-companies { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
@media (max-width: 420px) { .ax-companies { grid-template-columns: minmax(0, 1fr); } }
.ax-company { margin-bottom: 0; }
.ax-company.suspended { border-color: rgba(255, 93, 108, 0.35); background: linear-gradient(180deg, rgba(255, 93, 108, 0.06), transparent 60%); }
.ax-company-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ax-company-head b { display: block; font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.ax-company-head span { display: block; font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }
.ax-company-warn { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 0.78rem; color: #ffb3ba; background: rgba(255, 93, 108, 0.08); border: 1px solid rgba(255, 93, 108, 0.22); line-height: 1.45; }
.ax-company-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 10px; }
.ax-company-stats b { display: block; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.ax-company-stats span { display: block; font-size: 0.7rem; color: var(--text-muted); }
.ax-company-docs, .ax-doclist { display: flex; flex-direction: column; gap: 6px; }
.ax-cdoc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); font-size: 0.78rem; }
.ax-cdoc span { flex: 1; color: var(--text-dim); }
.ax-cdoc b { font-weight: 500; font-size: 0.74rem; white-space: nowrap; }
.ax-cdoc.ok b { color: var(--clean); }
.ax-cdoc.warn { border-color: rgba(245, 181, 68, 0.3); } .ax-cdoc.warn b { color: var(--process); }
.ax-cdoc.bad, .ax-cdoc.miss { border-color: rgba(255, 93, 108, 0.3); background: rgba(255, 93, 108, 0.04); } .ax-cdoc.bad b, .ax-cdoc.miss b { color: #ff8a95; }
.ax-cdoc .btn { padding: 4px 9px; font-size: 0.72rem; }
/* Cuentas reales: fecha de vencimiento editable en cada documento */
.ax-cdoc.edit { flex-wrap: wrap; }
.ax-cdoc-edit { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ax-cdoc-edit .f-input, .ax-cert-add input.f-input { width: 142px; padding: 5px 8px; font-size: 0.74rem; }
.ax-cert-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ax-cert-add select.f-input { flex: 1; min-width: 200px; padding: 6px 10px; font-size: 0.78rem; }
@media (max-width: 520px) { .ax-cdoc-edit { width: 100%; margin-left: 0; } .ax-cdoc-edit .f-input { flex: 1; width: auto; } }
/* Bitácora: rango de fechas */
.ax-range { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--text-muted); }
.ax-filters .ax-range input.f-input { min-width: 0; width: 150px; flex: none; }

/* Modal de ficha */
#ax-modal { position: fixed; inset: 0; z-index: 1500; display: none; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; background: rgba(3, 4, 7, 0.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#ax-modal.open { display: flex; }
.ax-modal-card { position: relative; width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; padding: 26px; box-shadow: 0 40px 120px rgba(0,0,0,0.7); animation: viewIn .25s ease-out; }
.ax-modal-x { position: absolute; top: 16px; right: 16px; }
.ax-modal-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; padding-right: 40px; }
.ax-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.ax-checkrow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#view-access .data-table td.mono, #view-access .data-table td:first-child { white-space: nowrap; }
#view-access .data-table td { font-size: 0.82rem; }


/* ==========================================================================
   Salas conectadas: cerraduras con QR, asistencia, reservas y patentes
   ========================================================================== */
.rm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rm-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); cursor: pointer; transition: border-color .15s, background .15s; min-width: 0; }
.rm-card:hover, .rm-card:focus-visible { border-color: var(--border-strong); background: var(--card-hover); outline: none; }
.rm-card.open { border-color: rgba(47, 211, 154, 0.28); }
.rm-card.alert { border-color: rgba(245, 181, 68, 0.5); background: rgba(245, 181, 68, 0.04); }
.rm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rm-name { min-width: 0; }
.rm-name b { display: block; font-family: var(--font-display); font-size: 0.98rem; font-weight: 600; line-height: 1.25; }
.rm-name span { display: block; font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; font-family: var(--font-mono); }
.rm-lock { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; padding: 4px 9px; border-radius: 99px; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03); white-space: nowrap; }
.rm-lock svg { width: 12px; height: 12px; }
.rm-lock.open { color: var(--clean); border-color: rgba(47, 211, 154, 0.3); background: rgba(47, 211, 154, 0.08); }
.rm-class { min-height: 42px; }
.rm-class b { display: block; font-size: 0.84rem; font-weight: 600; }
.rm-class span { display: block; font-size: 0.74rem; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }
.rm-class.warn span { color: var(--process); }
.rm-occ { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: 0.74rem; color: var(--text-muted); }
.rm-occ b { color: var(--text); font-family: var(--font-display); font-size: 0.86rem; }
.rm-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.05); font-size: 0.72rem; color: var(--text-muted); }
.rm-foot > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-foot > span svg { width: 12px; height: 12px; color: var(--mod-clean); flex-shrink: 0; }
.rm-modal-state { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); font-size: 0.84rem; color: var(--text-dim); }
.rm-modal-state b { color: var(--text); }
.rm-modal-class { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(157, 140, 255, 0.06); border: 1px solid rgba(157, 140, 255, 0.2); }
.rm-modal-class b { font-size: 0.9rem; }
.rm-modal-class span { grid-column: 1; font-size: 0.76rem; color: var(--text-dim); }
.rm-modal-class .btn { grid-column: 2; grid-row: 1 / span 2; }
.rm-occ-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; }
.rm-occ-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
.rm-occ-row:last-child { border-bottom: none; }
.rm-occ-row > .mono { font-size: 0.74rem; color: var(--text-muted); }
.rm-reader-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 0.8rem; color: var(--text-dim); }
.rm-form { display: grid; gap: 12px; }
.rm-form label { display: grid; gap: 6px; font-size: 0.76rem; color: var(--text-dim); font-weight: 500; }
.rm-free { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rm-att { display: grid; grid-template-columns: minmax(60px, 110px) auto auto; gap: 8px; align-items: center; font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; }
.rm-att b { color: var(--text); font-family: var(--font-display); }
.rm-sel td { background: rgba(157, 140, 255, 0.07); }
.rm-h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.rm-plate { display: inline-block; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.05); font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; color: var(--text); }
@media (max-width: 560px) { .rm-free { grid-template-columns: 1fr; } .rm-grid { grid-template-columns: minmax(0, 1fr); } }
@media print { #view-rooms { display: none !important; } }
@media (max-width: 560px) {
  #view-rooms .alert-item { grid-template-columns: 30px minmax(0, 1fr); }
  #view-rooms .alert-item .btn { grid-column: 2; justify-self: start; }
  .rm-modal-class { grid-template-columns: minmax(0, 1fr); }
  .rm-modal-class .btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 6px; }
}

/* ==========================================================================
   Cuentas reales: formulario de acceso y pantalla "Mi cuenta"
   ========================================================================== */
.info-msg { display: none; margin-top: 8px; padding: 10px 12px; border-radius: 9px; font-size: 0.8rem; line-height: 1.45; color: var(--clean); background: rgba(47, 211, 154, 0.08); border: 1px solid rgba(47, 211, 154, 0.22); }
.info-msg.show { display: block; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.auth-links:empty { display: none; }
.auth-links button { font-size: 0.8rem; color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.auth-links button:hover { color: var(--text); }
#view-auth [hidden] { display: none !important; }
.btn-full:disabled { opacity: 0.6; cursor: progress; }
.ac-org { padding: 18px 0; border-bottom: 1px solid var(--border); display: grid; gap: 12px; }
.ac-org:last-child { border-bottom: none; padding-bottom: 0; }
.ac-org-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ac-org-head b { display: block; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.ac-org-head div span { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-chip { padding: 3px 10px; border-radius: 99px; font-size: 0.72rem; color: var(--text-dim); border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03); }
.ac-add { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px; }
.ac-new { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.ac-new label { display: grid; gap: 6px; font-size: 0.76rem; color: var(--text-dim); font-weight: 500; }
@media (max-width: 900px) { .ac-new { grid-template-columns: 1fr 1fr; } .ac-add { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .ac-new { grid-template-columns: minmax(0, 1fr); } }
@media print { #view-account { display: none !important; } }
