/* =============================================================
   VivaSAT — Sistema de rediseño global v4 (basado en canvas-design)
   Carga después de tokens.css. Convive con Bootstrap/SB Admin 2.
   ============================================================= */

/* ---------- Reset suave ---------- */
html.vs-reset, html.vs-reset body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--neutral-900);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html.vs-reset *, html.vs-reset *::before, html.vs-reset *::after {
  box-sizing: border-box;
}

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

/* ---------- Sidebar ---------- */
.vs-sidebar {
  width: var(--sidebar-w);
  background: var(--brand-primary);
  color: white;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: width var(--t-normal);
}
.vs-sidebar.is-collapsed { width: var(--sidebar-w-collapsed); }
.vs-sidebar.is-collapsed .vs-nav-label,
.vs-sidebar.is-collapsed .vs-brand-text,
.vs-sidebar.is-collapsed .vs-user-meta { display: none; }
.vs-sidebar.is-collapsed .vs-nav-item { justify-content: center; }
.vs-sidebar.is-collapsed .vs-nav-section-title { display: none; }
.vs-sidebar.is-collapsed .vs-user-card { padding: 8px; justify-content: center; }

.vs-brand {
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: white;
  text-decoration: none;
  flex-shrink: 0;
}
.vs-brand:hover { color: white; text-decoration: none; }
.vs-logo-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--brand-accent);
  display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 16px;
  flex-shrink: 0;
}
.vs-brand-text .vs-brand-accent { color: var(--brand-accent); }

.vs-nav {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.vs-nav::-webkit-scrollbar { width: 6px; }
.vs-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.vs-nav-section-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  padding: 12px 12px 6px;
}

.vs-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.72);
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.vs-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
  text-decoration: none;
}
.vs-nav-item.is-active {
  background: rgba(255,255,255,0.12);
  color: white;
  font-weight: 500;
}
.vs-nav-item .vs-nav-icon {
  flex-shrink: 0;
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center; justify-content: center;
}
.vs-nav-item .vs-nav-icon i.mdi { font-size: 18px; line-height: 1; }
.vs-nav-item .vs-nav-label { flex: 1; }
.vs-nav-item .vs-nav-badge {
  background: var(--brand-accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.vs-user-card {
  margin: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.vs-user-meta { min-width: 0; flex: 1; }
.vs-user-meta .vs-user-name {
  font-size: 13px;
  font-weight: 500;
  color: white;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vs-user-meta .vs-user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
}

/* ---------- Main + topbar ---------- */
.vs-main { min-width: 0; /* override below */
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}
.vs-topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
}
.vs-search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--neutral-100);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--neutral-500);
  font-size: 13px;
  transition: border-color var(--t-fast);
}
.vs-search:hover { border-color: var(--neutral-300); }
.vs-search input {
  flex: 1; border: none; outline: none;
  background: transparent; font-size: 13px;
  color: var(--neutral-800);
}
.vs-kbd {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--neutral-600);
  font-weight: 500;
  font-family: var(--font-sans);
}
.vs-spacer { flex: 1; }

.vs-icon-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--neutral-700);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  position: relative;
  font-size: 16px;
}
.vs-icon-btn:hover {
  background: var(--neutral-50);
  color: var(--neutral-900);
  border-color: var(--neutral-300);
}
.vs-icon-btn i.mdi { font-size: 18px; line-height: 1; }
.vs-icon-btn .vs-bell-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-accent);
  border: 2px solid var(--surface);
}

.vs-fichado-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--success-bg);
  color: var(--success);
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.vs-fichado-pill .vs-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
}
.vs-fichado-pill.is-out {
  background: var(--neutral-100);
  color: var(--neutral-600);
}
.vs-fichado-pill.is-out .vs-dot { background: var(--neutral-400); }

.vs-meteo {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--neutral-600);
  font-size: 13px;
}
.vs-meteo-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vs-meteo-sep { color: var(--neutral-300); }

/* Avatares */
.vs-avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  background: var(--brand-primary-600);
  user-select: none;
}
.vs-avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.vs-avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.vs-avatar-md { width: 32px; height: 32px; font-size: 12px; }
.vs-avatar-lg { width: 40px; height: 40px; font-size: 14px; }

