/* ============================================================
   app.css — Victoria Design System
   SaaS / Dashboard · Blazor + Bootstrap
   Prefijo de clases: vt- (Victoria Tokens) / gp- (Global Prefix para compatibilidad con componentes scoped)
   
   ÍNDICE
   00. Imports & Fonts
   01. Design Tokens (Variables)
   02. Base & Reset
   03. Tipografía
   04. Botones
   05. Form Controls
   06. Cards
   07. Badges & Chips
   08. Tablas
   09. Listas
   10. Modales & Drawers
   11. Toasts & Alertas
   12. Navegación (NavMenu / Sidebar)
   13. Skeleton Loaders
   14. Scrollbars Globales
   15. Utilidades (Layout, Spacing, Truncate, Flex)
   16. Blazor (Validación, Error UI, Loading Progress)
   17. Modo Oscuro
   ============================================================ */

/* ── 00. IMPORTS & FONTS ───────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap");

/* ── 01. DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* -- Marca -- */
  --vt-primary: #16c38e;
  --vt-primary-hover: #09926b;
  --vt-primary-light: #4decb7;
  --vt-primary-dark: #0e7f5f;

  --vt-secondary: #10d759;
  --vt-secondary-hover: #07b246;
  --vt-secondary-light: #3aee7c;
  --vt-secondary-dark: #0b8a45;

  --vt-tertiary: #23cad2;
  --vt-tertiary-hover: #1d919d;
  --vt-tertiary-light: #d6f6f8;
  --vt-tertiary-dark: #1f505a;

  /* -- Alias global (compatibilidad con componentes scoped) -- */
  --gp-primary: var(--vt-primary);
  --gp-primary-hover: var(--vt-primary-hover);
  --gp-secondary: var(--vt-secondary);
  --gp-secondary-hover: var(--vt-secondary-hover);
  --gp-tertiary: var(--vt-tertiary);
  --gp-ring: rgba(22, 195, 142, 0.14);
  /* Soft variants used by components (fallbacks for subtle surfaces/highlights) */
  --gp-tertiary-soft: var(--vt-tertiary-light);
  --gp-primary-soft: var(--vt-primary-light);
  /* -- Superficies -- */
  --vt-bg: #fafafc;
  --vt-surface: #ffffff;
  --vt-surface-soft: #f1f5f9;
  --vt-surface-accent: #eef2ff;
  --vt-surface-overlay: rgba(26, 30, 38, 0.48);
  /* -- Alias superficies -- */
  --gp-bg: var(--vt-bg);
  --gp-surface: var(--vt-surface);
  --gp-surface-soft: var(--vt-surface-soft);
  --gp-surface-accent: var(--vt-surface-accent);
  /* -- Texto -- */
  --vt-text-main: #1a1e26;
  --vt-text-secondary: #3d4452;
  --vt-text-muted: #64748b;
  --vt-text-disabled: #a0aab8;
  --vt-text-inverse: #ffffff;
  /* -- Alias texto -- */
  --gp-text-main: var(--vt-text-main);
  --gp-text-muted: var(--vt-text-muted);
  /* -- Bordes -- */
  --vt-border: #e6e9f0;
  --vt-border-strong: #c8cdd9;
  --gp-border: var(--vt-border);
  /* -- Semánticos -- */
  --vt-success: #16a34a;
  --vt-success-bg: #f0fdf4;
  --vt-success-border: #bbf7d0;
  --vt-error: #dc2626;
  --vt-error-bg: #fef2f2;
  --vt-error-border: #fecaca;
  --vt-warning: #d97706;
  --vt-warning-bg: #fffbeb;
  --vt-warning-border: #fde68a;
  --vt-info: #0284c7;
  --vt-info-bg: #f0f9ff;
  --vt-info-border: #bae6fd;
  /* -- Alias semánticos -- */
  --gp-success: var(--vt-success);
  --gp-error: var(--vt-error);
  --gp-warning: var(--vt-warning);
  /* -- Elevación (shadows) -- */
  --vt-shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.06);
  --vt-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
  --vt-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --vt-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
  --vt-shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.14);
  --gp-elevation: var(--vt-shadow-sm);
  /* -- Geometría -- */
  --vt-radius-xs: 4px;
  --vt-radius-sm: 8px;
  --vt-radius-md: 12px;
  --vt-radius-lg: 16px;
  --vt-radius-xl: 24px;
  --vt-radius-full: 9999px;
  --gp-radius: var(--vt-radius-md);
  /* -- Tipografía -- */
  --vt-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --vt-font-mono: "IBM Plex Mono", "Fira Mono", monospace;
  /* -- Transiciones -- */
  --vt-ease: cubic-bezier(0.2, 0, 0.2, 1);
  --vt-duration-fast: 120ms;
  --vt-duration: 180ms;
  --vt-duration-slow: 300ms;
  /* -- Z-index scale -- */
  --vt-z-dropdown: 100;
  --vt-z-sticky: 200;
  --vt-z-modal-backdrop: 400;
  --vt-z-modal: 500;
  --vt-z-toast: 600;
  --vt-z-tooltip: 700;
}

