/* HostTrack - main.css - Compatible todos los navegadores y dispositivos */
@font-face { font-family: 'Inter'; src: url('/assets/fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --red:        #e03131;
  --red-h:      #c92a2a;
  --red-soft:   rgba(224,49,49,.12);
  --navy:       #1e2d40;
  --bg:         #0c1015;
  --bg2:        #131920;
  --bg3:        #1a2230;
  --bg4:        #202b3d;
  --border:     #2a3548;
  --border2:    #1e2a38;
  --text:       #e8edf5;
  --text2:      #8fa3bc;
  --text3:      #556070;
  --green:      #37b24d;
  --yellow:     #f59f00;
  --danger:     #f03e3e;
  --blue:       #4dabf7;
  --font:       'Inter', Arial, sans-serif;
  --mono:       'Inter', Arial, sans-serif;
  --sidebar-w:  255px;
  --header-h:   60px;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 8px 32px rgba(0,0,0,.45);
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 15px;
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  overflow-x: scroll;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-h); }
button { cursor: pointer; font-family: var(--font); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font); }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg3); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }
* { scrollbar-width: thin; scrollbar-color: var(--border) var(--bg3); }

/* ══════════════════════════════════════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════════════════════════════════════ */
.login-wrap {
  min-height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  -webkit-box-shadow: var(--shadow);
  box-shadow: var(--shadow);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo img {
  max-height: 54px;
  max-width: 200px;
  margin: 0 auto;
  -o-object-fit: contain;
  object-fit: contain;
}
.login-logo p {
  color: var(--text3);
  font-size: .82rem;
  margin-top: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   LAYOUT ADMIN
══════════════════════════════════════════════════════════════════════════════ */
#app {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border2);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-transition: -webkit-transform .2s ease;
  transition: transform .2s ease;
  overflow: hidden;
}
.sidebar-logo {
  padding: 0 18px;
  height: var(--header-h);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  border-bottom: 1px solid var(--border2);
  -ms-flex-negative: 0;
  flex-shrink: 0;
}
.sidebar-logo img {
  max-height: 34px;
  max-width: 170px;
  -o-object-fit: contain;
  object-fit: contain;
}
.sidebar-nav {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px;
}
.nav-section {
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 16px 12px 5px;
  display: block;
}
.nav-item {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text2);
  font-size: .87rem;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  -webkit-transition: all .15s;
  transition: all .15s;
  position: relative;
  white-space: nowrap;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--red);
  border-radius: 0 3px 3px 0;
}
.nav-ic { font-size: .9rem; width: 18px; text-align: center; -ms-flex-negative: 0; flex-shrink: 0; }
.nav-txt { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; }
.nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border2);
  font-size: .72rem;
  color: var(--text3);
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 0 22px;
  z-index: 90;
  gap: 12px;
}
.topbar-title {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  font-size: .92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  -webkit-transition: border-color .15s;
  transition: border-color .15s;
  white-space: nowrap;
}
.user-chip:hover { border-color: var(--red); }
.user-chip span { font-size: .82rem; color: var(--text2); }
.user-av {
  width: 28px; height: 28px;
  background: var(--red);
  border-radius: 50%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}
.btn-icon {
  width: 34px; height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-size: .9rem;
  color: var(--text2);
  -webkit-transition: all .15s;
  transition: all .15s;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg4); color: var(--text); }

/* ── Main content ────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 24px;
  min-height: calc(100vh - var(--header-h));
  width: calc(100% - var(--sidebar-w));
}
.page { display: none; }
.page.active {
  display: block;
  -webkit-animation: pgIn .18s ease;
  animation: pgIn .18s ease;
}
@-webkit-keyframes pgIn { from { opacity: 0; -webkit-transform: translateY(5px); transform: translateY(5px); } to { opacity: 1; -webkit-transform: none; transform: none; } }
@keyframes pgIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ── Page header ─────────────────────────────────────────────────────────── */
.ph {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: flex-start;
  -ms-flex-align: flex-start;
  align-items: flex-start;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  margin-bottom: 20px;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 12px;
}
.ph h1 { font-size: 1.3rem; font-weight: 700; }
.ph-sub { font-size: .78rem; color: var(--text3); margin-top: 3px; }

