/* =====================================================================
   theme.css  -  Sistema de diseño único de Veterinaria Mizrahi
   Se carga DESPUÉS de style.css. No requiere compilar nada.

   1) Paleta unificada: azul (principal) + cian (marca) + slate (neutros)
      + esmeralda (ok / dinero) + ámbar (aviso) + rojo (deuda / peligro).
      Cualquier clase vieja de otro color (purple, indigo, violet, green,
      yellow, orange, rose, teal, sky, gray) se reasigna a esta paleta,
      también en lo que arma el JavaScript (filas, badges, etc.).
   2) Componentes comunes: .vm-header, .vm-page, .vm-card, .vm-thead...
   ===================================================================== */

/* ---------- 1. PALETA ---------- */
:root {
  --vm-blue-50: oklch(97% 0.014 254.604);   --vm-blue-100: oklch(93.2% 0.032 255.585);
  --vm-blue-200: oklch(88.2% 0.059 254.128); --vm-blue-300: oklch(80.9% 0.105 251.813);
  --vm-blue-400: oklch(70.7% 0.165 254.624); --vm-blue-500: oklch(62.3% 0.214 259.815);
  --vm-blue-600: oklch(54.6% 0.245 262.881); --vm-blue-700: oklch(48.8% 0.243 264.376);
  --vm-blue-800: oklch(42.4% 0.199 265.638); --vm-blue-900: oklch(37.9% 0.146 265.522);
  --vm-blue-950: oklch(28.2% 0.091 267.935);

  --vm-cyan-50: oklch(98.4% 0.019 200.873);  --vm-cyan-100: oklch(95.6% 0.045 203.388);
  --vm-cyan-200: oklch(91.7% 0.08 205.041);  --vm-cyan-300: oklch(86.5% 0.127 207.078);
  --vm-cyan-400: oklch(78.9% 0.154 211.53);  --vm-cyan-500: oklch(71.5% 0.143 215.221);
  --vm-cyan-600: oklch(60.9% 0.126 221.723); --vm-cyan-700: oklch(52% 0.105 223.128);
  --vm-cyan-800: oklch(45% 0.085 224.283);   --vm-cyan-900: oklch(39.8% 0.07 227.392);
  --vm-cyan-950: oklch(30.2% 0.056 229.695);

  --vm-slate-50: oklch(98.4% 0.003 247.858); --vm-slate-100: oklch(96.8% 0.007 247.896);
  --vm-slate-200: oklch(92.9% 0.013 255.508); --vm-slate-300: oklch(86.9% 0.022 252.894);
  --vm-slate-400: oklch(70.4% 0.04 256.788); --vm-slate-500: oklch(55.4% 0.046 257.417);
  --vm-slate-600: oklch(44.6% 0.043 257.281); --vm-slate-700: oklch(37.2% 0.044 257.287);
  --vm-slate-800: oklch(27.9% 0.041 260.031); --vm-slate-900: oklch(20.8% 0.042 265.755);
  --vm-slate-950: oklch(12.9% 0.042 264.695);

  --vm-emerald-50: oklch(97.9% 0.021 166.113); --vm-emerald-100: oklch(95% 0.052 163.051);
  --vm-emerald-200: oklch(90.5% 0.093 164.15); --vm-emerald-300: oklch(84.5% 0.143 164.978);
  --vm-emerald-400: oklch(76.5% 0.177 163.223); --vm-emerald-500: oklch(69.6% 0.17 162.48);
  --vm-emerald-600: oklch(59.6% 0.145 163.225); --vm-emerald-700: oklch(50.8% 0.118 165.612);
  --vm-emerald-800: oklch(43.2% 0.095 166.913); --vm-emerald-900: oklch(37.8% 0.077 168.94);
  --vm-emerald-950: oklch(26.2% 0.051 172.552);

  --vm-amber-50: oklch(98.7% 0.022 95.277);  --vm-amber-100: oklch(96.2% 0.059 95.617);
  --vm-amber-200: oklch(92.4% 0.12 95.746);  --vm-amber-300: oklch(87.9% 0.169 91.605);
  --vm-amber-400: oklch(82.8% 0.189 84.429); --vm-amber-500: oklch(76.9% 0.188 70.08);
  --vm-amber-600: oklch(66.6% 0.179 58.318); --vm-amber-700: oklch(55.5% 0.163 48.998);
  --vm-amber-800: oklch(47.3% 0.137 46.201); --vm-amber-900: oklch(41.4% 0.112 45.904);
  --vm-amber-950: oklch(27.9% 0.077 45.635);

  --vm-red-50: oklch(97.1% 0.013 17.38);     --vm-red-100: oklch(93.6% 0.032 17.717);
  --vm-red-200: oklch(88.5% 0.062 18.334);   --vm-red-300: oklch(80.8% 0.114 19.571);
  --vm-red-400: oklch(70.4% 0.191 22.216);   --vm-red-500: oklch(63.7% 0.237 25.331);
  --vm-red-600: oklch(57.7% 0.245 27.325);   --vm-red-700: oklch(50.5% 0.213 27.518);
  --vm-red-800: oklch(44.4% 0.177 26.899);   --vm-red-900: oklch(39.6% 0.141 25.723);
  --vm-red-950: oklch(25.8% 0.092 26.042);
}