/* ── 02. BASE & RESET ──────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  font-family: var(--vt-font-sans);
  background-color: var(--vt-bg);
  color: var(--vt-text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

/* Focus visible global — accesibilidad sin sacrificar estética */
:focus-visible {
  outline: 2px solid var(--vt-primary);
  outline-offset: 2px;
  border-radius: var(--vt-radius-xs);
}

/* Selección de texto */
::selection {
  background: var(--vt-primary-light);
  color: var(--vt-primary-dark);
}

.content {
  padding-top: 1.5rem;
}

/* ── 03. TIPOGRAFÍA ────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--vt-text-main);
}

h1:focus {
  outline: none;
}

/* Escala tipográfica semántica */
.text-display {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.text-heading {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.text-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.text-subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--vt-text-muted);
  line-height: 1.5;
}

.text-body {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.55;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1.5;
}

.text-2xs {
  font-size: 0.6875rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* Pesos */
.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-extrabold {
  font-weight: 800;
}

/* Colores de texto */
.text-primary {
  color: var(--vt-primary) !important;
}

.text-muted {
  color: var(--vt-text-muted) !important;
}

.text-secondary {
  color: var(--vt-text-secondary) !important;
}

.text-disabled {
  color: var(--vt-text-disabled) !important;
}

.text-success {
  color: var(--vt-success) !important;
}

.text-error {
  color: var(--vt-error) !important;
}

.text-warning {
  color: var(--vt-warning) !important;
}

.text-info {
  color: var(--vt-info) !important;
}

/* Importes y Monedas */
.vt-monto, 
.ts-monto,
[data-type="currency"] {
  font-family: var(--vt-font-sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Mono */
.font-mono {
  font-family: var(--vt-font-mono);
}

code {
  font-family: var(--vt-font-mono);
  color: var(--vt-primary);
  background: var(--vt-surface-soft);
  padding: 0.15rem 0.4rem;
  border-radius: var(--vt-radius-xs);
  font-size: 0.875em;
}

/* ── 04. BOTONES ───────────────────────────────────────────── */
.btn {
  border-radius: var(--vt-radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.25rem;
  transition: all var(--vt-duration) var(--vt-ease);
  box-shadow: var(--vt-shadow-xs);
  border: 1px solid var(--vt-border);
  background: var(--vt-surface);
  color: var(--vt-text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--vt-shadow-md);
}

.btn:active {
  transform: translateY(0);
}

/* Variantes */
.btn-primary {
  background: var(--vt-primary);
  border-color: var(--vt-primary);
  color: var(--vt-text-inverse);
  box-shadow: 0 4px 14px rgba(0, 87, 255, 0.3);
}

.btn-primary:hover {
  background: var(--vt-primary-hover);
  border-color: var(--vt-primary-hover);
  box-shadow: 0 6px 20px rgba(0, 87, 255, 0.38);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--vt-text-muted);
}

.btn-ghost:hover {
  background: var(--vt-surface-soft);
  color: var(--vt-text-main);
  box-shadow: none;
  transform: none;
}

.btn-danger {
  background: var(--vt-error);
  border-color: var(--vt-error);
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Tamaños */
.btn-sm {
  font-size: 0.8125rem;
  padding: 0.35rem 0.875rem;
  border-radius: var(--vt-radius-sm);
}

.btn-lg {
  font-size: 1rem;
  padding: 0.7rem 1.75rem;
  border-radius: var(--vt-radius-lg);
}

.btn-xl {
  font-size: 1.0625rem;
  padding: 0.875rem 2.25rem;
  border-radius: var(--vt-radius-lg);
}

/* Icono cuadrado */
.btn-icon {
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--vt-radius-sm);
  justify-content: center;
  box-shadow: none;
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
}

.btn-icon.btn-lg {
  width: 44px;
  height: 44px;
}

/* Circular */
.btn-circle {
  border-radius: var(--vt-radius-full);
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}

/* Focus ring consistente */
.btn:focus-visible {
  border-color: var(--vt-primary);
  box-shadow: 0 0 0 4px var(--gp-ring);
  outline: none;
}

/* Loading state */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.72;
  position: relative;
}

.btn.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: vt-spin 0.65s linear infinite;
  flex-shrink: 0;
}

/* ── 05. FORM CONTROLS ─────────────────────────────────────── */
.form-control,
.form-select {
  border-radius: var(--vt-radius-md);
  border: 1px solid var(--vt-border);
  padding: 0.6rem 1rem;
  background-color: var(--vt-surface) !important;
  color: var(--vt-text-main);
  font-size: 0.9375rem;
  transition:
    border-color var(--vt-duration) var(--vt-ease),
    box-shadow var(--vt-duration) var(--vt-ease);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--vt-primary);
  box-shadow: 0 0 0 4px var(--gp-ring);
  outline: none;
  background-color: var(--vt-surface) !important;
}