/* ---------- Contenedor de página ---------- */
.vs-content {
  flex: 1;
  padding: 24px 32px 64px;
  max-width: 100%;
}
@media (max-width: 768px) {
  .vs-content { padding: 16px; }
}

.vs-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--neutral-500);
  font-size: 12.5px;
  margin-bottom: 12px;
}
.vs-crumbs .sep { color: var(--neutral-300); }
.vs-crumbs a {
  color: var(--neutral-500);
  text-decoration: none;
}
.vs-crumbs a:hover { color: var(--neutral-700); text-decoration: none; }
.vs-crumbs .now { color: var(--neutral-900); font-weight: 500; }

.vs-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.vs-page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--neutral-900);
}
.vs-page-sub {
  color: var(--neutral-500);
  font-size: 13px;
  margin-top: 4px;
}
.vs-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Botones ---------- */
.vs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--neutral-800);
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.vs-btn:hover {
  background: var(--neutral-50);
  color: var(--neutral-900);
  text-decoration: none;
}
.vs-btn:disabled, .vs-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.vs-btn-sm { padding: 7px 12px; font-size: 13px; }
.vs-btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.vs-btn-lg { padding: 12px 20px; font-size: 15px; border-radius: 12px; }

.vs-btn-primary {
  background: var(--brand-primary-600);
  color: white;
  border-color: var(--brand-primary-600);
}
.vs-btn-primary:hover {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}
.vs-btn-accent {
  background: var(--brand-accent);
  color: white;
  border-color: var(--brand-accent);
}
.vs-btn-accent:hover {
  background: var(--brand-accent-600);
  color: white;
}
.vs-btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--neutral-600);
}
.vs-btn-ghost:hover {
  background: var(--neutral-100);
  color: var(--neutral-900);
}
.vs-btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.vs-btn-danger:hover {
  background: #b91c1c;
  color: white;
}
.vs-btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.vs-btn-success:hover { background: #15803d; color: white; }

/* ---------- Card ---------- */
.vs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.vs-card-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.vs-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--neutral-900);
  margin: 0;
}
.vs-card-body { padding: 20px; }
.vs-card-body.is-flush { padding: 0; }
.vs-card-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--neutral-50);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--neutral-600);
  flex-wrap: wrap; gap: 8px;
}

/* ---------- KPI Tiles ---------- */
.vs-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.vs-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  color: inherit;
  display: block;
}
.vs-tile:hover {
  border-color: var(--brand-primary-500);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.vs-tile.is-active {
  border-color: var(--brand-primary-600);
  background: var(--brand-primary-50);
}
.vs-tile-label {
  font-size: 12px;
  color: var(--neutral-500);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.vs-tile-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.vs-tile-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  color: var(--neutral-900);
  line-height: 1.1;
}
.vs-tile-meta {
  font-size: 11px;
  color: var(--neutral-400);
  margin-top: 2px;
}
.vs-tile-delta {
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}
.vs-tile-delta.up { color: var(--success); }
.vs-tile-delta.down { color: var(--danger); }

/* ---------- Pills / badges ---------- */
.vs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.vs-pill .vs-pdot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.vs-pill-info    { background: var(--info-bg);    color: var(--info); }
.vs-pill-warning { background: var(--warning-bg); color: var(--warning-fg); }
.vs-pill-brand   { background: var(--brand-primary-100); color: var(--brand-primary-600); }
.vs-pill-success { background: var(--success-bg); color: var(--success); }
.vs-pill-danger  { background: var(--danger-bg);  color: var(--danger); }
.vs-pill-neutral { background: var(--neutral-100); color: var(--neutral-600); }

/* ---------- Filtros / chips ---------- */
.vs-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: none;
}
.vs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--neutral-700);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.vs-chip:hover { background: var(--neutral-50); }
.vs-chip.is-active {
  background: var(--brand-primary-100);
  border-color: var(--brand-primary-500);
  color: var(--brand-primary-600);
  font-weight: 500;
}
.vs-chip .vs-chip-x {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--brand-primary-500);
  color: white;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 10px;
  line-height: 1;
}