/* ══════════════════════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow: hidden;
}
.card-hd {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border2);
}
.card-tt { font-size: .92rem; font-weight: 600; }

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: (minmax(140px, 1fr))[auto-fill];
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.sc {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  -webkit-transition: border-color .15s, -webkit-transform .15s;
  transition: border-color .15s, transform .15s;
}
.sc:hover { border-color: var(--border); -webkit-transform: translateY(-1px); transform: translateY(-1px); }
.sc-ic { font-size: 1.2rem; margin-bottom: 8px; }
.sc-val { font-size: 1.8rem; font-weight: 700; font-family: var(--font); line-height: 1; }
.sc-lbl { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); margin-top: 5px; }
.sc.g .sc-val { color: var(--green); }
.sc.b .sc-val { color: var(--blue); }
.sc.d .sc-val { color: var(--danger); }
.sc.y .sc-val { color: var(--yellow); }
.sc.r .sc-val { color: var(--red); }

/* ── Grid layouts ────────────────────────────────────────────────────────── */
.g2 { display: -ms-grid; display: grid; -ms-grid-columns: 1fr 16px 1fr; grid-template-columns: 1fr 1fr; gap: 16px; }
.g3 { display: -ms-grid; display: grid; -ms-grid-columns: 1fr 16px 1fr 16px 1fr; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.ga { display: -ms-grid; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* ══════════════════════════════════════════════════════════════════════════════
   TABLA
══════════════════════════════════════════════════════════════════════════════ */
.tw {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  min-width: 600px;
}
thead th {
  background: var(--bg3);
  padding: 9px 13px;
  text-align: left;
  font-size: .69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text3);
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg3); }
.td-dom { font-family: var(--font); font-size: .8rem; color: var(--blue); font-weight: 500; }