.form-control::placeholder {
  color: var(--vt-text-disabled);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--vt-text-secondary);
  margin-bottom: 0.375rem;
}

.form-text {
  font-size: 0.8125rem;
  color: var(--vt-text-muted);
}

.form-floating > label {
  color: var(--vt-text-muted);
}

/* Input group */
.input-group-text {
  background: var(--vt-surface-soft);
  border-color: var(--vt-border);
  color: var(--vt-text-muted);
  border-radius: var(--vt-radius-md);
}

/* Validación */
.valid.modified:not([type="checkbox"]) {
  outline: 1px solid var(--vt-success);
}

.invalid {
  border-color: var(--vt-error) !important;
}

.validation-message {
  color: var(--vt-error);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Switch / Checkbox / Radio */
.form-check-input:focus {
  box-shadow: 0 0 0 4px var(--gp-ring);
  border-color: var(--vt-primary);
}

.form-check-input:checked {
  background-color: var(--vt-primary);
  border-color: var(--vt-primary);
}

/* ── 06. CARDS ─────────────────────────────────────────────── */
.vt-card {
  background: var(--vt-surface);
  border: 1px solid var(--vt-border);
  border-radius: var(--vt-radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 6px 20px rgba(0,0,0,0.09);
  padding: 1.5rem;
  transition:
    box-shadow var(--vt-duration) var(--vt-ease),
    border-color var(--vt-duration) var(--vt-ease);
}

.vt-card-hover:hover {
  box-shadow: var(--vt-shadow-md);
  border-color: var(--vt-border-strong);
}

.vt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
}

.vt-card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--vt-text-main);
}

.vt-card-subtitle {
  font-size: 0.8125rem;
  color: var(--vt-text-muted);
  margin-top: 0.15rem;
}

.vt-card-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--vt-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Stat card — común en dashboards */
.vt-stat-card {
  background: var(--vt-surface);
  border: 1px solid var(--vt-border);
  border-radius: var(--vt-radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 6px 20px rgba(0,0,0,0.09);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vt-stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--vt-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vt-stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--vt-text-main);
  line-height: 1;
}