.vs-view-switch {
  display: inline-flex;
  background: var(--neutral-100);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.vs-view-switch button, .vs-view-switch a {
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--neutral-600);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all var(--t-fast);
}
.vs-view-switch button.is-on, .vs-view-switch a.is-on {
  background: var(--surface);
  color: var(--brand-primary-600);
  box-shadow: var(--shadow-xs);
}

/* ---------- Tablas ---------- */
.vs-tbl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}
.vs-tbl-card.is-standalone { border-radius: var(--radius-md); }
.vs-tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.vs-tbl thead tr { background: var(--neutral-50); }
.vs-tbl thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.vs-tbl thead th.sort { cursor: pointer; }
.vs-tbl thead th.sort::after { content: " ↕"; opacity: 0.4; font-size: 10px; }
.vs-tbl thead th.sort.asc::after  { content: " ↑"; opacity: 1; color: var(--brand-primary-600); }
.vs-tbl thead th.sort.desc::after { content: " ↓"; opacity: 1; color: var(--brand-primary-600); }
.vs-tbl tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}
.vs-tbl tbody tr:hover { background: var(--surface-hover); }
.vs-tbl tbody tr.is-selected { background: var(--brand-primary-50); }
.vs-tbl tbody tr:last-child { border-bottom: none; }
.vs-tbl td {
  padding: 12px 14px;
  font-size: 13px;
  vertical-align: middle;
  color: var(--neutral-800);
}
.vs-tbl td.check { width: 36px; padding-right: 0; }
.vs-tbl tr.row-bar-info    td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.vs-tbl tr.row-bar-warning td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.vs-tbl tr.row-bar-curso   td:first-child { box-shadow: inset 3px 0 0 var(--brand-primary-600); }
.vs-tbl tr.row-bar-success td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.vs-tbl tr.row-bar-danger  td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

.vs-tbl .cli-cell {
  font-weight: 500;
  color: var(--neutral-900);
}
.vs-tbl .cli-meta {
  font-size: 11.5px;
  color: var(--neutral-500);
  margin-top: 1px;
}
.vs-tbl .id-cell {
  font-variant-numeric: tabular-nums;
  color: var(--neutral-500);
  font-size: 12px;
}
.vs-tbl .tec-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--neutral-700);
}
.vs-tbl .asunto {
  color: var(--neutral-700);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vs-row-actions {
  display: flex;
  gap: 4px;
  opacity: 0.4;
  transition: opacity var(--t-fast);
}
.vs-tbl tbody tr:hover .vs-row-actions { opacity: 1; }
.vs-mini-icon-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center; justify-content: center;
  color: var(--neutral-600);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-size: 14px;
  transition: all var(--t-fast);
}
.vs-mini-icon-btn:hover {
  background: var(--neutral-50);
  color: var(--neutral-900);
  text-decoration: none;
}

.vs-priority {
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.vs-priority::before {
  content: "●";
  font-size: 8px;
}
.vs-priority-alta  { color: var(--danger); }
.vs-priority-media { color: var(--warning-fg); }
.vs-priority-baja  { color: var(--neutral-500); }

.vs-days {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12px;
}
.vs-days-warn   { color: var(--warning-fg); }
.vs-days-danger { color: var(--danger); }
.vs-days-ok     { color: var(--neutral-500); font-weight: 500; }

input[type=checkbox].vs-check {
  width: 15px; height: 15px;
  accent-color: var(--brand-primary-600);
  cursor: pointer;
}

/* Bulk action bar */
.vs-bulk-bar {
  background: var(--brand-primary);
  color: white;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.vs-bulk-count { font-weight: 600; font-size: 13px; }
.vs-bulk-spacer { flex: 1; }
.vs-bulk-bar .vs-btn {
  background: rgba(255,255,255,0.12);
  color: white;
  border-color: rgba(255,255,255,0.18);
}
.vs-bulk-bar .vs-btn:hover { background: rgba(255,255,255,0.18); color: white; }

/* ---------- Forms ---------- */
.vs-form-group { margin-bottom: 16px; }
.vs-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-700);
  margin-bottom: 6px;
}
.vs-input, .vs-select, .vs-textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--neutral-900);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  line-height: 1.4;
}
.vs-input:focus, .vs-select:focus, .vs-textarea:focus {
  outline: none;
  border-color: var(--brand-primary-600);
  box-shadow: 0 0 0 3px var(--brand-primary-100);
}
.vs-textarea { min-height: 88px; resize: vertical; }

