/* ==========================================================================
   DESIGN SYSTEM - Débora Masie & Asoc. Inmobiliaria
   Sistema de diseño base: variables, reset, tipografía, componentes y utilidades.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FUENTES - Google Fonts: Inter (cuerpo) + Outfit (encabezados)
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --------------------------------------------------------------------------
   2. VARIABLES PERSONALIZADAS (Custom Properties)
   -------------------------------------------------------------------------- */
:root {
  /* --- Paleta Primaria: Oro / Ámbar --- */
  --color-primary-50:  #fdf8eb;
  --color-primary-100: #f9edd0;
  --color-primary-200: #f2dba1;
  --color-primary-300: #e8c56b;
  --color-primary-400: #d4af37;
  --color-primary-500: #c9a84c;
  --color-primary-600: #b8941f;
  --color-primary-700: #9a7a18;
  --color-primary-800: #7d6214;
  --color-primary-900: #654f10;

  /* --- Fondos Oscuros (modo CRM / panel) --- */
  --color-dark-950: #0a0e12;
  --color-dark-900: #0f1419;
  --color-dark-800: #151b23;
  --color-dark-700: #1a1f2e;
  --color-dark-600: #1f2738;
  --color-dark-500: #242b3d;
  --color-dark-400: #2e3650;
  --color-dark-300: #3a4463;
  --color-dark-200: #4a5578;
  --color-dark-100: #64708d;

  /* --- Fondos Claros (sitio público) --- */
  --color-light-50:  #ffffff;
  --color-light-100: #fdfcfa;
  --color-light-200: #faf7f2;
  --color-light-300: #f5f0e8;
  --color-light-400: #efe8da;
  --color-light-500: #e8dcc8;
  --color-light-600: #d9cab0;
  --color-light-700: #c4b193;
  --color-light-800: #a99576;
  --color-light-900: #8a7a5f;

  /* --- Colores de Texto --- */
  --color-text-primary:   #1a1a1a;
  --color-text-secondary: #2d2d2d;
  --color-text-tertiary:  #4a4a4a;
  --color-text-muted:     #6b7280;
  --color-text-light:     #9ca3af;
  --color-text-inverse:   #f9fafb;
  --color-text-on-primary:#1a1a1a;

  /* --- Colores Semánticos --- */
  --color-success:     #22c55e;
  --color-success-bg:  #052e16;
  --color-success-light:#dcfce7;
  --color-warning:     #f59e0b;
  --color-warning-bg:  #422006;
  --color-warning-light:#fef3c7;
  --color-error:       #ef4444;
  --color-error-bg:    #450a0a;
  --color-error-light: #fee2e2;
  --color-info:        #3b82f6;
  --color-info-bg:     #172554;
  --color-info-light:  #dbeafe;

  /* --- Acento Contraste --- */
  --color-accent-navy:     #1a2332;
  --color-accent-charcoal: #2c3e50;

  /* --- Tipografía --- */
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Tamaños de fuente */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */

  /* Pesos tipográficos */
  --font-light:    300;
  --font-regular:  400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;
  --font-extrabold:800;

  /* Alturas de línea */
  --leading-none:    1;
  --leading-tight:   1.25;
  --leading-snug:    1.375;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;
  --leading-loose:   2;

  /* --- Espaciado (escala de 4px) --- */
  --space-0:  0;
  --space-1:  0.25rem;   /* 4px */
  --space-2:  0.5rem;    /* 8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-7:  1.75rem;   /* 28px */
  --space-8:  2rem;      /* 32px */
  --space-9:  2.25rem;   /* 36px */
  --space-10: 2.5rem;    /* 40px */
  --space-11: 2.75rem;   /* 44px */
  --space-12: 3rem;      /* 48px */
  --space-14: 3.5rem;    /* 56px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */

  /* --- Bordes Redondeados --- */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* --- Sombras --- */
  --shadow-xs:  0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm:  0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.25), 0 0 40px rgba(212, 175, 55, 0.1);
  --shadow-glow-sm: 0 0 10px rgba(212, 175, 55, 0.2);
  --shadow-glow-lg: 0 0 30px rgba(212, 175, 55, 0.3), 0 0 60px rgba(212, 175, 55, 0.15);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

  /* --- Transiciones --- */
  --transition-fast:   150ms ease-out;
  --transition-normal: 250ms ease-out;
  --transition-slow:   350ms ease-out;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Z-index --- */
  --z-base:     1;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-fixed:    300;
  --z-backdrop: 400;
  --z-modal:    500;
  --z-popover:  600;
  --z-tooltip:  700;
  --z-toast:    800;
  --z-max:      9999;

  /* --- Anchos Máximos --- */
  --max-width-sm:  640px;
  --max-width-md:  768px;
  --max-width-lg:  1024px;
  --max-width-xl:  1280px;
  --max-width-2xl: 1536px;

  /* --- Borde --- */
  --border-color:       rgba(255, 255, 255, 0.08);
  --border-color-light: rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   3. RESET MODERNO Y MINIMALISTA
   -------------------------------------------------------------------------- */