.vt-stat-delta {
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.vt-stat-delta.up {
  color: var(--vt-success);
}

.vt-stat-delta.down {
  color: var(--vt-error);
}

/* Variante accent (borde izquierdo de color) */
.vt-card-accent-primary {
  border-left: 3px solid var(--vt-primary);
}

.vt-card-accent-success {
  border-left: 3px solid var(--vt-success);
}

.vt-card-accent-warning {
  border-left: 3px solid var(--vt-warning);
}

.vt-card-accent-error {
  border-left: 3px solid var(--vt-error);
}

/* ── 07. BADGES & CHIPS ────────────────────────────────────── */
.vt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0.6rem;
  border-radius: var(--vt-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Variantes de estado */
.vt-badge-default {
  background: var(--vt-surface-soft);
  color: var(--vt-text-muted);
  border: 1px solid var(--vt-border);
}

.vt-badge-primary {
  background: var(--vt-primary-light);
  color: var(--vt-primary-dark);
  border: 1px solid rgba(0, 87, 255, 0.2);
}

.vt-badge-success {
  background: var(--vt-success-bg);
  color: var(--vt-success);
  border: 1px solid var(--vt-success-border);
}

.vt-badge-error {
  background: var(--vt-error-bg);
  color: var(--vt-error);
  border: 1px solid var(--vt-error-border);
}

.vt-badge-warning {
  background: var(--vt-warning-bg);
  color: var(--vt-warning);
  border: 1px solid var(--vt-warning-border);
}

.vt-badge-info {
  background: var(--vt-info-bg);
  color: var(--vt-info);
  border: 1px solid var(--vt-info-border);
}

/* Dot badge */
.vt-badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Chip — interactivo, con X opcional */
.vt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.375rem 0.875rem;
  border-radius: var(--vt-radius-full);
  border: 1px solid var(--vt-border);
  background: var(--vt-surface);
  color: var(--vt-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--vt-shadow-xs);
  transition: all var(--vt-duration) var(--vt-ease);
  white-space: nowrap;
  user-select: none;
}

.vt-chip:hover {
  border-color: var(--vt-primary);
  color: var(--vt-primary);
  background: var(--vt-primary-light);
}

.vt-chip.active {
  background: var(--vt-primary);
  border-color: var(--vt-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 87, 255, 0.28);
}

.vt-chip-dismiss {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background var(--vt-duration-fast);
}

.vt-chip-dismiss:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ── 08. TABLAS ────────────────────────────────────────────── */
.vt-table-wrapper {
  border: 1px solid var(--vt-border);
  border-radius: var(--vt-radius-lg);
  overflow: hidden;
  box-shadow: var(--vt-shadow-xs);
}

.vt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--vt-surface);
}

.vt-table thead {
  background: var(--vt-surface-soft);
  border-bottom: 2px solid var(--vt-border);
}

.vt-table thead th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--vt-text-muted);
  text-align: left;
  white-space: nowrap;
}

.vt-table tbody tr {
  border-bottom: 1px solid var(--vt-border);
  transition: background var(--vt-duration-fast);
}

.vt-table tbody tr:last-child {
  border-bottom: none;
}

.vt-table tbody tr:hover {
  background: var(--vt-surface-soft);
}

.vt-table td {
  padding: 0.875rem 1rem;
  color: var(--vt-text-main);
  vertical-align: middle;
}

/* Columna de acciones — siempre alineada a la derecha */
.vt-table .vt-table-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

/* Fila seleccionada */
.vt-table tbody tr.selected {
  background: var(--vt-primary-light);
  border-color: rgba(0, 87, 255, 0.15);
}

/* Celdas de estado con badge integrado */
.vt-table td.vt-td-badge {
  vertical-align: middle;
}

/* ── 09. LISTAS ────────────────────────────────────────────── */
.vt-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--vt-border);
  border-radius: var(--vt-radius-lg);
  overflow: hidden;
  background: var(--vt-surface);
  box-shadow: var(--vt-shadow-xs);
}

.vt-list-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--vt-border);
  transition: background var(--vt-duration-fast);
}

.vt-list-item:last-child {
  border-bottom: none;
}

.vt-list-item.clickable {
  cursor: pointer;
}

.vt-list-item.clickable:hover {
  background: var(--vt-surface-soft);
}

.vt-list-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--vt-radius-sm);
  background: var(--vt-surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--vt-text-muted);
  flex-shrink: 0;
}

.vt-list-item-content {
  flex: 1;
  min-width: 0;
}

.vt-list-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--vt-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vt-list-item-subtitle {
  font-size: 0.8125rem;
  color: var(--vt-text-muted);
  margin-top: 1px;
}