/* Reasignación de familias de color a la paleta única (ver comentario arriba).
   Se usa @property-free custom properties: Tailwind v4 lee estas variables. */
:root {
  /* neutros */
  --color-gray-50: var(--vm-slate-50);   --color-gray-100: var(--vm-slate-100);
  --color-gray-200: var(--vm-slate-200); --color-gray-300: var(--vm-slate-300);
  --color-gray-400: var(--vm-slate-400); --color-gray-500: var(--vm-slate-500);
  --color-gray-600: var(--vm-slate-600); --color-gray-700: var(--vm-slate-700);
  --color-gray-800: var(--vm-slate-800); --color-gray-900: var(--vm-slate-900);
}

:root {
  /* purple -> blue */
  --color-purple-50: var(--vm-blue-50); --color-purple-100: var(--vm-blue-100); --color-purple-200: var(--vm-blue-200); --color-purple-300: var(--vm-blue-300); --color-purple-400: var(--vm-blue-400); --color-purple-500: var(--vm-blue-500); --color-purple-600: var(--vm-blue-600); --color-purple-700: var(--vm-blue-700); --color-purple-800: var(--vm-blue-800); --color-purple-900: var(--vm-blue-900); --color-purple-950: var(--vm-blue-950);
  /* violet -> blue */
  --color-violet-50: var(--vm-blue-50); --color-violet-100: var(--vm-blue-100); --color-violet-200: var(--vm-blue-200); --color-violet-300: var(--vm-blue-300); --color-violet-400: var(--vm-blue-400); --color-violet-500: var(--vm-blue-500); --color-violet-600: var(--vm-blue-600); --color-violet-700: var(--vm-blue-700); --color-violet-800: var(--vm-blue-800); --color-violet-900: var(--vm-blue-900); --color-violet-950: var(--vm-blue-950);
  /* indigo -> blue */
  --color-indigo-50: var(--vm-blue-50); --color-indigo-100: var(--vm-blue-100); --color-indigo-200: var(--vm-blue-200); --color-indigo-300: var(--vm-blue-300); --color-indigo-400: var(--vm-blue-400); --color-indigo-500: var(--vm-blue-500); --color-indigo-600: var(--vm-blue-600); --color-indigo-700: var(--vm-blue-700); --color-indigo-800: var(--vm-blue-800); --color-indigo-900: var(--vm-blue-900); --color-indigo-950: var(--vm-blue-950);
  /* fuchsia -> blue */
  --color-fuchsia-50: var(--vm-blue-50); --color-fuchsia-100: var(--vm-blue-100); --color-fuchsia-200: var(--vm-blue-200); --color-fuchsia-300: var(--vm-blue-300); --color-fuchsia-400: var(--vm-blue-400); --color-fuchsia-500: var(--vm-blue-500); --color-fuchsia-600: var(--vm-blue-600); --color-fuchsia-700: var(--vm-blue-700); --color-fuchsia-800: var(--vm-blue-800); --color-fuchsia-900: var(--vm-blue-900); --color-fuchsia-950: var(--vm-blue-950);
  /* pink -> blue */
  --color-pink-50: var(--vm-blue-50); --color-pink-100: var(--vm-blue-100); --color-pink-200: var(--vm-blue-200); --color-pink-300: var(--vm-blue-300); --color-pink-400: var(--vm-blue-400); --color-pink-500: var(--vm-blue-500); --color-pink-600: var(--vm-blue-600); --color-pink-700: var(--vm-blue-700); --color-pink-800: var(--vm-blue-800); --color-pink-900: var(--vm-blue-900); --color-pink-950: var(--vm-blue-950);
  /* sky -> cyan */
  --color-sky-50: var(--vm-cyan-50); --color-sky-100: var(--vm-cyan-100); --color-sky-200: var(--vm-cyan-200); --color-sky-300: var(--vm-cyan-300); --color-sky-400: var(--vm-cyan-400); --color-sky-500: var(--vm-cyan-500); --color-sky-600: var(--vm-cyan-600); --color-sky-700: var(--vm-cyan-700); --color-sky-800: var(--vm-cyan-800); --color-sky-900: var(--vm-cyan-900); --color-sky-950: var(--vm-cyan-950);
  /* teal -> cyan */
  --color-teal-50: var(--vm-cyan-50); --color-teal-100: var(--vm-cyan-100); --color-teal-200: var(--vm-cyan-200); --color-teal-300: var(--vm-cyan-300); --color-teal-400: var(--vm-cyan-400); --color-teal-500: var(--vm-cyan-500); --color-teal-600: var(--vm-cyan-600); --color-teal-700: var(--vm-cyan-700); --color-teal-800: var(--vm-cyan-800); --color-teal-900: var(--vm-cyan-900); --color-teal-950: var(--vm-cyan-950);
  /* green -> emerald */
  --color-green-50: var(--vm-emerald-50); --color-green-100: var(--vm-emerald-100); --color-green-200: var(--vm-emerald-200); --color-green-300: var(--vm-emerald-300); --color-green-400: var(--vm-emerald-400); --color-green-500: var(--vm-emerald-500); --color-green-600: var(--vm-emerald-600); --color-green-700: var(--vm-emerald-700); --color-green-800: var(--vm-emerald-800); --color-green-900: var(--vm-emerald-900); --color-green-950: var(--vm-emerald-950);
  /* lime -> emerald */
  --color-lime-50: var(--vm-emerald-50); --color-lime-100: var(--vm-emerald-100); --color-lime-200: var(--vm-emerald-200); --color-lime-300: var(--vm-emerald-300); --color-lime-400: var(--vm-emerald-400); --color-lime-500: var(--vm-emerald-500); --color-lime-600: var(--vm-emerald-600); --color-lime-700: var(--vm-emerald-700); --color-lime-800: var(--vm-emerald-800); --color-lime-900: var(--vm-emerald-900); --color-lime-950: var(--vm-emerald-950);
  /* yellow -> amber */
  --color-yellow-50: var(--vm-amber-50); --color-yellow-100: var(--vm-amber-100); --color-yellow-200: var(--vm-amber-200); --color-yellow-300: var(--vm-amber-300); --color-yellow-400: var(--vm-amber-400); --color-yellow-500: var(--vm-amber-500); --color-yellow-600: var(--vm-amber-600); --color-yellow-700: var(--vm-amber-700); --color-yellow-800: var(--vm-amber-800); --color-yellow-900: var(--vm-amber-900); --color-yellow-950: var(--vm-amber-950);
  /* orange -> amber */
  --color-orange-50: var(--vm-amber-50); --color-orange-100: var(--vm-amber-100); --color-orange-200: var(--vm-amber-200); --color-orange-300: var(--vm-amber-300); --color-orange-400: var(--vm-amber-400); --color-orange-500: var(--vm-amber-500); --color-orange-600: var(--vm-amber-600); --color-orange-700: var(--vm-amber-700); --color-orange-800: var(--vm-amber-800); --color-orange-900: var(--vm-amber-900); --color-orange-950: var(--vm-amber-950);
  /* rose -> red */
  --color-rose-50: var(--vm-red-50); --color-rose-100: var(--vm-red-100); --color-rose-200: var(--vm-red-200); --color-rose-300: var(--vm-red-300); --color-rose-400: var(--vm-red-400); --color-rose-500: var(--vm-red-500); --color-rose-600: var(--vm-red-600); --color-rose-700: var(--vm-red-700); --color-rose-800: var(--vm-red-800); --color-rose-900: var(--vm-red-900); --color-rose-950: var(--vm-red-950);
  /* blue (propia) */
  --color-blue-50: var(--vm-blue-50); --color-blue-100: var(--vm-blue-100); --color-blue-200: var(--vm-blue-200); --color-blue-300: var(--vm-blue-300); --color-blue-400: var(--vm-blue-400); --color-blue-500: var(--vm-blue-500); --color-blue-600: var(--vm-blue-600); --color-blue-700: var(--vm-blue-700); --color-blue-800: var(--vm-blue-800); --color-blue-900: var(--vm-blue-900); --color-blue-950: var(--vm-blue-950);
  /* cyan (propia) */
  --color-cyan-50: var(--vm-cyan-50); --color-cyan-100: var(--vm-cyan-100); --color-cyan-200: var(--vm-cyan-200); --color-cyan-300: var(--vm-cyan-300); --color-cyan-400: var(--vm-cyan-400); --color-cyan-500: var(--vm-cyan-500); --color-cyan-600: var(--vm-cyan-600); --color-cyan-700: var(--vm-cyan-700); --color-cyan-800: var(--vm-cyan-800); --color-cyan-900: var(--vm-cyan-900); --color-cyan-950: var(--vm-cyan-950);
  /* slate (propia) */
  --color-slate-50: var(--vm-slate-50); --color-slate-100: var(--vm-slate-100); --color-slate-200: var(--vm-slate-200); --color-slate-300: var(--vm-slate-300); --color-slate-400: var(--vm-slate-400); --color-slate-500: var(--vm-slate-500); --color-slate-600: var(--vm-slate-600); --color-slate-700: var(--vm-slate-700); --color-slate-800: var(--vm-slate-800); --color-slate-900: var(--vm-slate-900); --color-slate-950: var(--vm-slate-950);
  /* emerald (propia) */
  --color-emerald-50: var(--vm-emerald-50); --color-emerald-100: var(--vm-emerald-100); --color-emerald-200: var(--vm-emerald-200); --color-emerald-300: var(--vm-emerald-300); --color-emerald-400: var(--vm-emerald-400); --color-emerald-500: var(--vm-emerald-500); --color-emerald-600: var(--vm-emerald-600); --color-emerald-700: var(--vm-emerald-700); --color-emerald-800: var(--vm-emerald-800); --color-emerald-900: var(--vm-emerald-900); --color-emerald-950: var(--vm-emerald-950);
  /* amber (propia) */
  --color-amber-50: var(--vm-amber-50); --color-amber-100: var(--vm-amber-100); --color-amber-200: var(--vm-amber-200); --color-amber-300: var(--vm-amber-300); --color-amber-400: var(--vm-amber-400); --color-amber-500: var(--vm-amber-500); --color-amber-600: var(--vm-amber-600); --color-amber-700: var(--vm-amber-700); --color-amber-800: var(--vm-amber-800); --color-amber-900: var(--vm-amber-900); --color-amber-950: var(--vm-amber-950);
  /* red (propia) */
  --color-red-50: var(--vm-red-50); --color-red-100: var(--vm-red-100); --color-red-200: var(--vm-red-200); --color-red-300: var(--vm-red-300); --color-red-400: var(--vm-red-400); --color-red-500: var(--vm-red-500); --color-red-600: var(--vm-red-600); --color-red-700: var(--vm-red-700); --color-red-800: var(--vm-red-800); --color-red-900: var(--vm-red-900); --color-red-950: var(--vm-red-950);
}