/* Box-sizing global */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Eliminar márgenes y paddings por defecto */
* {
  margin: 0;
  padding: 0;
}

/* Prevenir tamaño de fuente ajustado en dispositivos móviles */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
  tab-size: 4;
  -webkit-tap-highlight-color: transparent;
}

/* Estilos base del body */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-light-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Imágenes y medios responsivos */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Elementos de formulario heredan tipografía */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Evitar overflow de texto en párrafos */
p,
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Eliminar estilos de lista */
ul,
ol {
  list-style: none;
}

/* Enlaces base */
a {
  color: inherit;
  text-decoration: none;
}

/* Tablas */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Resumen (detalles) */
summary {
  cursor: pointer;
}

/* Eliminar bordes de fieldset */
fieldset {
  border: none;
}

/* Mejorar legibilidad de pre y code */
pre, code {
  font-family: var(--font-mono);
}

/* Elementos ocultos */
[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   4. TIPOGRAFÍA - Encabezados y textos
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
}

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-tertiary);
}

p + p {
  margin-top: var(--space-4);
}

/* Enlaces con estilo */
a:not([class]) {
  color: var(--color-primary-400);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

a:not([class]):hover {
  color: var(--color-primary-300);
  border-bottom-color: var(--color-primary-400);
}

/* Texto pequeño */
small {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Texto enfatizado */
strong, b {
  font-weight: var(--font-semibold);
}

/* Marca/resaltado */
mark {
  background: linear-gradient(120deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.35) 100%);
  padding: 0.1em 0.3em;
  border-radius: var(--radius-sm);
  color: inherit;
}

/* Código en línea */
code {
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--color-text-secondary);
}

/* Separador horizontal */
hr {
  border: none;
  height: 1px;
  background: var(--border-color-light);
  margin: var(--space-8) 0;
}

/* --------------------------------------------------------------------------
   5. ELEMENTOS DE FORMULARIO
   -------------------------------------------------------------------------- */

/* Input, Textarea, Select - Estilo base */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-light-50);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              background-color var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
input[type="datetime-local"]:hover,
textarea:hover,
select:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

/* Anillo de enfoque dorado - el toque premium */
.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15), var(--shadow-sm);
  background-color: var(--color-light-50);
}

/* Placeholder */
.form-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--color-text-light);
  opacity: 1;
}

/* Textarea */
textarea {
  min-height: 120px;
  resize: vertical;
}

/* Select - flecha personalizada */
select {
  padding-right: var(--space-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 16px;
  cursor: pointer;
}

/* Estado deshabilitado */
.form-input:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--color-light-300);
}

/* Estado de error en inputs */
.form-input.is-error,
input.is-error,
textarea.is-error,
select.is-error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Mensaje de error */
.form-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Label */
label,
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.form-label.required::after {
  content: ' *';
  color: var(--color-error);
}

/* Grupo de formulario */
.form-group {
  margin-bottom: var(--space-5);
}

/* Texto de ayuda */
.form-help {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* --- Checkbox personalizado --- */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
  position: relative;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  background-color: var(--color-light-50);
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.checkbox-wrapper input[type="checkbox"]:hover {
  border-color: var(--color-primary-400);
}

.checkbox-wrapper input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--color-primary-400), var(--color-primary-600));
  border-color: var(--color-primary-500);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-wrapper input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* --- Radio personalizado --- */
.radio-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.radio-wrapper input[type="radio"] {
  position: relative;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-full);
  background-color: var(--color-light-50);
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.radio-wrapper input[type="radio"]:checked {
  border-color: var(--color-primary-500);
  border-width: 6px;
}

.radio-wrapper input[type="radio"]:focus {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* --- Toggle / Switch --- */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: var(--radius-full);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--color-primary-400), var(--color-primary-600));
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* --------------------------------------------------------------------------
   6. BOTONES
   -------------------------------------------------------------------------- */

/* Botón base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: var(--leading-none);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Efecto ripple sutil */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10%);
  transform: scale(10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.8s;
}

.btn:active::after {
  transform: scale(0);
  opacity: 1;
  transition: 0s;
}