/* ── 10. MODALES & DRAWERS ─────────────────────────────────── */

/* Backdrop */
.vt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--vt-surface-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--vt-z-modal-backdrop);
  animation: vt-fade-in var(--vt-duration-slow) var(--vt-ease);
}

/* Modal */
.vt-modal {
  position: fixed;
  inset: 0;
  z-index: var(--vt-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.vt-modal-dialog {
  background: var(--vt-surface);
  border: 1px solid var(--vt-border);
  border-radius: var(--vt-radius-xl);
  box-shadow: var(--vt-shadow-modal);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: vt-modal-in var(--vt-duration-slow) var(--vt-ease);
}

.vt-modal-dialog-sm {
  max-width: 380px;
}

.vt-modal-dialog-lg {
  max-width: 720px;
}

.vt-modal-dialog-xl {
  max-width: 960px;
}

.vt-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
  gap: 1rem;
}

.vt-modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--vt-text-main);
}

.vt-modal-body {
  padding: 1.25rem 1.5rem;
}

.vt-modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--vt-border);
}

/* Drawer (panel lateral) */
.vt-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--vt-z-modal);
  display: flex;
  justify-content: flex-end;
}

.vt-drawer-panel {
  background: var(--vt-surface);
  border-left: 1px solid var(--vt-border);
  box-shadow: var(--vt-shadow-lg);
  width: 100%;
  max-width: 460px;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: vt-slide-in-right var(--vt-duration-slow) var(--vt-ease);
}

.vt-drawer-panel-sm {
  max-width: 320px;
}

.vt-drawer-panel-lg {
  max-width: 640px;
}

.vt-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--vt-border);
  flex-shrink: 0;
}

.vt-drawer-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vt-drawer-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.vt-drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--vt-border);
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ── 11. TOASTS & ALERTAS ──────────────────────────────────── */

/* Toast container */
.vt-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: var(--vt-z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  max-width: 380px;
  width: calc(100% - 3rem);
}

/* Toast */
.vt-toast {
  background: var(--vt-surface);
  border: 1px solid var(--vt-border);
  border-radius: var(--vt-radius-lg);
  box-shadow: var(--vt-shadow-lg);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: vt-toast-in var(--vt-duration-slow) var(--vt-ease);
}

.vt-toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.vt-toast-body {
  flex: 1;
  min-width: 0;
}

.vt-toast-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--vt-text-main);
}

.vt-toast-message {
  font-size: 0.8125rem;
  color: var(--vt-text-muted);
  margin-top: 2px;
}

.vt-toast-dismiss {
  background: transparent;
  border: none;
  color: var(--vt-text-muted);
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
  border-radius: var(--vt-radius-xs);
  line-height: 1;
  transition: color var(--vt-duration-fast);
}

.vt-toast-dismiss:hover {
  color: var(--vt-text-main);
}

/* Toast variantes */
.vt-toast-success {
  border-left: 3px solid var(--vt-success);
}

.vt-toast-error {
  border-left: 3px solid var(--vt-error);
}

.vt-toast-warning {
  border-left: 3px solid var(--vt-warning);
}

.vt-toast-info {
  border-left: 3px solid var(--vt-info);
}

/* Inline Alerts */
.vt-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--vt-radius-md);
  border: 1px solid;
  font-size: 0.875rem;
  line-height: 1.55;
}

.vt-alert-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.vt-alert-success {
  background: var(--vt-success-bg);
  border-color: var(--vt-success-border);
  color: #14532d;
}

.vt-alert-error {
  background: var(--vt-error-bg);
  border-color: var(--vt-error-border);
  color: #7f1d1d;
}

.vt-alert-warning {
  background: var(--vt-warning-bg);
  border-color: var(--vt-warning-border);
  color: #78350f;
}

.vt-alert-info {
  background: var(--vt-info-bg);
  border-color: var(--vt-info-border);
  color: #0c4a6e;
}

/* ── 12. NAVEGACIÓN ────────────────────────────────────────── */
.nav-item {
  margin-bottom: 0.15rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  padding: 0.62rem 0.9rem !important;
  border-radius: var(--vt-radius-md);
  color: var(--vt-text-muted) !important;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--vt-duration) var(--vt-ease);
  position: relative;
  letter-spacing: -0.005em;
}