/* ---------- 2. COMPONENTES COMUNES ---------- */
@layer base {
  /* Tailwind v4 usa currentColor para los bordes: lo llevamos a un gris suave por defecto */
  *, ::after, ::before, ::backdrop, ::file-selector-button { border-color: var(--vm-slate-200); }
}

@layer components {
  body { font-family: var(--font-sans); color: var(--vm-slate-800); background-color: var(--vm-slate-50); -webkit-font-smoothing: antialiased; }

  /* Cabecera */
  .vm-header {
    background-image: linear-gradient(to right, var(--vm-blue-900), var(--vm-cyan-700));
    color: #fff;
    border-bottom: 4px solid var(--vm-cyan-400);
    box-shadow: 0 1px 3px rgb(0 0 0 / .12), 0 1px 2px rgb(0 0 0 / .08);
    margin-bottom: 1.5rem;
    position: relative; z-index: 40;
  }
  .vm-header > div {
    max-width: 1600px; margin: 0 auto; padding: 1rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  }
  .vm-brand { display: flex; align-items: center; gap: 1rem; min-width: 0; }
  .vm-logo {
    width: 3rem; height: 3rem; flex: none; padding: .25rem; background: #fff; border-radius: .75rem;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    box-shadow: inset 0 1px 2px rgb(0 0 0 / .08); color: var(--vm-blue-900); font-weight: 900;
  }
  .vm-logo img { width: 100%; height: 100%; object-fit: contain; }
  .vm-title { font-size: 1.25rem; line-height: 1.25; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
  .vm-subtitle { margin-top: .125rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--vm-cyan-100); }
  @media (min-width: 768px) { .vm-title { font-size: 1.5rem; } }

  /* Inicio: cabecera más grande */
  .vm-header-lg > div { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .vm-header-lg .vm-logo { width: 4.5rem; height: 4.5rem; border-radius: 1rem; }
  .vm-header-lg .vm-title { font-size: 1.5rem; letter-spacing: .08em; }
  @media (min-width: 768px) { .vm-header-lg .vm-title { font-size: 1.875rem; } }

  /* Contenedor de página */
  .vm-page { max-width: 1600px; margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; }
  .vm-page-narrow { max-width: 800px; }

  /* Tarjeta */
  .vm-card {
    background: #fff; border: 1px solid var(--vm-slate-200); border-radius: 1rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / .06); padding: 1.5rem;
  }
  .vm-card-title {
    display: flex; align-items: center; gap: .5rem;
    padding-bottom: .75rem; margin-bottom: 1rem; border-bottom: 1px solid var(--vm-slate-100);
    font-size: 1.0625rem; line-height: 1.4; font-weight: 900; color: var(--vm-slate-800);
  }
  .vm-card-sub { margin-top: .125rem; font-size: .8125rem; font-weight: 600; color: var(--vm-slate-500); }

  /* Cabecera de tablas */
  .vm-thead { background: var(--vm-slate-50); color: var(--vm-slate-600); box-shadow: inset 0 -1px 0 var(--vm-slate-200); }
  .vm-thead th {
    padding: .75rem 1rem; font-size: .6875rem; line-height: 1rem; font-weight: 800;
    letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  }

  /* Etiquetas de formulario */
  .vm-label { display: block; margin-bottom: .25rem; font-size: .6875rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--vm-slate-500); }
}