/* --- Botón Primario: Gradiente dorado premium --- */
.btn-primary {
  color: #1a1a1a;
  background: linear-gradient(135deg, var(--color-primary-300), var(--color-primary-400), var(--color-primary-500));
  border-color: var(--color-primary-500);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-200), var(--color-primary-300), var(--color-primary-400));
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3), 0 4px 16px rgba(212, 175, 55, 0.25);
}

/* --- Botón Secundario: Contorno elegante --- */
.btn-secondary {
  color: var(--color-primary-400);
  background: transparent;
  border-color: var(--color-primary-400);
}

.btn-secondary:hover {
  color: #1a1a1a;
  background: linear-gradient(135deg, var(--color-primary-300), var(--color-primary-400));
  box-shadow: var(--shadow-glow-sm);
  transform: translateY(-1px);
}

.btn-secondary:focus-visible {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* --- Botón de Peligro --- */
.btn-danger {
  color: white;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #dc2626;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* --- Botón Ghost (sin fondo, sin borde) --- */
.btn-ghost {
  color: var(--color-text-tertiary);
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.05);
}

/* --- Tamaños --- */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

/* --- Botón solo ícono --- */
.btn-icon {
  padding: var(--space-3);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
  padding: var(--space-2);
  width: 32px;
  height: 32px;
}

.btn-icon.btn-lg {
  padding: var(--space-4);
  width: 48px;
  height: 48px;
}

/* Ícono dentro de botones */
.btn svg,
.btn i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-lg svg,
.btn-lg i {
  width: 20px;
  height: 20px;
}

/* Grupo de botones */
.btn-group {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   7. TARJETAS (CARDS)
   -------------------------------------------------------------------------- */

.card {
  background: var(--color-light-50);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.card-header h3,
.card-header h4 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.01);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   8. BADGES / ETIQUETAS
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: var(--leading-normal);
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-success {
  color: #166534;
  background-color: #dcfce7;
}

.badge-warning {
  color: #854d0e;
  background-color: #fef3c7;
}

.badge-danger {
  color: #991b1b;
  background-color: #fee2e2;
}

.badge-info {
  color: #1e40af;
  background-color: #dbeafe;
}

.badge-neutral {
  color: var(--color-text-tertiary);
  background-color: rgba(0, 0, 0, 0.06);
}

.badge-primary {
  color: var(--color-primary-800);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(201, 168, 76, 0.2));
}

/* Badge con punto indicador */
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* --------------------------------------------------------------------------
   9. TABLAS
   -------------------------------------------------------------------------- */

.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
}

.table-container thead {
  background: rgba(0, 0, 0, 0.02);
}

.table-container th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.table-container td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  vertical-align: middle;
}

/* Filas alternas (zebra striping) */
.table-container tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

/* Hover en filas */
.table-container tbody tr {
  transition: background-color var(--transition-fast);
}

.table-container tbody tr:hover {
  background: rgba(212, 175, 55, 0.04);
}

/* Última fila sin borde inferior */
.table-container tbody tr:last-child td {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   10. ALERTAS / NOTIFICACIONES ESTÁTICAS
   -------------------------------------------------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  margin-bottom: var(--space-4);
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.alert-success {
  color: #166534;
  background-color: #f0fdf4;
  border-color: #bbf7d0;
}

.alert-warning {
  color: #854d0e;
  background-color: #fffbeb;
  border-color: #fde68a;
}

.alert-danger {
  color: #991b1b;
  background-color: #fef2f2;
  border-color: #fecaca;
}

.alert-info {
  color: #1e40af;
  background-color: #eff6ff;
  border-color: #bfdbfe;
}

/* Botón cerrar alerta */
.alert-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: currentColor;
  opacity: 0.5;
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: opacity var(--transition-fast);
}