.nav-link:hover {
  background: var(--vt-surface-soft);
  color: var(--vt-text-main) !important;
}

.nav-link.active {
  background: var(--vt-primary-light) !important;
  color: var(--vt-primary) !important;
}

/* left indicator bar on active */
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 99px;
  background: var(--vt-primary);
}

.nav-link i,
.nav-link .bi {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--vt-duration-fast);
}

.nav-link:hover i,
.nav-link:hover .bi {
  opacity: 1;
}

.nav-link.active i,
.nav-link.active .bi {
  color: var(--vt-primary);
  opacity: 1;
}

/* Dark-mode nav overrides */
@media (prefers-color-scheme: dark) {
  .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .nav-link.active {
    background: rgba(0, 87, 255, 0.13) !important;
    color: var(--vt-primary) !important;
    box-shadow: 0 0 12px rgba(0, 87, 255, 0.08);
  }
}

/* Separador de sección */
.nav-section-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vt-text-disabled);
  padding: 0.65rem 0.9rem 0.2rem;
  margin-top: 0.35rem;
}

/* ── 13. SKELETON LOADERS ──────────────────────────────────── */
@keyframes vt-shimmer {
  0% {
    background-position: -600px 0;
  }

  100% {
    background-position: 600px 0;
  }
}

.vt-skeleton {
  border-radius: var(--vt-radius-sm);
  background: linear-gradient(
    90deg,
    var(--vt-surface-soft) 25%,
    var(--vt-border) 50%,
    var(--vt-surface-soft) 75%
  );
  background-size: 600px 100%;
  animation: vt-shimmer 1.4s infinite linear;
  display: block;
}

/* Atajos de forma */
.vt-skeleton-text {
  height: 14px;
  border-radius: var(--vt-radius-full);
}

.vt-skeleton-title {
  height: 20px;
  border-radius: var(--vt-radius-full);
}

.vt-skeleton-avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.vt-skeleton-card {
  border-radius: var(--vt-radius-lg);
  width: 100%;
}

/* Helpers de tamaño rápidos */
.vt-skeleton-xs {
  height: 8px;
}

.vt-skeleton-sm {
  height: 12px;
}

.vt-skeleton-md {
  height: 16px;
}

.vt-skeleton-lg {
  height: 24px;
}

.vt-skeleton-xl {
  height: 40px;
}

.vt-skeleton-2xl {
  height: 64px;
}

/* Widths para texto */
.vt-w-full {
  width: 100%;
}

.vt-w-3-4 {
  width: 75%;
}

.vt-w-2-3 {
  width: 66%;
}

.vt-w-1-2 {
  width: 50%;
}

.vt-w-1-3 {
  width: 33%;
}

.vt-w-1-4 {
  width: 25%;
}

/* ── 14. SCROLLBARS GLOBALES ───────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--vt-border-strong);
  border-radius: var(--vt-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--vt-text-disabled);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--vt-border-strong) transparent;
}

/* ── 15. UTILIDADES ────────────────────────────────────────── */

/* Truncate */
.vt-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vt-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vt-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Flex helpers */
.vt-flex {
  display: flex;
}

.vt-flex-col {
  display: flex;
  flex-direction: column;
}

.vt-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vt-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vt-flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.vt-flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.vt-flex-wrap {
  flex-wrap: wrap;
}

.vt-flex-1 {
  flex: 1;
}

.vt-flex-shrink-0 {
  flex-shrink: 0;
}

/* Grid helpers */
.vt-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.vt-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.vt-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .vt-grid-2,
  .vt-grid-3,
  .vt-grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .vt-grid-3,
  .vt-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Gap scale */
.vt-gap-1 {
  gap: 0.25rem;
}

.vt-gap-2 {
  gap: 0.5rem;
}

.vt-gap-3 {
  gap: 0.75rem;
}

.vt-gap-4 {
  gap: 1rem;
}

.vt-gap-6 {
  gap: 1.5rem;
}

.vt-gap-8 {
  gap: 2rem;
}

/* Padding / Margin helpers (4-unit scale) */
.vt-p-0 {
  padding: 0;
}

