/* ==========================================================================
   CPS Factura2026 - Tailwind CSS Autónomo Local (Sin CDN)
   Caja Petrolera de Salud • Modalidad 2 (Computarizada en Línea)
   Paleta Institucional: CPS Teal (#007b6d), Dark (#005c52), Light (#e6f5f3)
   ========================================================================== */

/* 1. RESET Y PREFLIGHT */
*, ::before, ::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  font-family: Arial, Helvetica, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-feature-settings: normal;
  font-variation-settings: normal;
}

body {
  margin: 0;
  line-height: inherit;
  color: #1f2937;
  background-color: #f9fafb;
}

hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
}

abbr:where([title]) {
  text-decoration: underline dotted;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  font-family: 'Century Gothic', Arial, sans-serif;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: inherit;
}

b, strong {
  font-weight: bolder;
}

code, kbd, samp, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1em;
}

small {
  font-size: 80%;
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

table {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}

button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button, select {
  text-transform: none;
}

button, [type='button'], [type='reset'], [type='submit'] {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
}

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

p {
  margin: 0;
}

/* 2. VARIABLES INSTITUCIONALES CPS */
:root {
  --cps-teal: #007b6d;
  --cps-teal-dark: #005c52;
  --cps-teal-light: #e6f5f3;
  --cps-teal-50: #e6f5f3;
  --cps-teal-100: #ccebe7;
  --cps-teal-500: #007b6d;
  --cps-teal-600: #006e62;
  --cps-teal-700: #005c52;
}

/* 3. CONTENEDORES Y ESTRUCTURA */
.container { width: 100%; }
@media (min-width: 640px) { .container { max-width: 640px; } }
@media (min-width: 768px) { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }

.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-full { max-width: 100%; }

.min-h-screen { min-height: 100vh; }
.h-full { height: 100%; }
.h-auto { height: auto; }
.h-16 { height: 4rem; }
.h-14 { height: 3.5rem; }
.h-12 { height: 3rem; }
.h-10 { height: 2.5rem; }
.h-8 { height: 2rem; }
.h-6 { height: 1.5rem; }
.h-5 { height: 1.25rem; }
.h-4 { height: 1rem; }
.h-2\.5 { height: 0.625rem; }

.w-full { width: 100%; }
.w-auto { width: auto; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333333%; }
.w-2\/3 { width: 66.666667%; }
.w-1\/4 { width: 25%; }
.w-3\/4 { width: 75%; }
.w-64 { width: 16rem; }
.w-48 { width: 12rem; }
.w-32 { width: 8rem; }
.w-24 { width: 6rem; }
.w-20 { width: 5rem; }
.w-16 { width: 4rem; }
.w-12 { width: 3rem; }
.w-8 { width: 2rem; }
.w-6 { width: 1.5rem; }
.w-5 { width: 1.25rem; }
.w-4 { width: 1rem; }
.w-2\.5 { width: 0.625rem; }
.min-w-full { min-width: 100%; }

/* 4. DISPLAY Y FLEXBOX */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.table { display: table; }
.table-auto { table-layout: auto; }

.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

.space-x-1 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.25rem; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }
.space-x-3 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.75rem; }
.space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 1rem; }
.space-x-6 > :not([hidden]) ~ :not([hidden]) { margin-left: 1.5rem; }
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-top: 2rem; }

/* 5. GRID SYSTEM */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-5 { grid-column: span 5 / span 5; }
.col-span-6 { grid-column: span 6 / span 6; }
.col-span-7 { grid-column: span 7 / span 7; }
.col-span-8 { grid-column: span 8 / span 8; }
.col-span-9 { grid-column: span 9 / span 9; }
.col-span-10 { grid-column: span 10 / span 10; }
.col-span-11 { grid-column: span 11 / span 11; }
.col-span-12 { grid-column: span 12 / span 12; }

