:root {
  --text: #6b6375;
  --text-h: #08060d;
  --bg: #fff;
  --border: #e5e4e7;
  --code-bg: #f4f3ec;
  --accent: #aa3bff;
  --accent-bg: rgba(170, 59, 255, 0.1);
  --accent-border: rgba(170, 59, 255, 0.5);
  --social-bg: rgba(244, 243, 236, 0.5);
  --shadow:
    rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;

  --sans: system-ui, 'Segoe UI', Roboto, sans-serif;
  --heading: system-ui, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, Consolas, monospace;

  font: 18px/145% var(--sans);
  letter-spacing: 0.18px;
  color-scheme: light dark;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  @media (max-width: 1024px) {
    font-size: 16px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #9ca3af;
    --text-h: #f3f4f6;
    --bg: #16171d;
    --border: #2e303a;
    --code-bg: #1f2028;
    --accent: #c084fc;
    --accent-bg: rgba(192, 132, 252, 0.15);
    --accent-border: rgba(192, 132, 252, 0.5);
    --social-bg: rgba(47, 48, 58, 0.5);
    --shadow:
      rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
  }

  #social .button-icon {
    filter: invert(1) brightness(2);
  }
}

body {
  margin: 0;
}

#root {
  width: 1126px;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  border-inline: 1px solid var(--border);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

h1,
h2 {
  font-family: var(--heading);
  font-weight: 500;
  color: var(--text-h);
}

h1 {
  font-size: 56px;
  letter-spacing: -1.68px;
  margin: 32px 0;
  @media (max-width: 1024px) {
    font-size: 36px;
    margin: 20px 0;
  }
}
h2 {
  font-size: 24px;
  line-height: 118%;
  letter-spacing: -0.24px;
  margin: 0 0 8px;
  @media (max-width: 1024px) {
    font-size: 20px;
  }
}
p {
  margin: 0;
}

code,
.counter {
  font-family: var(--mono);
  display: inline-flex;
  border-radius: 4px;
  color: var(--text-h);
}

code {
  font-size: 15px;
  line-height: 135%;
  padding: 4px 8px;
  background: var(--code-bg);
}

/* =========================================================
   FIX MOVIL — CAMPOS INPUT/TEXTAREA/SELECT CON TEXTO INVISIBLE
   Fecha: 2026-06-12
   Motivo: En celulares algunos campos manuales heredaban texto blanco
   o modo oscuro del navegador, haciendo invisible lo escrito.
   ========================================================= */

html {
  color-scheme: light;
}

input,
textarea,
select {
  color: #111827 !important;
  background-color: #ffffff !important;
  -webkit-text-fill-color: #111827 !important;
  caret-color: #111827 !important;
  opacity: 1 !important;
}

input:focus,
textarea:focus,
select:focus {
  color: #111827 !important;
  background-color: #ffffff !important;
  -webkit-text-fill-color: #111827 !important;
  caret-color: #111827 !important;
  outline-color: #dc2626;
}

input::placeholder,
textarea::placeholder {
  color: #6b7280 !important;
  -webkit-text-fill-color: #6b7280 !important;
  opacity: 1 !important;
}

select option {
  color: #111827 !important;
  background-color: #ffffff !important;
}

/* Corrige autocompletado amarillo/oscuro de Chrome y móviles */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #111827 !important;
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
  caret-color: #111827 !important;
}

/* Evita zoom raro en iPhone/Android al tocar campos pequeños */
input,
textarea,
select {
  font-size: 16px;
}



/* QA2-F10-01G-FIX-CONTRASTE-GLOBAL */
:root {
  color-scheme: light !important;
  --text: #64748b !important;
  --text-h: #0f172a !important;
  --bg: #f3f5f8 !important;
  --border: #e5e7eb !important;
}

#root,
body,
.app,
.dashboard {
  color: #0f172a !important;
  background: #f3f5f8;
}

#root h1,
#root h2,
#root h3,
#root .card h1,
#root .card h2,
#root .card h3,
#root .topbar h1,
#root .topbar h2,
#root .topbar h3,
#root .module h1,
#root .module h2,
#root .module h3 {
  color: #0f172a !important;
  opacity: 1 !important;
}

#root p,
#root .muted,
#root .card p,
#root .module p,
#root .topbar p {
  color: #64748b;
}

#root button {
  color: inherit;
}

#root button:not(.secondary) {
  color: #ffffff !important;
}

#root button.secondary {
  color: #111827 !important;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f3f5f8;
  color: #0f172a;
}