.vt-p-2 {
  padding: 0.5rem;
}

.vt-p-4 {
  padding: 1rem;
}

.vt-p-6 {
  padding: 1.5rem;
}

.vt-p-8 {
  padding: 2rem;
}

.vt-px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.vt-px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.vt-py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.vt-py-6 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.vt-mt-2 {
  margin-top: 0.5rem;
}

.vt-mt-4 {
  margin-top: 1rem;
}

.vt-mt-6 {
  margin-top: 1.5rem;
}

.vt-mb-2 {
  margin-bottom: 0.5rem;
}

.vt-mb-4 {
  margin-bottom: 1rem;
}

.vt-mb-6 {
  margin-bottom: 1.5rem;
}

/* Borders */
.vt-border {
  border: 1px solid var(--vt-border);
}

.vt-border-top {
  border-top: 1px solid var(--vt-border);
}

.vt-border-bottom {
  border-bottom: 1px solid var(--vt-border);
}

.vt-rounded-sm {
  border-radius: var(--vt-radius-sm);
}

.vt-rounded-md {
  border-radius: var(--vt-radius-md);
}

.vt-rounded-lg {
  border-radius: var(--vt-radius-lg);
}

.vt-rounded-full {
  border-radius: var(--vt-radius-full);
}

/* Shadows */
.vt-shadow-xs {
  box-shadow: var(--vt-shadow-xs);
}

.vt-shadow-sm {
  box-shadow: var(--vt-shadow-sm);
}

.vt-shadow-md {
  box-shadow: var(--vt-shadow-md);
}

.vt-shadow-lg {
  box-shadow: var(--vt-shadow-lg);
}

/* Surface helpers */
.vt-surface {
  background: var(--vt-surface);
}

.vt-surface-soft {
  background: var(--vt-surface-soft);
}

.vt-surface-accent {
  background: var(--vt-surface-accent);
}

/* Divider */
.vt-divider {
  border: none;
  border-top: 1px solid var(--vt-border);
  margin: 1rem 0;
}

/* Overlay / backdrop rápido */
.vt-overlay {
  position: fixed;
  inset: 0;
  background: var(--vt-surface-overlay);
  backdrop-filter: blur(4px);
  z-index: var(--vt-z-modal-backdrop);
}

/* Visibility */
.vt-hidden {
  display: none !important;
}

.vt-invisible {
  visibility: hidden;
}