/* ---------- 3. DETALLES GLOBALES (sin capa: ganan sobre el reset) ---------- */
:focus-visible { outline: 2px solid var(--vm-blue-500); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: none; }
::selection { background: var(--vm-cyan-200); color: var(--vm-slate-900); }
table { border-color: var(--vm-slate-200); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--vm-slate-300); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--vm-slate-400); background-clip: content-box; border: 2px solid transparent; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--vm-blue-600); }

@media print {
  .vm-header { display: none !important; }
}

.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ---------- 4. ESTILO "MENÚ / LOGIN" PARA TODAS LAS PANTALLAS (v17) ----------
   Fondo estático (sin capas fijas ni desenfoque, para que el scroll sea fluido),
   paneles con sombra suave y detalle de color, tablas más prolijas. */
body.bg-slate-50 {
  background-color: #f4f8ff;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 24 24' fill='%231e3a8a' fill-opacity='0.035'%3E%3Cellipse cx='6.5' cy='9' rx='1.7' ry='2.3'/%3E%3Cellipse cx='11' cy='6' rx='1.7' ry='2.3'/%3E%3Cellipse cx='15.5' cy='7' rx='1.7' ry='2.3'/%3E%3Cellipse cx='19' cy='11' rx='1.5' ry='2.1'/%3E%3Cpath d='M12 11c-3 0-5.5 3-5.5 5.6 0 1.8 1.4 2.6 2.7 2.6 1 0 1.8-.5 2.8-.5s1.8.5 2.8.5c1.3 0 2.7-.8 2.7-2.6C17.5 14 15 11 12 11z'/%3E%3C/svg%3E"),
    radial-gradient(900px 420px at 92% 0%, rgba(6,182,212,.14), transparent 70%),
    linear-gradient(180deg, #eaf2ff 0%, #f4f8ff 40%, #f8fbff 100%);
  background-size: 110px 110px, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat;
}

/* Paneles: borde suave, sombra azulada y franja de color a la izquierda */
.vm-card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 1.25rem;
  box-shadow: 0 8px 22px -16px rgba(30,64,175,.35);
}
.vm-card::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--vm-blue-600), var(--vm-cyan-500));
}
.vm-card .vm-card::before { display: none; }
.vm-card .vm-card { box-shadow: none; border-radius: 1rem; }
.vm-card-title {
  font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--vm-slate-900);
  border-bottom-color: rgba(148,163,184,.25);
}

/* Tablas: cabecera con tinte azul y filas con hover suave */
.vm-thead { background: linear-gradient(180deg, #f1f6ff, #e9f1ff); color: var(--vm-blue-900); box-shadow: inset 0 -1px 0 rgba(30,64,175,.14); }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background-color: rgba(219,234,254,.45); }

/* Campos: bordes más suaves y foco visible en azul */
input:not([type="checkbox"]):not([type="radio"]), select, textarea { border-color: rgba(148,163,184,.55); }
input:focus, select:focus, textarea:focus { border-color: var(--vm-blue-500); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* Botones principales azules: degradé como en login */
button.bg-blue-600, a.bg-blue-600 { background-image: linear-gradient(135deg, var(--vm-blue-700), var(--vm-cyan-600)); }

/* v21: la insignia "📍 MITRE" de las listas no se parte en dos renglones */
span.align-middle.font-black.shadow-sm { display: inline-block; white-space: nowrap; }