@media (min-width: 640px) {
  .sm\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:col-span-1 { grid-column: span 1 / span 1; }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 1rem; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 768px) {
  .md\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .md\:col-span-1 { grid-column: span 1 / span 1; }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
  .md\:col-span-3 { grid-column: span 3 / span 3; }
  .md\:col-span-4 { grid-column: span 4 / span 4; }
  .md\:col-span-6 { grid-column: span 6 / span 6; }
  .md\:col-span-8 { grid-column: span 8 / span 8; }
  .md\:col-span-12 { grid-column: span 12 / span 12; }
  .md\:flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-1 { grid-column: span 1 / span 1; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:col-span-4 { grid-column: span 4 / span 4; }
  .lg\:col-span-5 { grid-column: span 5 / span 5; }
  .lg\:col-span-6 { grid-column: span 6 / span 6; }
  .lg\:col-span-7 { grid-column: span 7 / span 7; }
  .lg\:col-span-8 { grid-column: span 8 / span 8; }
  .lg\:col-span-9 { grid-column: span 9 / span 9; }
  .lg\:col-span-10 { grid-column: span 10 / span 10; }
  .lg\:col-span-11 { grid-column: span 11 / span 11; }
  .lg\:col-span-12 { grid-column: span 12 / span 12; }
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* 6. ESPACIADO (PADDING Y MARGIN) */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pl-3 { padding-left: 0.75rem; }
.pr-3 { padding-right: 0.75rem; }

.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }
.my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }

/* 7. TIPOGRAFÍA */
.font-sans { font-family: Arial, Helvetica, sans-serif; }
.font-gothic { font-family: 'Century Gothic', Arial, sans-serif; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-wide { letter-spacing: 0.025em; }
.whitespace-nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* 8. COLORES (CPS TEAL & ESTÁNDARES) */
.bg-cps { background-color: #007b6d; }
.bg-cps-dark { background-color: #005c52; }
.bg-cps-light { background-color: #e6f5f3; }
.bg-\[\#007b6d\] { background-color: #007b6d; }
.bg-\[\#005c52\] { background-color: #005c52; }
.bg-\[\#e6f5f3\] { background-color: #e6f5f3; }

.text-cps { color: #007b6d; }
.text-cps-dark { color: #005c52; }
.text-\[\#007b6d\] { color: #007b6d; }
.text-\[\#005c52\] { color: #005c52; }

.border-cps { border-color: #007b6d; }
.border-\[\#007b6d\] { border-color: #007b6d; }

/* Blancos, Grises y Negros */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-300 { background-color: #d1d5db; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-900 { background-color: #111827; }

.text-white { color: #ffffff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }

.border-white { border-color: #ffffff; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-gray-400 { border-color: #9ca3af; }

/* Teal Palette */
.bg-teal-50 { background-color: #f0fdfa; }
.bg-teal-100 { background-color: #ccfbf1; }
.bg-teal-200 { background-color: #99f6e4; }
.bg-teal-500 { background-color: #14b8a6; }
.bg-teal-600 { background-color: #0d9488; }
.bg-teal-700 { background-color: #0f766e; }
.text-teal-300 { color: #5eead4; }
.text-teal-600 { color: #0d9488; }
.text-teal-700 { color: #0f766e; }
.text-teal-800 { color: #115e59; }
.border-teal-200 { border-color: #99f6e4; }
.border-teal-300 { border-color: #5eead4; }
.border-teal-500 { border-color: #14b8a6; }

/* Verde / Éxito (Facturas Recepcionadas) */
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-500 { background-color: #22c55e; }
.bg-green-600 { background-color: #16a34a; }
.bg-green-700 { background-color: #15803d; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.border-green-200 { border-color: #bbf7d0; }
.border-green-500 { border-color: #22c55e; }

/* Rojo / Error / Anulación */
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-red-500 { background-color: #ef4444; }
.bg-red-600 { background-color: #dc2626; }
.bg-red-700 { background-color: #b91c1c; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-red-800 { color: #991b1b; }
.border-red-200 { border-color: #fecaca; }
.border-red-500 { border-color: #ef4444; }

/* Amarillo / Ámbar / Contingencia */
.bg-yellow-50, .bg-amber-50 { background-color: #fffbeb; }
.bg-yellow-100, .bg-amber-100 { background-color: #fef3c7; }
.bg-yellow-500, .bg-amber-500 { background-color: #f59e0b; }
.bg-yellow-600, .bg-amber-600 { background-color: #d97706; }
.text-yellow-700, .text-amber-700 { color: #b45309; }
.text-yellow-800, .text-amber-800 { color: #92400e; }
.border-yellow-200, .border-amber-200 { border-color: #fde68a; }
.border-yellow-500, .border-amber-500 { border-color: #f59e0b; }

/* Azul / En Proceso */
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.border-blue-200 { border-color: #bfdbfe; }
.border-blue-500 { border-color: #3b82f6; }

/* 9. BORDES Y SOMBRAS */
.border { border-width: 1px; }
.border-0 { border-width: 0; }
.border-2 { border-width: 2px; }
.border-4 { border-width: 4px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l { border-left-width: 1px; }
.border-r { border-right-width: 1px; }
.border-l-4 { border-left-width: 4px; }
.border-dashed { border-style: dashed; }
.border-dotted { border-style: dotted; }

.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: 0.125rem; }
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

.divide-y > :not([hidden]) ~ :not([hidden]) { border-top-width: 1px; border-color: #e5e7eb; }
.divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: #e5e7eb; }

/* 10. ESTILOS DE FORMULARIO */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  display: block;
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #111827;
  outline: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #007b6d !important;
  box-shadow: 0 0 0 3px rgba(0, 123, 109, 0.2) !important;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 0.25rem;
  border: 1px solid #d1d5db;
  color: #007b6d;
  accent-color: #007b6d;
  cursor: pointer;
}

/* 11. SISTEMA UNIVERSAL DE BOTONES CPS (ESTILO BOOTSTRAP CON PALETA INSTITUCIONAL) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, transform 0.1s ease-in-out;
  white-space: nowrap;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

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

.btn:focus-visible {
  outline: 2px solid #007b6d;
  outline-offset: 2px;
}

/* Tamaños de Botones */
.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  border-radius: 0.375rem;
  gap: 0.25rem;
}
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 0.375rem;
  gap: 0.375rem;
}
.btn-md {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
  gap: 0.5rem;
}
.btn-lg {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  border-radius: 0.625rem;
  gap: 0.5rem;
}
.btn-block, .btn-w-full {
  width: 100%;
}

/* Variantes Sólidas */
.btn-primary {
  background-color: #007b6d;
  border-color: #007b6d;
  color: #ffffff !important;
}
.btn-primary:hover {
  background-color: #005c52;
  border-color: #005c52;
  color: #ffffff !important;
}
.btn-primary:active {
  background-color: #004a42;
  border-color: #004a42;
}

.btn-secondary {
  background-color: #f3f4f6;
  border-color: #e5e7eb;
  color: #374151 !important;
}
.btn-secondary:hover {
  background-color: #e5e7eb;
  border-color: #d1d5db;
  color: #111827 !important;
}

.btn-dark {
  background-color: #111827;
  border-color: #111827;
  color: #ffffff !important;
}
.btn-dark:hover {
  background-color: #000000;
  border-color: #000000;
  color: #ffffff !important;
}

.btn-success {
  background-color: #059669;
  border-color: #059669;
  color: #ffffff !important;
}
.btn-success:hover {
  background-color: #047857;
  border-color: #047857;
  color: #ffffff !important;
}

.btn-danger {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff !important;
}
.btn-danger:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff !important;
}

.btn-warning {
  background-color: #d97706;
  border-color: #d97706;
  color: #ffffff !important;
}
.btn-warning:hover {
  background-color: #b45309;
  border-color: #b45309;
  color: #ffffff !important;
}

/* Variantes Outline (Bordes de Alto Contraste) */
.btn-outline-primary {
  background-color: #ffffff;
  border-color: #007b6d;
  color: #007b6d !important;
}
.btn-outline-primary:hover {
  background-color: #007b6d;
  border-color: #007b6d;
  color: #ffffff !important;
}

.btn-outline-secondary {
  background-color: #ffffff;
  border-color: #d1d5db;
  color: #4b5563 !important;
}
.btn-outline-secondary:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
  color: #111827 !important;
}

.btn-outline-danger {
  background-color: #ffffff;
  border-color: #f87171;
  color: #dc2626 !important;
}
.btn-outline-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff !important;
}

.btn-outline-success {
  background-color: #ffffff;
  border-color: #34d399;
  color: #059669 !important;
}
.btn-outline-success:hover {
  background-color: #059669;
  border-color: #059669;
  color: #ffffff !important;
}

.btn-outline-dark {
  background-color: #ffffff;
  border-color: #374151;
  color: #111827 !important;
}
.btn-outline-dark:hover {
  background-color: #111827;
  border-color: #111827;
  color: #ffffff !important;
}

/* Botón Manual de Usuario (Integrado al Sistema CPS) */
.btn-manual {
  background-color: #005249;
  border-color: rgba(45, 212, 191, 0.35);
  color: #ccfbf1 !important;
}
.btn-manual:hover {
  background-color: #003d36;
  border-color: rgba(45, 212, 191, 0.7);
  color: #ffffff !important;
}

/* Iconos Integrados en Botones */
.btn svg {
  flex-shrink: 0;
  pointer-events: none;
}
.btn-xs svg {
  width: 0.75rem;
  height: 0.75rem;
}
.btn-sm svg {
  width: 0.875rem;
  height: 0.875rem;
}
.btn-md svg {
  width: 1rem;
  height: 1rem;
}
.btn-lg svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* Estados Deshabilitados */
.btn:disabled, .btn.disabled, button:disabled, input:disabled, select:disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
}

.hover\:bg-\[\#005c52\]:hover { background-color: #005c52; }
.hover\:bg-cps-dark:hover { background-color: #005c52; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:bg-teal-700:hover { background-color: #0f766e; }
.hover\:bg-red-700:hover { background-color: #b91c1c; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:text-\[\#007b6d\]:hover { color: #007b6d; }

.transition { transition-property: color, background-color, border-color, box-shadow, transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* 12. ANIMACIONES */
@keyframes pulse {
  50% { opacity: .5; }
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 1s linear infinite;
}

/* 13. OVERFLOW Y POSICIONAMIENTO */
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: -webkit-sticky; position: sticky; }
.top-0 { top: 0; }
.top-2 { top: 0.5rem; }
.top-4 { top: 1rem; }
.top-6 { top: 1.5rem; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-\[9999\], .z-9999 { z-index: 9999; }

/* 13.1 LAYOUT DASHBOARD EMISIÓN FACTURA CPS (2 BLOQUES INQUEBRANTABLES: DATOS + TOTALES) */
.factura-dashboard-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 340px !important;
  gap: 1.5rem !important;
  align-items: start !important;
  width: 100% !important;
}

@media (min-width: 1280px) {
  .factura-dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 360px !important;
    gap: 1.75rem !important;
  }
}

@media (max-width: 768px) {
  .factura-dashboard-grid {
    grid-template-columns: 1fr !important;
  }
}

.factura-main-column {
  min-width: 0 !important;
  width: 100% !important;
}

.factura-sticky-sidebar {
  width: 100% !important;
  max-width: 380px !important;
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 1.5rem !important;
  z-index: 20 !important;
}

@media (max-width: 768px) {
  .factura-sticky-sidebar {
    position: static !important;
    max-width: 100% !important;
  }
}

/* 14. MODALES INSTITUCIONALES CPS */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-dialog {
  position: relative;
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* 15. IMPRESIÓN OFICIAL CPS */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
  }
  
  .no-print, header, footer, nav, button {
    display: none !important;
  }
  
  .ticket-80mm {
    width: 76mm !important;
    max-width: 76mm !important;
    margin: 0 auto !important;
    padding: 2mm !important;
    font-size: 8.5pt !important;
    line-height: 1.25 !important;
    font-family: Arial, monospace !important;
  }

  .page-carta {
    width: 215mm !important;
    margin: 0 auto !important;
    padding: 10mm !important;
  }
}

.break-all {
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

.break-words {
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}

/* 16. DROPDOWN MENUS (GROUP-HOVER & ZERO-GAP SYSTEM) */
.group {
  position: relative;
}

.group:hover > .group-hover\:block,
.group:focus-within > .group-hover\:block,
.group:hover .group-hover\:block {
  display: block !important;
}

.group:hover .group-hover\:opacity-100 {
  opacity: 1 !important;
}

/* CPS Navigation Dropdown System - Zero-gap, stable hover & click */
.nav-dropdown-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 6px;
  z-index: 60;
  display: none;
}

.nav-dropdown-menu.dropdown-right {
  left: auto;
  right: 0;
}

/* Invisible bridge preventing cursor mouseout during downward movement */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}

/* Active / Open states */
.nav-dropdown-group:hover > .nav-dropdown-menu,
.nav-dropdown-group:focus-within > .nav-dropdown-menu,
.nav-dropdown-group.menu-open > .nav-dropdown-menu {
  display: block !important;
}

.nav-dropdown-group:hover .nav-dropdown-arrow,
.nav-dropdown-group.menu-open .nav-dropdown-arrow {
  opacity: 1 !important;
  transform: rotate(180deg);
}

.nav-dropdown-arrow {
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-dropdown-card {
  background-color: #ffffff;
  color: #1f2937;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 0.375rem;
  min-width: 320px;
  width: max-content;
  max-width: 90vw;
}

@media (min-width: 640px) {
  .nav-dropdown-card {
    min-width: 340px;
  }
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.875rem;
  margin: 0.125rem 0.25rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: #374151;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus {
  background-color: #f0fdfa;
  color: #007b6d;
  font-weight: 600;
}

.nav-dropdown-item.item-active {
  background-color: #f0fdfa;
  color: #007b6d;
  font-weight: 700;
}

.nav-dropdown-divider {
  height: 1px;
  background-color: #f3f4f6;
  margin: 0.25rem 0.25rem;
}