.vt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Icon size helpers */
.vt-icon-sm {
  font-size: 1rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.vt-icon-md {
  font-size: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.vt-icon-lg {
  font-size: 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.vt-icon-xl {
  font-size: 2rem;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

/* ── 16. BLAZOR ────────────────────────────────────────────── */

/* Error UI — notificación floating */
#blazor-error-ui {
  color-scheme: light only;
  background: #1e293b;
  color: #f8fafc;
  bottom: 1.5rem;
  box-shadow: var(--vt-shadow-lg);
  box-sizing: border-box;
  display: none;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  position: fixed;
  width: auto;
  min-width: 300px;
  border-radius: var(--vt-radius-md);
  z-index: var(--vt-z-toast);
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#blazor-error-ui a {
  color: #818cf8;
  margin: 0 0.5rem;
  font-weight: 700;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  margin-left: 1rem;
  color: #94a3b8;
}

/* Error Boundary */
.blazor-error-boundary {
  background: var(--vt-error-bg);
  border: 1px solid var(--vt-error-border);
  border-radius: var(--vt-radius-lg);
  padding: 1.5rem;
  color: #7f1d1d;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.blazor-error-boundary::before {
  content: "⚠️";
  font-size: 1.5rem;
}

.blazor-error-boundary::after {
  content: "Ha ocurrido un error inesperado en este componente.";
}

/* Loading Progress */
.loading-progress {
  position: absolute;
  display: block;
  width: 6rem;
  height: 6rem;
  inset: 30vh 0 auto 0;
  margin: 0 auto;
}

.loading-progress circle {
  fill: none;
  stroke: var(--vt-border);
  stroke-width: 0.4rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: var(--vt-primary);
  stroke-linecap: round;
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.6), 500%;
  transition: stroke-dasharray 0.1s ease-in-out;
}

.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: 800;
  color: var(--vt-text-main);
  font-size: 0.85rem;
  inset: calc(30vh + 2.4rem) 0 auto 0;
}

.loading-progress-text:after {
  content: var(--blazor-load-percentage-text, "Cargando");
}

/* ── 17. MODO OSCURO ───────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    /* Superficies */
    --vt-bg: #0b0e14;
    --vt-surface: #0f1318;
    --vt-surface-soft: #14161a;
    --vt-surface-accent: rgba(0, 87, 255, 0.08);
    --vt-surface-overlay: rgba(0, 0, 0, 0.65);
    /* Texto */
    --vt-text-main: #f6f7f9;
    --vt-text-secondary: #c9d0de;
    --vt-text-muted: #8a95a8;
    --vt-text-disabled: #4a5268;
    /* Bordes */
    --vt-border: #1e2330;
    --vt-border-strong: #2e3446;
    /* Elevación */
    --vt-shadow-xs: 0 1px 4px rgba(0, 0, 0, 0.5);
    --vt-shadow-sm: 0 2px 6px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.45);
    --vt-shadow-md: 0 4px 12px rgba(0,0,0,0.55), 0 12px 36px rgba(0,0,0,0.5);
    --vt-shadow-lg: 0 8px 24px rgba(0,0,0,0.6), 0 20px 56px rgba(0,0,0,0.55);
    --vt-shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.7);
    /* Semánticos — fondos menos saturados en oscuro */
    --vt-success-bg: rgba(22, 163, 74, 0.1);
    --vt-success-border: rgba(22, 163, 74, 0.3);
    --vt-error-bg: rgba(220, 38, 38, 0.1);
    --vt-error-border: rgba(220, 38, 38, 0.3);
    --vt-warning-bg: rgba(217, 119, 6, 0.1);
    --vt-warning-border: rgba(217, 119, 6, 0.3);
    --vt-info-bg: rgba(2, 132, 199, 0.1);
    --vt-info-border: rgba(2, 132, 199, 0.3);
    /* gp aliases for components in dark mode */
    --gp-tertiary-soft: var(--vt-surface-soft);
    --gp-primary-soft: var(--vt-primary-light);
  }

  /* Dark mode card surface distinction */
  .vt-card,
  .vt-stat-card {
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 4px 20px rgba(0,0,0,0.5), 0 1px 6px rgba(0,0,0,0.4);
  }

  body {
    color-scheme: dark;
    background-color: var(--vt-bg);
    color: var(--vt-text-main);
  }

  /* Alertas en oscuro — texto más claro */
  .vt-alert-success {
    color: #86efac;
  }

  .vt-alert-error {
    color: #fca5a5;
  }

  .vt-alert-warning {
    color: #fcd34d;
  }

  .vt-alert-info {
    color: #7dd3fc;
  }

  /* Bootstrap overrides en oscuro */
  .text-muted {
    color: var(--vt-text-muted) !important;
  }

  .form-control,
  .form-select {
    color-scheme: dark;
  }
}

/* ── KEYFRAMES ─────────────────────────────────────────────── */
@keyframes vt-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes vt-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes vt-modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes vt-slide-in-right {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes vt-toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── 18. VICTORIA MOTION (PREMIUM UX) ────────────────────── */

/**
 * Revelación suave con desplazamiento ascendente.
 * Ideal para banners, cards o elementos que aparecen dinámicamente.
 */
.vic-fade-in {
  animation: vic-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

/**
 * Resplandor Esmeralda Premium.
 * Efecto de profundidad sutil con el color de marca.
 */
.vic-premium-glow {
  box-shadow: 0 0 15px -5px rgba(22, 195, 142, 0.5);
  transition: box-shadow 0.3s ease;
}

/**
 * Pulso Esmeralda.
 * Se utiliza para llamar la atención sobre elementos que se han reactivado 
 * o que requieren acción tras un periodo de espera.
 */
.vic-emerald-pulse {
    animation: vic-emerald-pulse 2s ease-in-out;
}

@keyframes vic-slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes vic-emerald-pulse {
    0% { box-shadow: 0 0 0 0 rgba(22, 195, 142, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(22, 195, 142, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 195, 142, 0); }
}