button {
  border: 0;
  background: #111827;
  color: white;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #111827, #1f2937);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: white;
  padding: 36px;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.login-card h1 {
  font-size: clamp(24px, 7vw, 48px);
  margin: 0;
  letter-spacing: -2px;
}

.login-card p {
  margin-top: 0;
  color: #64748b;
}

.login-card label,
.field span {
  display: block;
  margin: 18px 0 8px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 16px;
  background: white;
}

.login-card button {
  width: 100%;
  margin-top: 24px;
}

.app {
  min-height: 100vh;
  padding: 36px;
}

.dashboard {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.topbar {
  background: white;
  border-radius: 18px;
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 14px 34px rgba(15,23,42,0.08);
}

.topbar h1 {
  font-size: clamp(24px, 4vw, 48px);
  margin: 0;
  letter-spacing: -2px;
}

.topbar p {
  margin: 4px 0 0;
  color: #64748b;
}

.card,
.module {
  background: white;
  margin-top: 24px;
  padding: 26px;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(15,23,42,0.08);
}

.center {
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 24px;
}

.module {
  min-height: 160px;
  text-align: center;
  border: 0;
  color: #0f172a;
}

.module h3 {
  margin-top: 0;
  font-size: 26px;
}

.module p {
  color: #64748b;
  font-size: 18px;
  line-height: 1.35;
}

.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(15,23,42,0.13);
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.actions.right {
  justify-content: flex-end;
  margin-top: 24px;
}

.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 14px;
  border-radius: 12px;
  margin: 16px 0;
  font-weight: 700;
}

.hint {
  color: #64748b;
}

.empty {
  text-align: center;
  padding: 32px;
  color: #64748b;
}

.table {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.row {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  background: #f8fafc;
}

.row p {
  margin-bottom: 0;
  color: #64748b;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  font-weight: 700;
}

.form h2 {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.field {
  display: block;
}

@media (max-width: 850px) {
  .app {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    width: 100%;
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }
}


/* Etapa 4-2: tarjetas uniformes dashboard */
.grid {
  align-items: stretch;
}

.grid .module {
  min-height: 150px;
  height: 100%;
}

/* S2-A06: bloques de texto largo */
pre {
  overflow-x: auto;
  max-width: 100%;
}

/* S2-A06: celular pequeño (320-480 px) */
@media (max-width: 480px) {
  .app {
    padding: 12px;
  }

  .topbar {
    padding: 16px;
  }

  .login-card {
    padding: 24px;
  }
}


/* SM2.4-F4 CRM MVP */
.crm-mvp input,
.crm-mvp select,
.crm-mvp textarea {
  width: 100%;
  color: #111827;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px;
  box-sizing: border-box;
}

.crm-mvp textarea {
  min-height: 86px;
  resize: vertical;
}

.crm-mvp label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  color: #111827;
}

.crm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.crm-tab-active {
  outline: 3px solid rgba(220, 38, 38, 0.25);
  transform: translateY(-1px);
}

.crm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.crm-alert-error {
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.crm-note {
  margin-top: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #111827;
}

.crm-form h3 {
  margin-top: 22px;
  margin-bottom: 8px;
}

.crm-check {
  margin: 12px 0;
  flex-direction: row !important;
  align-items: center;
}

.crm-check input {
  width: auto;
}

.crm-row-card {
  margin-top: 12px;
}

.crm-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.muted {
  color: #6b7280;
}

@media (max-width: 768px) {
  .crm-actions,
  .crm-tabs {
    align-items: stretch;
  }

  .crm-actions button,
  .crm-tabs button {
    flex: 1 1 140px;
  }

  .crm-row-head {
    display: block;
  }
}


/* SM2.4-F5: reservas, ventas e inventario CRM */
.crm-reserva-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.crm-reserva-box select {
  margin-top: 6px;
}

/* ===== SM2.4-F9 Panel Ejecutivo ===== */
.f9-screen .topbar .actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.f9-tabs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.f9-tabs button {
  border: 1px solid #64748b;
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.f9-tabs button:hover {
  background: #e5e7eb;
  border-color: #475569;
}

.f9-tabs button.active {
  background: #b91c1c;
  color: #fff;
  border-color: #ef4444;
}

.f9-grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.f9-kpi-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.f9-kpi-card span {
  font-size: 0.88rem;
  opacity: 0.85;
}

.f9-kpi-card strong {
  font-size: 2rem;
  line-height: 1.1;
  margin: 0.35rem 0;
}

.f9-kpi-card small {
  opacity: 0.75;
}

.f9-alert-card {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(127, 29, 29, 0.25);
}

.f9-alert-list {
  display: grid;
  gap: 0.75rem;
}

.f9-alert-row {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 0.25rem;
}

.f9-alert-row strong {
  font-size: 0.95rem;
}

.f9-alert-row span,
.f9-alert-row small {
  opacity: 0.82;
}

.f9-alert-alto {
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(127, 29, 29, 0.22);
}

.f9-alert-medio {
  border-color: rgba(245, 158, 11, 0.65);
  background: rgba(120, 53, 15, 0.2);
}

.warning {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.55);
  background: rgba(120, 53, 15, 0.2);
  margin-top: 0.75rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

@media (max-width: 700px) {
  .f9-screen .topbar {
    align-items: flex-start;
  }

  .f9-screen .topbar .actions {
    justify-content: flex-start;
  }

  .f9-grid-kpi {
    grid-template-columns: 1fr;
  }

  .f9-kpi-card strong {
    font-size: 1.7rem;
  }
}


/* ===== QA2 estándar Volver / Actualizar ===== */
.topbar .actions.qa2-standard-actions,
.topbar .crm-actions.qa2-standard-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
  align-items: center;
}

.topbar .actions.qa2-standard-actions button:first-child,
.topbar .crm-actions.qa2-standard-actions button:first-child {
  order: 1;
}

.topbar .actions.qa2-standard-actions button:last-child,
.topbar .crm-actions.qa2-standard-actions button:last-child {
  order: 2;
}



/* QA2-F10-01B-BRANDING-PWA */
.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-lockup img {
  display: block;
  width: min(360px, 92vw);
  max-height: 120px;
  object-fit: contain;
}

.qa2-brand-login {
  margin-bottom: 18px;
}

.qa2-brand-dashboard {
  justify-content: flex-start;
}

.qa2-brand-dashboard img {
  width: min(300px, 70vw);
}

.login-page {
  background:
    radial-gradient(circle at 20% 12%, rgba(239, 45, 42, 0.24), transparent 34%),
    linear-gradient(135deg, #05070d, #121826 55%, #090b10);
}

.login-card {
  border: 1px solid rgba(239, 45, 42, 0.18);
}

.topbar {
  border-top: 4px solid #ef2d2a;
}

@media (max-width: 720px) {
  .qa2-brand-dashboard {
    justify-content: center;
  }

  .topbar {
    text-align: center;
  }
}


/* QA2-F10-01F-FIX-CONTRASTE-TITULOS */
.app,
.dashboard,
.card,
.module,
.topbar,
.login-card {
  color: #0f172a;
}

.app h1,
.app h2,
.app h3,
.dashboard h1,
.dashboard h2,
.dashboard h3,
.card h1,
.card h2,
.card h3,
.module h1,
.module h2,
.module h3,
.topbar h1,
.topbar h2,
.topbar h3 {
  color: #0f172a !important;
  opacity: 1 !important;
}

.card p,
.module p,
.topbar p,
.login-card p {
  color: #64748b;
}

.error,
.error h1,
.error h2,
.error h3,
.error p,
.error li,
.error strong {
  color: #7f1d1d !important;
}

.success,
.success h1,
.success h2,
.success h3,
.success p,
.success strong {
  color: #14532d !important;
}

.badge {
  color: #1e3a8a !important;
}


/* QA2-F10-02A-UPDATE-BANNER */
.masv-update-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(720px, calc(100vw - 24px));
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(239, 45, 42, 0.55);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.28);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  text-align: left;
}

.masv-update-banner.required {
  top: 0;
  left: 0;
  transform: none;
  width: 100vw;
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  background: rgba(127, 29, 29, 0.98);
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 28px;
}

.masv-update-banner strong {
  display: block;
  color: #ffffff !important;
}

.masv-update-banner span {
  display: block;
  color: #e5e7eb;
  font-size: 13px;
}

.masv-update-banner button {
  padding: 10px 14px;
  white-space: nowrap;
}

.masv-update-banner .secondary {
  background: rgba(255,255,255,0.16);
  color: #ffffff !important;
}

@media (max-width: 720px) {
  .masv-update-banner:not(.required) {
    top: 8px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}


/* QA2-F10-02D-AUTOUPDATE-SEGURO */
.masv-update-banner.auto {
  background: #0f172a;
  border-color: rgba(239, 45, 42, 0.75);
}

.masv-update-banner.auto::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: masv-spin 0.9s linear infinite;
}

@keyframes masv-spin {
  to { transform: rotate(360deg); }
}