/* ══════════════════════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════════════════════ */
.badge {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .71rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}
.bs { background: rgba(55,178,77,.12);  color: var(--green);  border: 1px solid rgba(55,178,77,.25); }
.bw { background: rgba(245,159,0,.12);  color: var(--yellow); border: 1px solid rgba(245,159,0,.25); }
.bd { background: rgba(240,62,62,.12);  color: var(--danger); border: 1px solid rgba(240,62,62,.25); }
.bi { background: rgba(77,171,247,.12); color: var(--blue);   border: 1px solid rgba(77,171,247,.25); }
.bk { background: rgba(140,152,164,.1); color: var(--text3);  border: 1px solid var(--border2); }
.br { background: var(--red-soft);      color: var(--red);    border: 1px solid rgba(224,49,49,.25); }
.bn { background: rgba(112,72,232,.12); color: #9775fa;       border: 1px solid rgba(112,72,232,.25); }

/* ══════════════════════════════════════════════════════════════════════════════
   BOTONES
══════════════════════════════════════════════════════════════════════════════ */
.btn {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .84rem;
  font-weight: 600;
  border: none;
  -webkit-transition: all .15s;
  transition: all .15s;
  white-space: nowrap;
  font-family: var(--font);
  line-height: 1.4;
  text-decoration: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.bp  { background: var(--red);   color: #fff; }
.bp:hover  { background: var(--red-h); }
.bg  { background: var(--green); color: #fff; }
.bg:hover  { -webkit-filter: brightness(1.1); filter: brightness(1.1); }
.bd2 { background: var(--danger); color: #fff; }
.bd2:hover { -webkit-filter: brightness(1.1); filter: brightness(1.1); }
.bo  { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.bo:hover  { background: var(--bg3); color: var(--text); border-color: var(--red); }
.bgh { background: transparent; color: var(--text3); border: none; }
.bgh:hover { background: var(--bg3); color: var(--danger); }
.bdr { background: transparent; color: var(--danger); border: 1px solid var(--danger); opacity: .7; }
.bdr:hover { background: var(--danger); color: #fff; opacity: 1; }
.bwa { background: #25d366; color: #fff; }
.bwa:hover { background: #1da851; }
.btn-sm { padding: 5px 11px; font-size: .77rem; }
.btn-lg { padding: 11px 22px; font-size: .92rem; }
.w100 { width: 100%; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════════════════
   FORMULARIOS
══════════════════════════════════════════════════════════════════════════════ */
.fg { margin-bottom: 15px; }
.fr  { display: -ms-grid; display: grid; -ms-grid-columns: 1fr 13px 1fr; grid-template-columns: 1fr 1fr; gap: 13px; }
.fr3 { display: -ms-grid; display: grid; -ms-grid-columns: 1fr 13px 1fr 13px 1fr; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }
label {
  display: block;
  font-size: .77rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 5px;
}
.req::after { content: ' *'; color: var(--red); }
input:not([type="checkbox"]), select, textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: .88rem;
  padding: 9px 12px;
  -webkit-transition: border-color .15s, -webkit-box-shadow .15s;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  max-width: 100%;
}
input:not([type="checkbox"]):focus, select:focus, textarea:focus {
  border-color: var(--red);
  -webkit-box-shadow: 0 0 0 3px var(--red-soft);
  box-shadow: 0 0 0 3px var(--red-soft);
}
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-width: 17px;
  border-radius: 3px;
  border: 2px solid var(--border);
  background: var(--bg3);
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
  accent-color: var(--primary, #c0392b);
  padding: 0;
  margin: 0;
}
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: var(--text3); }
input::-moz-placeholder, textarea::-moz-placeholder { color: var(--text3); opacity: 1; }
input:-ms-input-placeholder, textarea:-ms-input-placeholder { color: var(--text3); }
textarea { resize: vertical; min-height: 80px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238fa3bc' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
select option { background: var(--bg2); color: var(--text); }
.ig { display: -webkit-box; display: -ms-flexbox; display: flex; }
.ig input { border-radius: var(--radius) 0 0 var(--radius); border-right: none; }
.ig .btn { border-radius: 0 var(--radius) var(--radius) 0; border: 1px solid var(--border); border-left: none; -ms-flex-negative: 0; flex-shrink: 0; }
.fhint { font-size: .73rem; color: var(--text3); margin-top: 4px; }
.ferr  { font-size: .73rem; color: var(--danger); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════════════════════ */
.mo {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0,0,0,.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 2147483647 !important;
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -webkit-box-align: flex-start;
  -ms-flex-align: flex-start;
  align-items: flex-start;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 16px;
  -webkit-animation: moIn .15s ease;
  animation: moIn .15s ease;
  overflow-x: auto;
  overflow-y: auto;
  box-sizing: border-box;
}
.modal {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: auto;
  -webkit-box-shadow: var(--shadow);
  box-shadow: var(--shadow);
  -webkit-animation: moUp .18s ease;
  animation: moUp .18s ease;
  position: relative;
  margin: 16px auto;
  -webkit-overflow-scrolling: touch;
}
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }
@-webkit-keyframes moUp { from { -webkit-transform: translateY(16px); transform: translateY(16px); opacity: 0; } to { -webkit-transform: none; transform: none; opacity: 1; } }
@keyframes moUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.mh { padding: 18px 22px 14px; border-bottom: 1px solid var(--border2); display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }
.mtt { font-size: .96rem; font-weight: 700; }
.mt2 { padding: 18px 22px; }
.mf { padding: 14px 22px; border-top: 1px solid var(--border2); display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; gap: 8px; }
.mx { background: none; border: none; color: var(--text3); font-size: 1.3rem; line-height: 1; padding: 4px 8px; border-radius: var(--radius); }
.mx:hover { background: var(--bg3); color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════════════
   ALERTAS
══════════════════════════════════════════════════════════════════════════════ */
.alert {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: flex-start;
  -ms-flex-align: flex-start;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: .84rem;
  margin-bottom: 14px;
}
.alert-ic { -ms-flex-negative: 0; flex-shrink: 0; margin-top: 1px; }
.a-s { background: rgba(55,178,77,.1);  border: 1px solid rgba(55,178,77,.25);  color: #6bcf7f; }
.a-w { background: rgba(245,159,0,.1);  border: 1px solid rgba(245,159,0,.25);  color: #fcc419; }
.a-d { background: rgba(240,62,62,.1);  border: 1px solid rgba(240,62,62,.25);  color: #ff8787; }
.a-i { background: rgba(77,171,247,.1); border: 1px solid rgba(77,171,247,.25); color: #74c0fc; }

/* ══════════════════════════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════════════════════════ */
.tw2 {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 320px;
  width: calc(100% - 32px);
}
.toast {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: var(--radius-lg);
  font-size: .84rem;
  font-weight: 500;
  pointer-events: all;
  -webkit-box-shadow: var(--shadow);
  box-shadow: var(--shadow);
  -webkit-animation: tIn .2s ease;
  animation: tIn .2s ease;
  border: 1px solid transparent;
  word-break: break-word;
}
@-webkit-keyframes tIn  { from { -webkit-transform: translateX(28px); transform: translateX(28px); opacity: 0; } to {} }
@keyframes tIn  { from { transform: translateX(28px); opacity: 0; } to {} }
@-webkit-keyframes tOut { to { -webkit-transform: translateX(28px); transform: translateX(28px); opacity: 0; } }
@keyframes tOut { to { transform: translateX(28px); opacity: 0; } }
.ts { background: #0d2818; border-color: rgba(55,178,77,.35);  color: #6bcf7f; }
.te { background: #2c1010; border-color: rgba(240,62,62,.35);  color: #ff8787; }
.ti { background: #0d1e30; border-color: rgba(77,171,247,.35); color: #74c0fc; }
.tw3{ background: #2a1d00; border-color: rgba(245,159,0,.35);  color: #fcc419; }

/* ══════════════════════════════════════════════════════════════════════════════
   FILTROS / BÚSQUEDA
══════════════════════════════════════════════════════════════════════════════ */
.filters {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}
.srch { position: relative; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; min-width: 160px; }
.srch input { padding-left: 32px; }
.si { position: absolute; left: 10px; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); color: var(--text3); pointer-events: none; font-size: .82rem; }
.fsel { min-width: 120px; width: auto; -ms-flex-negative: 0; flex-shrink: 0; }

/* ── Dias pill ───────────────────────────────────────────────────────────── */
.dp { font-family: var(--font); font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 5px; background: var(--bg3); white-space: nowrap; display: inline-block; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 2px; border-bottom: 1px solid var(--border2); margin-bottom: 18px; overflow-x: auto; }
.tab-btn { padding: 8px 16px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text3); font-size: .87rem; font-weight: 600; margin-bottom: -1px; -webkit-transition: all .15s; transition: all .15s; font-family: var(--font); white-space: nowrap; -ms-flex-negative: 0; flex-shrink: 0; }
.tab-btn:hover { color: var(--text2); }
.tab-btn.active { color: var(--red); border-bottom-color: var(--red); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 38px 20px; color: var(--text3); }
.empty-ic { font-size: 2.2rem; margin-bottom: 10px; opacity: .35; }
.empty h3 { color: var(--text2); margin-bottom: 5px; font-size: .92rem; }
.empty p { font-size: .8rem; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spin { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--red); border-radius: 50%; -webkit-animation: sp .55s linear infinite; animation: sp .55s linear infinite; display: inline-block; vertical-align: middle; }
@-webkit-keyframes sp { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
@keyframes sp { to { transform: rotate(360deg); } }

/* ── Aviso cards ─────────────────────────────────────────────────────────── */
.aviso-card { border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 10px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; gap: 12px; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.aviso-card.urgente { border-color: rgba(240,62,62,.35); background: rgba(240,62,62,.04); }
.aviso-card.alerta  { border-color: rgba(245,159,0,.35);  background: rgba(245,159,0,.04); }
.aviso-btns { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 6px; -ms-flex-negative: 0; flex-shrink: 0; }

/* ── Acts ────────────────────────────────────────────────────────────────── */
.acts { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 5px; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -ms-flex-wrap: wrap; flex-wrap: wrap; }

/* ── Flex utils ──────────────────────────────────────────────────────────── */
.flex  { display: -webkit-box; display: -ms-flexbox; display: flex; }
.fxc   { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; }
.fxb   { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }
.gap1  { gap: 8px; }
.gap2  { gap: 16px; }

/* ══════════════════════════════════════════════════════════════════════════════
   PÁGINA PÚBLICA
══════════════════════════════════════════════════════════════════════════════ */
.pub-nav { background: var(--navy); padding: 0 24px; height: 64px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; position: -webkit-sticky; position: sticky; top: 0; z-index: 100; }
.pub-nav img { max-height: 38px; -o-object-fit: contain; object-fit: contain; }
.pub-nav-links a { color: rgba(255,255,255,.82); font-size: .88rem; font-weight: 500; margin-left: 20px; -webkit-transition: color .15s; transition: color .15s; }
.pub-nav-links a:hover { color: #fff; }
.pub-hero { background: -webkit-linear-gradient(135deg, var(--navy) 0%, #c92a2a 100%); background: linear-gradient(135deg, var(--navy) 0%, #c92a2a 100%); padding: 80px 20px; text-align: center; color: #fff; }
.pub-hero img { max-height: 68px; margin: 0 auto 18px; -webkit-filter: brightness(0) invert(1); filter: brightness(0) invert(1); }
.pub-hero h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 700; margin-bottom: 12px; }
.pub-hero p { opacity: .85; font-size: 1rem; max-width: 500px; margin: 0 auto 24px; }
.pub-hero-btns { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 12px; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.pub-btn { padding: 10px 24px; border-radius: 8px; font-weight: 700; font-size: .9rem; border: none; text-decoration: none; -webkit-transition: all .15s; transition: all .15s; display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 7px; }
.pub-btn-primary { background: #fff; color: var(--navy); }
.pub-btn-primary:hover { background: #f0f0f0; color: var(--navy); }
.pub-btn-wa { background: #25d366; color: #fff; }
.pub-btn-wa:hover { background: #1da851; color: #fff; }
.pub-section { max-width: 820px; margin: 0 auto; padding: 50px 20px; }
.pub-section h2 { color: var(--red-h); margin-bottom: 18px; font-size: 1.45rem; }
.contact-card { background: #f8f9fa; border-radius: 12px; padding: 26px; border: 1px solid #e9ecef; }
.contact-card input, .contact-card textarea { background: #fff; border: 1px solid #dee2e6; color: #333; border-radius: 7px; padding: 9px 12px; font-size: .9rem; width: 100%; margin-bottom: 11px; font-family: var(--font); outline: none; -webkit-transition: border-color .15s; transition: border-color .15s; -webkit-appearance: none; }
.contact-card input:focus, .contact-card textarea:focus { border-color: var(--red-h); -webkit-box-shadow: 0 0 0 3px rgba(224,49,49,.08); box-shadow: 0 0 0 3px rgba(224,49,49,.08); }
.contact-card textarea { min-height: 95px; resize: vertical; }
.pub-footer { background: var(--navy); color: rgba(255,255,255,.5); text-align: center; padding: 22px; font-size: .82rem; }
.wa-float { position: fixed; bottom: 22px; right: 22px; z-index: 500; background: #25d366; color: #fff; width: 52px; height: 52px; border-radius: 50%; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; font-size: 1.5rem; -webkit-box-shadow: 0 4px 16px rgba(37,211,102,.4); box-shadow: 0 4px 16px rgba(37,211,102,.4); text-decoration: none; -webkit-transition: -webkit-transform .18s; transition: transform .18s; }
.wa-float:hover { -webkit-transform: scale(1.08); transform: scale(1.08); color: #fff; }

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE - TABLET (≤ 1024px)
══════════════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .g3 { grid-template-columns: 1fr 1fr; }
  .fr3 { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE - MÓVIL (≤ 768px)
══════════════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 768px) {
  :root {
    --sidebar-w: 255px;
    --header-h: 56px;
  }

  /* Sidebar oculta en móvil */
  .sidebar {
    -webkit-transform: translateX(-255px);
    transform: translateX(-255px);
    -webkit-box-shadow: none;
    box-shadow: none;
  }
  .sidebar.open {
    -webkit-transform: translateX(0);
    transform: translateX(0);
    -webkit-box-shadow: 4px 0 20px rgba(0,0,0,.4);
    box-shadow: 4px 0 20px rgba(0,0,0,.4);
  }

  /* Topbar ocupa todo el ancho */
  .topbar { left: 0; padding: 0 14px; }
  #menu-tog { display: -webkit-box !important; display: -ms-flexbox !important; display: flex !important; }

  /* Main ocupa todo */
  .main { margin-left: 0; width: 100%; padding: 14px; }

  /* Grids a 1 columna */
  .g2, .g3, .ga { grid-template-columns: 1fr; }
  .fr, .fr3 { grid-template-columns: 1fr; }

  /* Stats en 2 columnas */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Modal full en móvil */
  .mo { padding: 10px; -webkit-box-align: flex-end; -ms-flex-align: flex-end; align-items: flex-end; }
  .modal, .modal-lg, .modal-xl {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: 0;
  }

  /* Ocultar nombre usuario en topbar pequeña */
  .user-chip span { display: none; }
  .user-chip { padding: 4px 6px; }

  /* Nav pública */
  .pub-nav { padding: 0 14px; }
  .pub-nav-links { display: none; }
  .pub-section { padding: 36px 16px; }

  /* Toast full width en móvil */
  .tw2 { left: 10px; right: 10px; bottom: 10px; max-width: 100%; width: auto; }

  /* Tabla scroll horizontal táctil */
  .tw { -webkit-overflow-scrolling: touch; }

  /* Botones más grandes para táctil */
  .btn-sm { padding: 6px 12px; font-size: .8rem; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE - MÓVIL PEQUEÑO (≤ 400px)
══════════════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 400px) {
  html { font-size: 13.5px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ph h1 { font-size: 1.1rem; }
  .login-box { padding: 28px 20px; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   UTILIDADES
══════════════════════════════════════════════════════════════════════════════ */
#menu-tog { display: none; }
.mt1 { margin-top: 8px; }  .mt2 { margin-top: 16px; } .mt3 { margin-top: 24px; }
.mb1 { margin-bottom: 8px; } .mb2 { margin-bottom: 16px; } .mb3 { margin-bottom: 24px; }
.tc  { text-align: center; }
.tr  { text-align: right; }
.muted { color: var(--text3); }
.sm    { font-size: .78rem; }
.mono  { font-family: var(--font); }
.dn    { display: none !important; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
hr.div { border: none; border-top: 1px solid var(--border2); margin: 18px 0; }

/* ── Neutralizar extensiones de navegador ──────────────────────────────────── */
body > *:not(#app):not(.login-wrap):not(.cli-wrap):not(.tw2):not(script):not(style):not(link) {
  display: none !important;
  pointer-events: none !important;
  position: fixed !important;
  z-index: -9999 !important;
  visibility: hidden !important;
}
#app, .login-wrap {
  position: relative;
  z-index: 1;
  isolation: isolate;
}