.alert-close:hover {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   11. CLASES UTILITARIAS
   -------------------------------------------------------------------------- */

/* --- Display / Flexbox --- */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-row      { flex-direction: row; }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center   { justify-content: center; }
.justify-between  { justify-content: space-between; }
.justify-end      { justify-content: flex-end; }
.inline-flex   { display: inline-flex; }

/* --- Grid --- */
.grid          { display: grid; }
.grid-cols-2   { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3   { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4   { grid-template-columns: repeat(4, 1fr); }

/* --- Gap (espaciado) --- */
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-5  { gap: var(--space-5); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }

/* --- Texto --- */
.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-xs      { font-size: var(--text-xs); }
.text-sm      { font-size: var(--text-sm); }
.text-base    { font-size: var(--text-base); }
.text-lg      { font-size: var(--text-lg); }
.text-xl      { font-size: var(--text-xl); }
.text-2xl     { font-size: var(--text-2xl); }
.text-3xl     { font-size: var(--text-3xl); }
.text-muted   { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary-400); }
.font-medium  { font-weight: var(--font-medium); }
.font-semibold{ font-weight: var(--font-semibold); }
.font-bold    { font-weight: var(--font-bold); }
.uppercase    { text-transform: uppercase; }
.capitalize   { text-transform: capitalize; }
.tracking-wide { letter-spacing: 0.05em; }

/* --- Truncar texto --- */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Contenedor --- */
.container {
  width: 100%;
  max-width: var(--max-width-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 1280px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* --- Visibilidad --- */
.hidden  { display: none !important; }
.visible { visibility: visible; }

/* Accesibilidad: solo lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Márgenes y paddings comunes --- */
.m-0  { margin: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.ml-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0  { padding: 0; }
.p-2  { padding: var(--space-2); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }

/* --- Bordes --- */
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* --- Posicionamiento --- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { inset: 0; }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* --- Ancho y alto --- */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* --- Cursor --- */
.cursor-pointer { cursor: pointer; }

/* --- Separador visual --- */
.divider {
  height: 1px;
  background: var(--border-color-light);
  margin: var(--space-4) 0;
}

/* --- Avatar --- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid rgba(212, 175, 55, 0.2);
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 72px; height: 72px; }

/* Iniciales en avatar */
.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-primary-800);
  background: linear-gradient(135deg, var(--color-primary-100), var(--color-primary-200));
}

/* --------------------------------------------------------------------------
   12. RESPONSIVE - Breakpoints
   -------------------------------------------------------------------------- */

/* Ocultar según breakpoint */
@media (max-width: 767px) {
  .hide-mobile   { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hide-tablet   { display: none !important; }
}

@media (min-width: 1024px) {
  .hide-desktop  { display: none !important; }
}

/* Solo visible en ciertos breakpoints */
@media (min-width: 768px) {
  .show-mobile-only { display: none !important; }
}

@media (max-width: 767px) {
  .show-tablet-up { display: none !important; }
  .show-desktop-only { display: none !important; }

  /* Grid responsivo en móvil */
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .show-desktop-only { display: none !important; }

  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   13. ANIMACIONES - @keyframes
   -------------------------------------------------------------------------- */

/* Aparecer con fade */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Aparecer con fade (reverse) */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Deslizar hacia arriba */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Deslizar hacia abajo */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Deslizar desde la derecha */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Deslizar desde la izquierda */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Pulso */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Giro continuo (spinners) */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Escalar suavemente */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Rebote suave */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Brillo dorado */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Clases de animación */
.animate-fade-in     { animation: fadeIn var(--transition-normal) forwards; }
.animate-slide-up    { animation: slideUp var(--transition-normal) forwards; }
.animate-slide-down  { animation: slideDown var(--transition-normal) forwards; }
.animate-scale-in    { animation: scaleIn var(--transition-normal) forwards; }
.animate-pulse       { animation: pulse 2s infinite; }
.animate-spin        { animation: spin 1s linear infinite; }
.animate-bounce      { animation: bounce 1s infinite; }

/* Delay progresivo para listas animadas */
.animate-delay-1 { animation-delay: 50ms; }
.animate-delay-2 { animation-delay: 100ms; }
.animate-delay-3 { animation-delay: 150ms; }
.animate-delay-4 { animation-delay: 200ms; }
.animate-delay-5 { animation-delay: 250ms; }

/* --------------------------------------------------------------------------
   14. SCROLLBAR PERSONALIZADO
   -------------------------------------------------------------------------- */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 100, 100, 0.3) transparent;
}

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(100, 100, 100, 0.3);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 100, 100, 0.5);
}

/* En contenedores oscuros, el scrollbar es más claro */
.dark-scrollbar {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.dark-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.15);
}

.dark-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

/* --------------------------------------------------------------------------
   15. SELECCIÓN DE TEXTO
   -------------------------------------------------------------------------- */

::selection {
  background-color: rgba(212, 175, 55, 0.25);
  color: inherit;
}

/* --------------------------------------------------------------------------
   16. FOCUS VISIBLE - Accesibilidad mejorada
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--color-primary-400);
  outline-offset: 2px;
}

/* Quitar outline en foco por mouse */
:focus:not(:focus-visible) {
  outline: none;
}

/* --------------------------------------------------------------------------
   17. PRINT STYLES - Estilos para impresión
   -------------------------------------------------------------------------- */

@media print {
  body {
    color: #000;
    background: #fff;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  .no-print {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