/* ---------- Banner ---------- */
.vs-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 20px;
  border: 1px solid;
}
.vs-banner-warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
  border-color: rgba(245, 158, 11, 0.3);
}
.vs-banner-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.3);
}
.vs-banner-info {
  background: var(--info-bg);
  color: var(--info);
  border-color: rgba(14, 165, 233, 0.3);
}
.vs-banner-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.3);
}
.vs-banner-icon { font-size: 20px; flex-shrink: 0; }
.vs-banner-content { flex: 1; }
.vs-banner-title { font-weight: 600; }

/* ---------- Pager ---------- */
.vs-pager {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.vs-pager button, .vs-pager a {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center; justify-content: center;
  color: var(--neutral-700);
  text-decoration: none;
  transition: all var(--t-fast);
}
.vs-pager button:hover, .vs-pager a:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-300);
  text-decoration: none;
}
.vs-pager .is-active {
  background: var(--brand-primary-600);
  color: white;
  border-color: var(--brand-primary-600);
}
.vs-pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Mobile bottom nav ---------- */
.vs-bottomnav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 60;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.vs-bottomnav-inner {
  display: flex;
  height: 64px;
  align-items: stretch;
}
.vs-bottomnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--neutral-500);
  font-size: 10.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--t-fast);
}
.vs-bottomnav-item:hover { color: var(--neutral-700); text-decoration: none; }
.vs-bottomnav-item.is-active { color: var(--brand-primary-600); }
.vs-bottomnav-item i.mdi { font-size: 22px; line-height: 1; }

@media (max-width: 768px) {
  .vs-sidebar { display: none; }
  .vs-bottomnav { display: block; }
  .vs-content { padding-bottom: 80px; }
  .vs-search { max-width: none; }
  .vs-search span:not(.vs-kbd) { display: none; }
  .vs-search input { font-size: 14px; }
  .vs-kbd { display: none; }
  .vs-meteo { display: none; }
  .vs-fichado-pill .vs-fichado-time { display: none; }
}

/* ---------- Sidebar overlay (mobile) ---------- */
.vs-sidebar-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  color: var(--neutral-700);
  cursor: pointer;
}
@media (max-width: 768px) {
  .vs-sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .vs-sidebar.is-open {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: var(--sidebar-w);
    z-index: 70;
    box-shadow: var(--shadow-lg);
  }
  .vs-sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 65;
  }
}

/* ---------- Compatibilidad Bootstrap/SB Admin 2 ---------- */
/* Forzar Inter por encima de Roboto en .vs-redesign */
.vs-redesign,
.vs-redesign body,
.vs-redesign .container-fluid,
.vs-redesign .card,
.vs-redesign h1, .vs-redesign h2, .vs-redesign h3, .vs-redesign h4, .vs-redesign h5, .vs-redesign h6,
.vs-redesign .form-control,
.vs-redesign .btn,
.vs-redesign table {
  font-family: var(--font-sans) !important;
}

.vs-redesign body {
  background: var(--bg);
  color: var(--neutral-900);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Adapta cards Bootstrap al nuevo lenguaje */
.vs-redesign .card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}
.vs-redesign .card-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--neutral-900);
}

/* Adapta botones Bootstrap */
.vs-redesign .btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 13.5px;
  padding: 8px 14px;
  transition: all var(--t-fast);
}
.vs-redesign .btn-primary {
  background: var(--brand-primary-600);
  border-color: var(--brand-primary-600);
}
.vs-redesign .btn-primary:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}
.vs-redesign .btn-success {
  background: var(--success);
  border-color: var(--success);
}
.vs-redesign .btn-danger {
  background: var(--danger);
  border-color: var(--danger);
}
.vs-redesign .btn-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
}
.vs-redesign .btn-info {
  background: var(--info);
  border-color: var(--info);
  color: white;
}
.vs-redesign .btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--neutral-700);
}
.vs-redesign .btn-secondary:hover {
  background: var(--neutral-50);
  color: var(--neutral-900);
}

/* Tablas Bootstrap */
.vs-redesign .table {
  color: var(--neutral-800);
  font-size: 13px;
}
.vs-redesign .table thead th {
  background: var(--neutral-50);
  color: var(--neutral-500);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  border-top: none;
  padding: 10px 14px;
}
.vs-redesign .table tbody td {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  vertical-align: middle;
}
.vs-redesign .table-hover tbody tr:hover {
  background: var(--surface-hover);
}

/* Inputs Bootstrap */
.vs-redesign .form-control {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 14px;
  padding: 8px 12px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.vs-redesign .form-control:focus {
  border-color: var(--brand-primary-600);
  box-shadow: 0 0 0 3px var(--brand-primary-100);
}

/* Badges Bootstrap */
.vs-redesign .badge {
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 500;
  font-size: 11.5px;
}
.vs-redesign .badge-success { background: var(--success-bg); color: var(--success); }
.vs-redesign .badge-warning { background: var(--warning-bg); color: var(--warning-fg); }
.vs-redesign .badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.vs-redesign .badge-info    { background: var(--info-bg);    color: var(--info); }
.vs-redesign .badge-primary { background: var(--brand-primary-100); color: var(--brand-primary-600); }

/* Anti-cobranzas: ocultar el footer fijo viejo dentro del shell nuevo */
.vs-redesign .footer { display: none !important; }

/* Print */
@media print {
  .vs-sidebar, .vs-topbar, .vs-bottomnav { display: none !important; }
  .vs-content { padding: 0 !important; }
}


/* ====== Defensa viewport pequeño / zoom alto v2 (2026-05-03) ====== */
/* Anula min-width=360 que empeoraba (forzaba overflow). En su lugar permite
   colapsar a 0 y SCROLL HORIZONTAL en .vs-app si no cabe. */
.vs-app { overflow-x: auto !important; min-width: 0 !important; }
.vs-main { flex: 1 1 auto !important; width: auto !important; min-width: 0 !important; max-width: 100% !important; }
.vs-content { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
.vs-page-footer { position: static !important; clear: both !important; width: 100% !important; }

/* .vs-doc-strip: forzar siempre fila, breadcrumb a la izq, actions a la dcha. */
.vs-doc-strip {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
}
.vs-doc-strip > .vs-breadcrumb { order: 1 !important; flex: 1 1 200px !important; }
.vs-doc-strip > .vs-doc-strip-actions { order: 2 !important; flex: 0 1 auto !important; }

/* En mobile (≤900 CSS), sidebar pasa a collapsed y desaparecen search+meteo */
@media (max-width: 900px) {
  .vs-sidebar { width: var(--sidebar-w-collapsed); }
  .vs-sidebar.is-open { width: var(--sidebar-w); position: fixed; top:0; left:0; height:100vh; z-index:70; box-shadow: var(--shadow-lg); }
  .vs-sidebar .vs-nav-label,
  .vs-sidebar .vs-brand-text,
  .vs-sidebar .vs-user-meta { display: none; }
  .vs-sidebar.is-open .vs-nav-label,
  .vs-sidebar.is-open .vs-brand-text,
  .vs-sidebar.is-open .vs-user-meta { display: block; }
  .vs-topbar .vs-search,
  .vs-topbar .vs-meteo { display: none; }
}

/* ====== Forzar full-width en .container-fluid (sb-admin pisa) (2026-05-03b) ====== */
.vs-content > .container-fluid,
.vs-content .container-fluid {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.vs-content .row {
  margin-left: -0.5rem !important;
  margin-right: -0.5rem !important;
}

/* Footer: meterlo en su propio block fuera del article via CSS sibling-friendly */
.vs-page-footer {
  position: static !important;
  float: none !important;
  clear: both !important;
  display: block !important;
  width: 100% !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
}
