/* ================================================================
   Selvatek – Hoja de estilos principal
   Paleta: verdes pastel cálidos + blanco · Sin fondos oscuros
   ================================================================
   Estructura:
     1. Variables y reset
     2. Contenedor central
     3. Componentes reutilizables (botones, badges, formularios)
     4. FASE 1: Header
     5. FASE 1: Hero
     6. FASE 1: Características
     7. FASE 1: Cómo funciona
     8. FASE 1: Precios
     9. FASE 1: CTA final
    10. FASE 1: Footer
    11. FASE 2: Modales
    12. FASE 3: Panel interno (dashboard, sidebar, etc.)
    13. Utilidades y responsivo
   ================================================================ */


/* ────────────────────────────────────────────────────────────────
   1. VARIABLES CSS Y RESET BÁSICO
   ──────────────────────────────────────────────────────────────── */

:root {
  /* ── Fondos: blancos y verdes muy suaves ── */
  --bg-base:       #f4f9f1;   /* fondo general: blanco con toque verde muy suave */
  --bg-white:      #ffffff;   /* blanco puro para tarjetas y modales */
  --bg-section:    #e8f2e3;   /* sección alternada: verde pastel muy claro */
  --bg-elevated:   #eef6e9;   /* elementos elevados: formularios, inputs */
  --border:        #c2dbb5;   /* borde verde suave */
  --border-light:  #d8edcc;   /* borde muy sutil */

  /* ── Verdes del sistema ── */
  --primary:       #4e7d62;   /* verde sage cálido: botones principales, énfasis */
  --primary-dark:  #3a6149;   /* hover: más profundo */
  --primary-light: #6aa07e;   /* variante clara */
  --primary-glow:  rgba(78,125,98,0.13);   /* resplandor suave */

  --accent:        #5aaa80;   /* verde más vivo para texto acento y logo */
  --accent-light:  #a8d4bc;   /* acento muy claro */

  /* ── Texto ── */
  --text:          #1c2e22;   /* negro verdoso cálido: texto principal */
  --text-muted:    #4a6554;   /* texto secundario: verde-gris medio */
  --text-faint:    #7c9e86;   /* texto terciario: verde gris claro */

  /* ── Estados ── */
  --success:       #2e7d52;   /* verde rico para éxito */
  --warning:       #a86c2a;   /* ámbar cálido para advertencias (no amarillo agresivo) */
  --danger:        #b04040;   /* rojo muted, no agresivo */

  /* ── Espaciado ── */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* ── Bordes redondeados ── */
  --radius-sm:  6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* ── Sombras: sutiles, con tinte verde-natural ── */
  --shadow-sm:   0 1px 4px  rgba(26,60,35,0.07);
  --shadow-md:   0 4px 16px rgba(26,60,35,0.09);
  --shadow-lg:   0 16px 40px rgba(26,60,35,0.11);
  --shadow-glow: 0 0 40px  rgba(78,125,98,0.18);

  /* ── Transiciones ── */
  --ease:        0.3s ease;
  --ease-fast:   0.15s ease;   /* micro-interacciones: toggles, dots, filtros */
  --ease-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Gradiente primario (banner, welcome, CTA) ── */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);

  /* ── Fuente ── */
  --font:      'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;

  /* ── Alias de compatibilidad ──────────────────────────────────────
     Resuelven referencias históricas; apuntan a los tokens canónicos.
     Al migrar a Supabase/frameworks, reemplazar los usos y borrar estos. */
  --text-secondary: var(--text-muted);
  --text-main:      var(--text);
  --surface:        var(--bg-white);
  --bg-card:        var(--bg-white);
  --radius:         var(--radius-md);
}

/* Reset mínimo */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background-color: var(--bg-base);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul { list-style: none; }


/* ────────────────────────────────────────────────────────────────
   2. CONTENEDOR CENTRAL
   ──────────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}


/* ────────────────────────────────────────────────────────────────
   3. COMPONENTES REUTILIZABLES
   ──────────────────────────────────────────────────────────────── */

/* ── Botones ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
  transform: translateY(-2px);
}

.btn-large { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-full  { width: 100%; justify-content: center; }

.arrow { transition: transform var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  background: rgba(78,125,98,0.10);
  color: var(--primary);
  border: 1px solid rgba(78,125,98,0.25);
}

.badge-hero {
  background: rgba(90,170,128,0.10);
  color: var(--accent);
  border-color: rgba(90,170,128,0.30);
}

/* ── Encabezado de sección ── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin: var(--space-md) 0 var(--space-sm);
  line-height: 1.2;
}
.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Acento de color ── */
.accent { color: var(--accent); }

/* ── Check mark ── */
.check { color: var(--success); font-weight: 700; }

/* ── Logo ── */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}
.logo-icon { font-size: 1.5rem; display: inline-flex; }
.logo-icon img { height: 1.5rem; width: auto; display: block; }

/* ── Formularios ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}
.form-label-row label { margin-bottom: 0; }
.form-group input {
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--ease), box-shadow var(--ease);
  outline: none;
}
.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-group input::placeholder { color: var(--text-faint); }

.input-with-toggle { position: relative; }
.input-with-toggle input { width: 100%; padding-right: 44px; }
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0;
  opacity: 0.6;
}
.toggle-password:hover { opacity: 1; }

.field-error {
  font-size: 0.8rem;
  color: var(--danger);
  min-height: 16px;
}

.form-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: rgba(176,64,64,0.07);
  border: 1px solid rgba(176,64,64,0.2);
  color: var(--danger);
  margin-bottom: var(--space-md);
}
.form-alert.success {
  background: rgba(46,125,82,0.07);
  border-color: rgba(46,125,82,0.25);
  color: var(--success);
}


/* ────────────────────────────────────────────────────────────────
   4. FASE 1 – HEADER
   ──────────────────────────────────────────────────────────────── */

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  padding: 18px 0;
  transition: background var(--ease), box-shadow var(--ease), padding var(--ease);
}

/* Sobre fondo claro el header empieza semitransparente */
#header.scrolled {
  background: rgba(244,249,241,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
  padding: 12px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

#main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
#main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--ease);
}
#main-nav a:hover { color: var(--primary); }
#main-nav .nav-link-login { color: var(--text); font-weight: 600; }

/* Botón hamburguesa – solo visible en móvil */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--ease);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ────────────────────────────────────────────────────────────────
   5. FASE 1 – HERO
   ──────────────────────────────────────────────────────────────── */

#hero {
  padding: calc(var(--space-3xl) + 80px) 0 var(--space-3xl);
  background-color: var(--bg-base);
  position: relative;
  overflow: hidden;
}

/* Círculo decorativo verde suave arriba-derecha */
#hero::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -150px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(90,170,128,0.10) 0%, transparent 68%);
  pointer-events: none;
}

/* Círculo decorativo verde suave abajo-izquierda */
#hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(78,125,98,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

/* Contenido de texto */
.hero-content { display: flex; flex-direction: column; gap: var(--space-lg); }

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 480px;
}

.hero-benefits {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.hero-benefits li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.95rem;
  color: var(--text-muted);
}
.hero-benefits .check { font-size: 1rem; }

.hero-ctas {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ── Mockup visual del dashboard en el hero ── */
.hero-visual { position: relative; }

/* Resplandor verde suave detrás del mockup */
.hero-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at center, rgba(78,125,98,0.12) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.dashboard-preview {
  position: relative;
  z-index: 1;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

/* Barra de título estilo macOS */
.preview-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}
.preview-dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red    { background: #ff6057; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; }
.preview-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-left: auto;
  margin-right: auto;
  letter-spacing: 0.3px;
}

/* Cuerpo del mockup */
.preview-body {
  display: flex;
  height: 300px;
}

/* Sidebar del mockup */
.preview-sidebar {
  width: 132px;
  flex-shrink: 0;
  background: var(--bg-section);
  border-right: 1px solid var(--border);
  padding: var(--space-sm) 0;
}
.pnav-item {
  padding: 8px 12px;
  font-size: 0.68rem;
  color: var(--text-muted);
  cursor: default;
  border-radius: var(--radius-sm);
  margin: 2px 6px;
  transition: background var(--ease);
  font-weight: 500;
}
.pnav-active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

/* Área principal del mockup */
.preview-main {
  flex: 1;
  padding: var(--space-md);
  background: var(--bg-white);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Tarjetas de estadísticas del mockup */
.pstat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}
.pstat-card {
  padding: 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
}
.pstat-num {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
}
.pstat-lbl {
  display: block;
  font-size: 0.58rem;
  color: var(--text-faint);
  margin-top: 1px;
}
.pstat-open     .pstat-num { color: var(--warning); }
.pstat-progress .pstat-num { color: var(--primary); }
.pstat-done     .pstat-num { color: var(--success); }

/* Lista de órdenes del mockup */
.porders { display: flex; flex-direction: column; gap: 4px; }
.porder-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-size: 0.65rem;
}
.porder-id     { color: var(--text-faint); font-family: var(--font-mono); flex-shrink: 0; }
.porder-device { flex: 1; color: var(--text); font-weight: 600; }

.pbadge {
  padding: 2px 7px;
  border-radius: 100px;
  font-size: 0.55rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.pbadge-open     { background: rgba(168,108,42,0.12); color: var(--warning); }
.pbadge-progress { background: rgba(78,125,98,0.12);  color: var(--primary); }
.pbadge-done     { background: rgba(46,125,82,0.12);  color: var(--success); }
.pbadge-delay    { background: rgba(176,64,64,0.12);  color: var(--danger);  }


/* ────────────────────────────────────────────────────────────────
   6. FASE 1 – CARACTERÍSTICAS
   ──────────────────────────────────────────────────────────────── */

#features {
  padding: var(--space-3xl) 0;
  background: var(--bg-section);
  /* Borde superior e inferior suave para separar la sección */
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.feature-card {
  padding: var(--space-xl);
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}
.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}


/* ────────────────────────────────────────────────────────────────
   7. FASE 1 – CÓMO FUNCIONA
   ──────────────────────────────────────────────────────────────── */

#how-it-works {
  padding: var(--space-3xl) 0;
  background: var(--bg-white);
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-md);
}

.step {
  flex: 1;
  max-width: 280px;
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-glow);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}

.step h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
}
.step p { font-size: 0.9rem; color: var(--text-muted); }

.step-connector {
  font-size: 1.5rem;
  color: var(--accent-light);
  margin-top: 60px;
  flex-shrink: 0;
  font-weight: 700;
}


/* ────────────────────────────────────────────────────────────────
   8. FASE 1 – PRECIOS
   ──────────────────────────────────────────────────────────────── */

#pricing {
  padding: var(--space-3xl) 0;
  background: var(--bg-section);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.pricing-wrapper {
  display: flex;
  gap: var(--space-xl);
  align-items: flex-start;
  max-width: 760px;
  margin: 0 auto;
}

.pricing-card {
  flex: 1;
  position: relative;
  background: var(--bg-white);
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-glow), var(--shadow-md);
}

.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 18px;
  border-radius: 100px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.plan-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: var(--space-xs);
  margin-top: var(--space-sm);
}
.plan-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: var(--space-lg); }

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: var(--space-xl);
}
.currency { font-size: 1.5rem; font-weight: 700; color: var(--text-muted); }
.amount   { font-size: 3.5rem; font-weight: 900; line-height: 1; color: var(--primary); }
.period   { font-size: 1rem; color: var(--text-muted); }

.plan-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.plan-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: var(--space-md);
}

/* Panel de próximas funciones */
.pricing-extras {
  flex-shrink: 0;
  width: 220px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.pricing-extras h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--space-md);
}
.extras-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.extras-list li { font-size: 0.85rem; color: var(--text-muted); }


/* ────────────────────────────────────────────────────────────────
   9. FASE 1 – CTA FINAL
   Único bloque de color rico: verde sage profundo con texto blanco.
   Crea un punto focal tranquilo y professional sin ser oscuro.
   ──────────────────────────────────────────────────────────────── */

#cta-final {
  padding: var(--space-3xl) 0;
  text-align: center;
  background: var(--gradient-primary);
  position: relative;
  overflow: hidden;
}

/* Círculo decorativo en el fondo del CTA */
#cta-final::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.cta-inner h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: var(--space-md);
}
.cta-inner p {
  color: rgba(255,255,255,0.78);
  font-size: 1.05rem;
  margin-bottom: var(--space-xl);
}

/* El botón primario dentro del CTA se invierte: blanco con texto verde */
#cta-final .btn-primary {
  background: #ffffff;
  color: var(--primary);
}
#cta-final .btn-primary:hover {
  background: var(--bg-section);
  color: var(--primary-dark);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}


/* ────────────────────────────────────────────────────────────────
   10. FASE 1 – FOOTER
   ──────────────────────────────────────────────────────────────── */

#footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border-light);
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand .logo { margin-bottom: var(--space-md); }
.footer-brand p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.65; max-width: 260px; }

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text);
  margin-bottom: var(--space-md);
}
.footer-col nav { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-col a { font-size: 0.9rem; color: var(--text-muted); transition: color var(--ease); }
.footer-col a:hover { color: var(--primary); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: var(--space-sm);
}


/* ────────────────────────────────────────────────────────────────
   11. FASE 2 – MODALES DE REGISTRO Y LOGIN
   ──────────────────────────────────────────────────────────────── */

/* Fondo: tinte verde muy suave, no negro puro */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(28,70,42,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);

  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ease), visibility var(--ease);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Tarjeta del modal: blanco limpio */
.modal {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: var(--shadow-lg);

  transform: scale(0.95) translateY(20px);
  transition: transform var(--ease-bounce);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }

/* Caja genérica para modales dinámicos (_modal_create) */
.modal-box {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 90vw;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--ease-bounce);
  overflow: hidden;
  box-sizing: border-box;
}
.modal-overlay.active .modal-box { transform: scale(1) translateY(0); }
.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}
.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: background var(--ease), color var(--ease);
}
.modal-close:hover { background: var(--danger); color: #fff; }

.modal-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}
.modal-header .logo-icon { font-size: 2rem; display: block; margin-bottom: var(--space-sm); }
.modal-header .logo-icon img { height: 2rem; width: auto; display: block; margin: 0 auto var(--space-sm); }
.modal-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.modal-header p  { font-size: 0.9rem; color: var(--text-muted); }

.modal-switch {
  text-align: center;
  margin-top: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.modal-switch a { color: var(--primary); font-weight: 600; }
.modal-switch a:hover { text-decoration: underline; }


/* ────────────────────────────────────────────────────────────────
   12. FASE 3 – SISTEMA INTERNO (DASHBOARD)
   Todo en tonos blancos y verdes claros. Sin fondos oscuros.
   ──────────────────────────────────────────────────────────────── */

body.app-mode #hero,
body.app-mode #features,
body.app-mode #how-it-works,
body.app-mode #pricing,
body.app-mode #cta-final,
body.app-mode #footer,
body.app-mode #header {
  display: none;
}

/* ── Layout del panel ── */
#app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-base);
}

/* Sidebar */
.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-white);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--ease);
  box-shadow: var(--shadow-sm);
}

.sidebar-logo {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-section);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  padding: var(--space-sm) var(--space-sm);
  margin-top: var(--space-md);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--ease), color var(--ease);
  cursor: pointer;
  margin-bottom: 2px;
}
.sidebar-nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.sidebar-nav-item.active {
  background: rgba(78,125,98,0.12);
  color: var(--primary);
  font-weight: 700;
}
.sidebar-nav-item .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-base);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-glow);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}
.user-info-name { font-weight: 700; color: var(--text); font-size: 0.8rem; line-height: 1.2; }
.user-info-biz  { font-size: 0.7rem; color: var(--text-muted); line-height: 1.2; }
.user-info-role { margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.user-info-role .role-badge-inline { font-size: 0.65rem; padding: 1px 6px; }
.user-info-role .plan-chip { font-size: 0.65rem; padding: 1px 6px; margin: 0; }
.sidebar-footer .plan-chip { font-size: 0.68rem; padding: 2px 8px; align-self: flex-start; }

.btn-logout {
  width: 100%;
  padding: 5px 8px;
  background: rgba(176,64,64,0.07);
  color: var(--danger);
  border: 1px solid rgba(176,64,64,0.18);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  transition: background var(--ease);
}
.btn-logout:hover { background: rgba(176,64,64,0.14); }

/* Área principal del panel */
.app-main {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.app-topbar {
  height: 64px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: var(--space-md); }

/* Área de contenido */
.app-content { flex: 1; padding: var(--space-xl); }

/* ── Tarjetas de estadísticas del dashboard ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: transform var(--ease), box-shadow var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon { font-size: 1.5rem; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }
.stat-card.stat-open     .stat-value { color: var(--warning); }
.stat-card.stat-progress .stat-value { color: var(--primary); }
.stat-card.stat-done     .stat-value { color: var(--success); }

/* ── Tabla de órdenes ── */
.table-wrapper {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-base);
}
.table-header-bar h3 { font-size: 1rem; font-weight: 700; color: var(--text); }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 12px var(--space-lg);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
}
tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--ease);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-elevated); }
tbody td {
  padding: 14px var(--space-lg);
  font-size: 0.9rem;
  color: var(--text-muted);
}
tbody td:first-child { color: var(--text); font-weight: 600; }

/* .status-badge — definición canónica en sección FASE 3 (~línea 1750) */

/* .panel-form — definición canónica en sección FASE 3 (~línea 2290) */

/* .form-row sin sufijo — eliminado por no usarse (ver .form-row-2 en sección FASE 3) */

.form-group select,
.form-group textarea {
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--ease);
  outline: none;
  width: 100%;
}
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-group textarea { resize: vertical; min-height: 90px; }

/* .timeline — definición canónica en sección FASE 3 (~línea 2150) */


/* ────────────────────────────────────────────────────────────────
   13. FASE 2 – NUEVOS COMPONENTES
   ──────────────────────────────────────────────────────────────── */

/* ── Pricing: Banner de prueba gratuita ── */
.trial-banner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}
.trial-icon { font-size: 2rem; flex-shrink: 0; }
.trial-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #fff;
}
.trial-info strong { font-size: 1rem; font-weight: 700; }
.trial-info span   { font-size: 0.88rem; opacity: 0.85; }

.btn-trial {
  background: #ffffff;
  color: var(--primary);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-trial:hover {
  background: var(--bg-section);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* ── Pricing: Grid de tres planes ── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-xl);
}

.plan-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  position: relative;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

/* Plan destacado – Estándar */
.plan-featured {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-8px);
  z-index: 1;
}
.plan-featured:hover { transform: translateY(-12px); }

.plan-card-head { display: flex; flex-direction: column; gap: var(--space-sm); }

/* Etiqueta de nivel (Inicial / Estándar / Profesional) */
.plan-tier {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 100px;
  width: fit-content;
}
.plan-tier-inicial     { background: rgba(168,108,42,0.10); color: var(--warning); }
.plan-tier-estandar    { background: rgba(78,125,98,0.12);  color: var(--primary); }
.plan-tier-profesional { background: rgba(46,125,82,0.12);  color: var(--success); }

.plan-card .plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.plan-card .plan-price {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin: var(--space-sm) 0 0;
}
.plan-card .currency { font-size: 1.2rem; font-weight: 700; color: var(--text-muted); }
.plan-card .amount   { font-size: 2.8rem; font-weight: 900; line-height: 1; color: var(--primary); }
.plan-card .period   { font-size: 0.9rem; color: var(--text-muted); }

.plan-card .plan-features {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.plan-card .plan-features li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.88rem;
}

.feat-ok { color: var(--text-muted); }
.feat-ok .feat-icon { color: var(--success); font-weight: 700; font-size: 0.85rem; width: 14px; }

.feat-no { color: var(--text-faint); }
.feat-no .feat-icon { color: var(--danger); opacity: 0.5; font-size: 0.85rem; width: 14px; }

.plans-footnote {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: var(--space-md);
}

/* ── Register Modal: visualización del plan seleccionado ── */
.reg-plan-display {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.reg-plan-label { font-size: 0.82rem; color: var(--text-muted); flex-shrink: 0; }
.reg-plan-name  { font-size: 0.82rem; font-weight: 700; }
.reg-plan-change {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}
.reg-plan-change:hover { text-decoration: underline; }

/* ── Plan chips por tipo (usados en sidebar y dashboard) ── */
.plan-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.plan-chip-trial      { background: rgba(90,170,128,0.15); color: var(--accent); }
.plan-chip-inicial    { background: rgba(168,108,42,0.12); color: var(--warning); }
.plan-chip-estandar   { background: rgba(78,125,98,0.15);  color: var(--primary); }
.plan-chip-profesional{ background: rgba(46,125,82,0.15);  color: var(--success); }

/* ── App: Banner de prueba en la parte superior del panel ── */
.trial-topbar-banner {
  background: linear-gradient(90deg, #fff8e1 0%, #fffde7 100%);
  border-bottom: 2px solid #f0a500;
  padding: 9px var(--space-xl);
  font-size: 0.875rem;
  font-weight: 600;
  color: #7a4f00;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  text-align: center;
}
.trial-topbar-banner strong {
  color: #c47000;
}
.trial-topbar-banner.trial-expired {
  background: linear-gradient(90deg, #fff0f0 0%, #fff5f5 100%);
  border-color: var(--danger);
  color: var(--danger);
}
.trial-upgrade-link {
  display: inline-block;
  background: #f0a500;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  padding: 3px 11px;
  border-radius: 20px;
  margin-left: var(--space-sm);
  transition: background var(--ease-fast), transform var(--ease-fast);
}
.trial-upgrade-link:hover {
  background: #c47000;
  transform: translateY(-1px);
}
.trial-topbar-banner.trial-expired .trial-upgrade-link {
  background: var(--danger);
}
.trial-topbar-banner.trial-expired .trial-upgrade-link:hover {
  background: #9b1c1c;
}

/* ── Topbar: mejoras ── */
.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.topbar-menu-btn {
  font-size: 1.1rem;
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--ease);
  display: none; /* visible solo en móvil */
}
.topbar-menu-btn:hover { background: var(--bg-elevated); }
.topbar-greeting { font-size: 0.9rem; color: var(--text-muted); }

/* ── Dashboard: tarjeta de bienvenida ── */
.welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}
.welcome-text h2 { font-size: 1.3rem; font-weight: 800; color: #fff; margin-bottom: 4px; }
.welcome-text p  { font-size: 0.9rem; color: rgba(255,255,255,0.8); display: flex; align-items: center; gap: var(--space-sm); }
.welcome-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
}
.welcome-date {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.97);
  text-transform: capitalize;
  letter-spacing: 0.01em;
}
.welcome-card .plan-chip {
  background: rgba(255,255,255,0.22);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  font-weight: 700;
}

/* ── Dashboard: Acciones rápidas ── */
.quick-actions { margin-bottom: var(--space-xl); }
.quick-actions h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
}
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
  cursor: pointer;
}
.quick-action-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}
.qa-icon  { font-size: 1.6rem; }
.qa-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }

/* ── Dashboard: tarjeta de información del plan ── */
.plan-info-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}
.plan-info-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.plan-info-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.plan-limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
}
.plan-limit-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.pl-icon  { font-size: 1.1rem; }
.pl-label { font-size: 0.78rem; color: var(--text-faint); }
.pl-value { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.pl-ok    { color: var(--success); }
.pl-no    { color: var(--text-faint); }
.pl-no-text { color: var(--text-faint); font-weight: 400; }

/* .placeholder-module — definición canónica en sección FASE 3 (~línea 2470) */

/* ────────────────────────────────────────────────────────────────
   14. UTILIDADES Y RESPONSIVO
   ──────────────────────────────────────────────────────────────── */

[hidden] { display: none !important; }
.hidden  { display: none !important; }
.visible { display: block; }

/* Toasts de notificación */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}
.toast {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px var(--space-md);
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease forwards;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 260px;
  max-width: 360px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ── RESPONSIVE ── */

@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid   { grid-template-columns: 1fr 1fr; }
  .plans-grid    { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto var(--space-xl); }
  .plan-featured { transform: translateY(0); }
  .plan-featured:hover { transform: translateY(-4px); }
}

@media (max-width: 768px) {
  .topbar-menu-btn { display: block; }
  #main-nav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-white);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    z-index: 800;
  }
  #main-nav.open { display: flex; }
  #main-nav a { font-size: 1.2rem; }

  .menu-toggle { display: flex; z-index: 900; }

  .hero-grid    { grid-template-columns: 1fr; }
  .hero-visual  { display: none; }

  .steps { flex-direction: column; align-items: center; }
  .step-connector { transform: rotate(90deg); margin: 0; }

  .pricing-wrapper { flex-direction: column; }
  .pricing-extras  { width: 100%; }

  .features-grid { grid-template-columns: 1fr; }

  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
}

@media (max-width: 480px) {
  .container  { padding: 0 var(--space-md); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-ctas  { flex-direction: column; }
  .btn-large  { width: 100%; justify-content: center; }
}


/* ================================================================
   FASE 3 – PANEL INTERNO: MÓDULOS COMPLETOS
   ================================================================ */

/* ── Status badges – 8 estados personalizados ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.status-badge-lg {
  font-size: 0.9rem;
  padding: 5px 14px;
}
.status-badge-link {
  cursor: pointer;
  transition: opacity var(--ease-fast), transform var(--ease-fast);
  user-select: none;
}
.status-badge-link:hover {
  opacity: 0.8;
  transform: scale(1.06);
}
.quick-status-cur {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}
.quick-status-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quick-status-btn {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  cursor: pointer;
  text-align: left;
  transition: background var(--ease-fast), border-color var(--ease-fast), transform var(--ease-fast);
  display: flex;
  align-items: center;
}
.quick-status-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary-light);
  transform: translateX(3px);
}

.status-pending  { background: rgba(176,64,64,0.10);   color: #a03030; }
.status-progress { background: rgba(78,125,98,0.15);   color: var(--primary-dark); }
.status-confirm  { background: rgba(168,108,42,0.12);  color: var(--warning); }
.status-waiting  { background: rgba(90,120,170,0.12);  color: #3a5f9e; }
.status-done     { background: rgba(46,125,82,0.13);   color: var(--success); }
.status-norepair { background: rgba(100,100,100,0.10); color: #555; }
.status-closed   { background: rgba(150,50,50,0.10);   color: #8a2222; }
.status-baja     { background: rgba(80,80,80,0.10);    color: #444; }

/* ── Module toolbar ── */
.module-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.module-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.module-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.module-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.badge-count {
  background: var(--bg-section);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--border-light);
}

/* ── Search ── */
.search-wrap { position: relative; }
.search-input {
  padding: 8px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  width: 220px;
  background: var(--bg-white);
  color: var(--text);
  transition: border-color var(--ease);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ── Status filter tabs ── */
.status-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.status-tab {
  padding: 5px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: 100px;
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.status-tab:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.status-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.tab-count {
  background: rgba(255,255,255,0.3);
  font-size: 0.72rem;
  padding: 1px 5px;
  border-radius: 100px;
}
.status-tab.active .tab-count { background: rgba(255,255,255,0.25); }
.status-tab:not(.active) .tab-count {
  background: var(--bg-section);
  color: var(--text-muted);
}

/* ── Table enhancements ── */
.order-row, .client-row {
  cursor: pointer;
  transition: background var(--ease);
}
.order-row:hover, .client-row:hover { background: var(--bg-elevated); }
.order-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary-dark);
}
.date-cell { font-size: 0.85rem; color: var(--text-muted); }
.actions-cell {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

/* ── Icon buttons ── */
.btn-icon {
  background: none;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--ease);
  line-height: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 48px;
}
.btn-icon-ico { font-size: 0.95rem; line-height: 1; }
.btn-icon-lbl { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1; }
.btn-icon:hover {
  background: var(--bg-section);
  border-color: var(--border);
  color: var(--text);
}
.btn-icon-danger:hover {
  background: rgba(176,64,64,0.08);
  border-color: rgba(176,64,64,0.3);
}
.btn-icon-delete { color: #b91c1c; }
.btn-icon-delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.btn-icon-activate { color: #2e7d32; }
.btn-icon-activate:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

/* ── Extra button variants ── */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.83rem;
}
.btn-danger {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  color: #fff;
  border: none;
}
.btn-danger:hover {
  background: linear-gradient(135deg, #a93226, #cb4335);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(192,57,43,0.25);
}
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Botón eliminar (rojo más oscuro que danger) ── */
.btn-delete {
  background: linear-gradient(135deg, #7f1d1d, #b91c1c);
  color: #fff;
  border: none;
}
.btn-delete:hover {
  background: linear-gradient(135deg, #6b1515, #991818);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(127,29,29,0.3);
}
.btn-xs {
  padding: 3px 9px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* ── Modal de confirmación ── */
.modal-confirm-inner {
  max-width: 420px;
  padding: var(--space-xl);
}
.modal-confirm-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.modal-confirm-body {
  font-size: 0.93rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}
.modal-confirm-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* ── Módulo Administración ── */
.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.panel-card-header h3 {
  margin: 0;
  font-size: 1rem;
}
.badge-role {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-tech  { background: #e8f4fd; color: #1565c0; }
.badge-admin { background: #f3e5f5; color: #6a1b9a; }
.badge-reg   { background: #fff3e0; color: #e65100; }

/* ── Selector de rol ── */
.role-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.role-opt { display: flex; align-items: stretch; cursor: pointer; }
.role-opt input[type="radio"] { display: none; }
.role-opt-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.role-opt input:checked + .role-opt-inner {
  border-color: var(--primary);
  background: #f1f8f1;
}
.role-opt-icon { font-size: 1.2rem; line-height: 1; }
.role-opt-name { font-weight: 700; font-size: 0.88rem; color: var(--text-dark); }
.role-opt-desc { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }

.perms-row { flex-direction: row !important; flex-wrap: wrap; gap: 12px !important; }
.perm-full-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 3px 10px;
  border-radius: 20px;
}
.perm-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.perm-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  cursor: pointer;
  color: var(--text-secondary);
}
.perm-toggle input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
}
.perms-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

/* ── Admin: contraseña visible en tabla ── */
.admin-staff-table th, .admin-staff-table td { vertical-align: middle; }
.admin-pwd-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
}
.admin-pwd-plain { color: var(--primary-dark); font-weight: 600; }
.btn-eye {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.btn-eye:hover { opacity: 1; }

/* ── Credenciales modal ── */
.cred-card {
  background: var(--bg-section);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0;
}
.cred-biz {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}
.cred-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
}
.cred-row:last-of-type { border-bottom: none; }
.cred-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 80px;
}
.cred-val {
  flex: 1;
  font-family: var(--font-mono, monospace);
  font-size: 0.9rem;
  color: var(--text-dark);
  font-weight: 600;
  word-break: break-all;
}
.cred-url { font-size: 0.78rem; color: var(--text-muted); }
.cred-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  line-height: 1.5;
}
.btn-copy {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-copy:hover { background: var(--bg-hover); }
.cred-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}
.pwd-input-wrap input { font-family: var(--font-mono, monospace); }
.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted, #999);
  margin-top: 3px;
  display: block;
  font-style: italic;
}

/* ── Detail topbar (back + actions) ── */
.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
}
.form-page-title {
  text-align: left;
  font-size: 1.15rem;
  margin-bottom: 0;
}
.form-topbar-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.next-order-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.next-order-badge strong {
  color: var(--primary);
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.ss-readonly,
input[readonly].ss-readonly {
  background: var(--bg-section) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  border-color: var(--border-light) !important;
  pointer-events: none;
}
.order-topbar-num {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.order-topbar-numval {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  line-height: 1;
}
.order-topbar-datetime {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.detail-topbar-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}
.btn-back {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--ease);
}
.btn-back:hover {
  background: var(--bg-section);
  color: var(--primary);
  border-color: var(--primary-light);
}

/* ── Detail header ── */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.detail-order-num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

/* ── 2-column detail layout ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}
.detail-left, .detail-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.detail-section {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.detail-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--space-md) 0;
}
.detail-fields { display: flex; flex-direction: column; gap: 8px; }
.detail-field {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-size: 0.9rem;
}
.df-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 90px;
  flex-shrink: 0;
  font-size: 0.82rem;
}
.detail-fault {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}
.detail-notes-client {
  font-size: 0.88rem;
  margin: var(--space-sm) 0 0 0;
}

/* ── Status change grid ── */
.status-change-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-status-change {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--ease);
}
.btn-status-change:hover {
  background: var(--bg-section);
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ── Timeline ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-event, .history-event {
  display: flex;
  gap: var(--space-sm);
  position: relative;
  padding-bottom: var(--space-md);
}
.timeline-event::before, .history-event::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: 0;
  width: 1.5px;
  background: var(--border-light);
}
.timeline-event:last-child::before, .history-event:last-child::before { display: none; }
.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--primary);
  flex-shrink: 0;
  margin-top: 3px;
}
.tl-body { flex: 1; min-width: 0; }
.tl-action {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px 0;
  line-height: 1.4;
}
.tl-notes {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 3px 0 2px;
}
.tl-note-line {
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.tl-date {
  font-size: 0.78rem;
  color: var(--text-faint);
}
.timeline-empty {
  color: var(--text-faint);
  font-size: 0.88rem;
  font-style: italic;
  margin: 0;
}

/* ── Feature locked ── */
.feature-locked {
  background: var(--bg-section);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  line-height: 1.6;
}

/* ── Internal notes textarea ── */
.internal-notes-textarea {
  width: 100%;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-base);
  resize: vertical;
  transition: border-color var(--ease);
  box-sizing: border-box;
  display: block;
  margin-bottom: var(--space-sm);
}
.internal-notes-textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ── Baja info section ── */
.baja-info-section {
  background: rgba(176,64,64,0.05);
  border: 1.5px solid rgba(176,64,64,0.2);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}
.baja-info-section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #a03030;
  margin: 0 0 var(--space-md) 0;
}
.baja-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}
.baja-detail-grid > div { display: flex; gap: var(--space-sm); align-items: baseline; }
.baja-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 110px;
  flex-shrink: 0;
}
.baja-notes-full { flex-direction: column !important; gap: 2px !important; }
.baja-notes-full .baja-label { min-width: unset; }

/* ── Client detail header ── */
.client-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}
.client-detail-header h2 { margin: 0; font-size: 1.4rem; }
.client-avatar-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Panel form ── */
.panel-form {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
}
.form-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary);
  padding: var(--space-md) 0 var(--space-sm) 0;
  border-bottom: 1.5px solid var(--border-light);
  margin-bottom: var(--space-md);
}
.form-section-title:first-child { padding-top: 0; }
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-md);
}
.form-row-client {
  display: grid;
  grid-template-columns: minmax(200px, 420px) minmax(160px, 280px);
  gap: var(--space-md);
}
.form-row-top-align { align-items: start; }
.form-panels-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-md);
}
.form-panel { min-width: 0; }
.form-panel .form-section-title { padding-top: 0; }
.cond-extra-grid--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) {
  .form-panels-2 { grid-template-columns: 1fr; }
  .cond-extra-grid--2 { grid-template-columns: 1fr 1fr; }
}
.form-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1.5px solid var(--border-light);
  margin-top: var(--space-lg);
}
.form-actions .btn {
  min-width: 160px;
  padding: 12px 28px;
  font-size: 1rem;
}
.form-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}
.form-hint a { color: var(--primary); }

/* ── History ── */
.history-timeline { gap: 0; }
.history-event-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.history-order-link {
  cursor: pointer;
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--ease);
}
.history-order-link:hover { text-decoration-color: var(--primary); }
.history-device { font-size: 0.83rem; color: var(--text-muted); }
.history-client { font-size: 0.83rem; }
.history-limit-note {
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* ── Link text (clickable spans) ── */
.link-text {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--ease);
}
.link-text:hover { text-decoration-color: var(--primary); }

/* ── Modal Baja ── */
.modal-baja-inner {
  max-width: 460px;
  width: 94vw;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-md) var(--space-lg);
}
.modal-baja-inner .modal-header {
  margin-bottom: var(--space-sm);
}
.modal-baja-inner .modal-header .logo-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
}
.modal-baja-inner .modal-header h2 {
  font-size: 1.1rem;
  margin-bottom: 2px;
}
.modal-baja-inner .modal-header p {
  font-size: 0.8rem;
}
.modal-baja-inner .form-section-title {
  padding: var(--space-xs) 0 var(--space-xs) 0;
}
.modal-baja-inner .radio-group {
  gap: 5px;
  margin-bottom: var(--space-sm);
}
.modal-baja-inner .radio-content {
  padding: 6px 10px;
}
.modal-baja-inner .radio-texts strong { font-size: 0.82rem; }
.modal-baja-inner .radio-texts small  { font-size: 0.72rem; }
.modal-baja-inner .form-group {
  gap: 3px;
  margin-bottom: var(--space-xs);
}
.modal-baja-inner .form-group label {
  font-size: 0.82rem;
}
.modal-baja-inner .checkbox-confirm {
  margin: var(--space-xs) 0;
  padding: 6px 10px;
  font-size: 0.78rem;
}
.modal-subtitle {
  font-size: 0.84rem;
  margin: 3px 0 0 0;
}

/* ── Radio group ── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-md);
}
.radio-option {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
}
.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.radio-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  width: 100%;
  background: var(--bg-white);
  transition: all var(--ease);
}
.radio-option:hover .radio-content {
  border-color: var(--primary-light);
  background: var(--bg-elevated);
}
.radio-option input:checked + .radio-content {
  border-color: var(--primary);
  background: rgba(78,125,98,0.07);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.radio-icon { font-size: 1rem; flex-shrink: 0; }
.radio-texts { display: flex; flex-direction: column; gap: 1px; }
.radio-texts strong { font-size: 0.85rem; color: var(--text); }
.radio-texts small { font-size: 0.75rem; color: var(--text-muted); }

/* ── Confirm checkbox ── */
.checkbox-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: var(--space-sm) 0;
  padding: 8px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-section);
}

@media (max-width: 600px) {
  .modal-overlay { align-items: flex-start; padding: 10px 8px; overflow-y: auto; }
  .modal-baja-inner { max-height: none; width: 100%; border-radius: var(--radius-lg); }
}
.checkbox-confirm input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--danger);
  cursor: pointer;
}
.checkbox-confirm strong { color: var(--danger); }

/* ── Placeholder module ── */
.placeholder-module {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  gap: var(--space-md);
}
.placeholder-icon {
  font-size: 3.5rem;
  line-height: 1;
}
.placeholder-module h2 { color: var(--text); margin: 0; }
.placeholder-module p  { color: var(--text-muted); max-width: 400px; margin: 0; }
.placeholder-note      { font-size: 0.88rem; }

/* ── Stat cards – clickable ────────────────────────────────────── */
.stat-clickable {
  cursor: pointer;
  transition: transform var(--ease-fast), box-shadow var(--ease-fast);
  position: relative;
}
.stat-clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.13);
}
.stat-clickable:active { transform: translateY(0); }
.stat-arrow {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 1.1rem;
  opacity: .45;
  transition: opacity var(--ease-fast), right var(--ease-fast);
}
.stat-clickable:hover .stat-arrow {
  opacity: .85;
  right: 8px;
}

/* ── Condition toggle buttons ──────────────────────────────────── */
.cond-toggles-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.cond-toggles-single-line {
  flex-wrap: nowrap;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cond-toggle-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.cond-toggle-btn {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  border: none;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--ease-fast);
}
.cond-toggle-btn:active { opacity: .85; }
.cond-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform var(--ease-fast);
  pointer-events: none;
}
.cond-off {
  background: #c8c8c8;
}
.cond-on {
  background: var(--primary);
}
.cond-on .cond-thumb {
  transform: translateX(20px);
}
.cond-lbl {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  outline: none;
  border-bottom: 1px dashed transparent;
  cursor: text;
  transition: border-color var(--ease-fast);
  min-width: 20px;
}
.cond-lbl:focus,
.cond-lbl:hover {
  border-bottom-color: var(--primary);
  color: var(--text);
}
/* ── Tipo de bloqueo ── */
.lock-type-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.lock-type-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ease-fast), border-color var(--ease-fast), color var(--ease-fast), transform var(--ease-fast);
}
.lock-type-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eaf3ed;
}
.lock-type-btn:active { transform: scale(.93); }
.lock-type-active {
  border-color: var(--primary);
  background: #eaf3ed;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(76,130,90,.18);
}
#lock-value-wrap {
  margin-top: 8px;
}
#lock-value-wrap > input[type="text"] {
  width: 100%;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 0.92rem;
}

/* ── Patrón de desbloqueo ── */
#pattern-trigger-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: 6px;
  flex-wrap: wrap;
}
.pattern-status-text {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}
.pattern-modal-box {
  max-width: 320px;
}
.pattern-hint-error {
  color: var(--danger) !important;
  font-style: normal !important;
  font-weight: 600;
}
.pattern-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 6px;
  user-select: none;
}
.pattern-svg {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  overflow: visible;
}
.pattern-dots {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 52px);
  gap: 24px;
  padding: 8px;
}
.pdot {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  background: var(--bg-section);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
}
.pdot::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.12s;
}
.pdot:hover {
  border-color: var(--primary-light);
  transform: scale(1.07);
}
.pdot-active {
  border-color: var(--primary);
  background: #eaf3ed;
  transform: scale(1.08);
}
.pdot-active::after {
  background: var(--primary);
}
.pdot-order {
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 9px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.pattern-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}
.pattern-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-style: italic;
}

.cond-extra-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
@media (max-width: 700px) {
  .cond-extra-grid { grid-template-columns: 1fr 1fr; }
  .cond-toggles-row { gap: var(--space-sm); }
}

/* ── Settings page ─────────────────────────────────────────────── */
.settings-page {
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
}
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

/* ── SCHEDULE PICKER ──────────────────────────────────────── */
.schedule-picker-group { position: relative; }
.schedule-picker-wrap  { position: relative; }

.schedule-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--ease-fast);
}
.schedule-picker-btn:hover { border-color: var(--primary); }
.sched-icon  { font-size: 1rem; }
.sched-caret { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); transition: transform 0.2s; }

.schedule-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  width: 360px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
}
.schedule-dropdown.open { display: block; }
.schedule-picker-btn:has(+ .schedule-dropdown.open) .sched-caret { transform: rotate(180deg); }

.sched-section { margin-bottom: 14px; }
.sched-section-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sched-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sched-preset-btn {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--ease-fast);
}
.sched-preset-btn:hover,
.sched-preset-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sched-days-table {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sched-day-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--ease-fast);
}
.sched-day-row:hover { background: var(--bg-elevated); }
.sched-day-row.sched-day-disabled { opacity: 0.4; }

.sched-day-chk {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all var(--ease-fast);
}
.sched-day-chk:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.sched-day-chk:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.sched-day-name {
  width: 34px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.sched-day-row input[type="time"] {
  width: 88px;
  padding: 5px 7px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--ease-fast);
}
.sched-day-row input[type="time"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78,125,98,0.12);
}
.sched-day-row input[type="time"]:disabled { cursor: not-allowed; }

.sched-time-sep {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sched-apply-btn {
  width: 100%;
  padding: 9px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: background var(--ease-fast);
}
.sched-apply-btn:hover { background: var(--primary-dark); }
.settings-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--primary-light);
}
.settings-logo-row {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.settings-logo-preview img {
  max-height: 70px;
  max-width: 200px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  background: #fff;
}
.settings-logo-placeholder {
  width: 120px;
  height: 60px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: var(--text-muted);
}
.settings-logo-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.settings-hint {
  font-size: .8rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
  font-weight: 400;
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-bottom: var(--space-xl);
}
/* .req-star — ver definición canónica debajo en "FASE 3 – NUEVOS ESTILOS" */

/* ── Notification modal ────────────────────────────────────────── */
.modal-notify-inner {
  max-width: 420px;
  width: 90vw;
}
.notify-desc {
  font-size: .92rem;
  color: var(--text);
  margin: var(--space-md) 0 var(--space-sm);
  text-align: center;
}
.notify-delivery-info {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .82rem;
  color: #2e7d32;
  margin-bottom: var(--space-md);
  text-align: center;
  line-height: 1.5;
}
.ndi-label { font-weight: 700; }
.notify-btns {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.btn-notify-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: #25d366;
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: .93rem;
  transition: filter var(--ease-fast);
}
.btn-notify-wa:hover { filter: brightness(1.1); }
.btn-notify-email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: #1565c0;
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: .93rem;
  transition: filter var(--ease-fast);
}
.btn-notify-email:hover { filter: brightness(1.1); }

/* ── Meta section ── */
.detail-meta { border-color: var(--bg-section); }

/* ── Responsive Phase 3 ── */
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .form-row-2  { grid-template-columns: 1fr; }
  .form-row-3  { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .status-tabs { gap: 4px; }
  .status-tab  { font-size: 0.76rem; padding: 4px 10px; }
  .module-toolbar { flex-direction: column; align-items: flex-start; }
  .module-toolbar-right { width: 100%; }
  .search-input { width: 100%; }
  .panel-form { padding: var(--space-lg); }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }
}


/* ================================================================
   FASE 3 – NUEVOS ESTILOS (impresión, catálogo, cliente inline)
   ================================================================ */

/* ── Status repaired ── */
.status-repaired { background: rgba(45,130,100,0.15); color: #1a6b4a; }

/* ── Required star / optional tag / internal label ── */
.req-star          { color: var(--danger); font-weight: 700; margin-left: 2px; }
.optional-tag      { font-size: 0.78rem; font-weight: 400; color: var(--text-faint); }
.cost-internal-lbl   { color: var(--text-faint); font-style: italic; }
.costos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-sm);
}
.costos-grid .form-group label { font-size: 0.75rem; }
.costos-grid input[type="number"] { font-size: 0.85rem; padding: 6px 8px; }

/* ── Registro Fotográfico ── */
.photo-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 var(--space-sm);
  line-height: 1.4;
}
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-sm);
  min-height: 0;
}
.photo-thumb {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--border-light);
  background: var(--bg-section);
  flex-shrink: 0;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-delete-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(220,38,38,0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.photo-delete-btn:hover { background: rgba(185,28,28,1); }
.btn-photo-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-section);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-photo-add:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-hover);
}
.btn-photo-add:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.serial-autofill-hint {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 3px;
  display: block;
}

/* ── 4-column form row ── */
.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

/* ── Searchable select ── */
.ss-wrap {
  position: relative;
}
.ss-input {
  width: 100%;
  padding: 8px 32px 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  background: var(--bg-section);
  color: var(--text);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.ss-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background-color: #fff;
}
.ss-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
  z-index: 900;
  max-height: 220px;
  overflow-y: auto;
}
.ss-dropdown.ss-open { display: block; }
.ss-opt {
  padding: 8px 12px;
  font-size: 0.87rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.ss-opt:hover, .ss-opt-active { background: var(--bg-section); color: var(--primary-dark); }
.ss-opt-name { font-weight: 600; }
.ss-opt-sub  { font-size: 0.78rem; color: var(--text-muted); margin-left: auto; }
.ss-empty    { padding: 10px 12px; font-size: 0.85rem; color: var(--text-muted); }
.ss-with-add { display: flex; gap: 6px; align-items: flex-start; }
.ss-with-add .ss-wrap { flex: 1; min-width: 0; }

/* ── Select + Add New ── */
.select-add-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}
.select-full {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: var(--bg-white);
  color: var(--text);
  transition: border-color var(--ease);
}
.select-full:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.btn-add-option {
  background: var(--bg-section);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 9px;
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--ease);
  line-height: 1;
}
.btn-add-option:hover {
  background: var(--primary-glow);
  border-color: var(--primary-light);
}
.add-option-panel {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
}
.add-option-input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius-md);
  font-size: 0.87rem;
  background: var(--bg-white);
  color: var(--text);
}
.add-option-input:focus { outline: none; box-shadow: 0 0 0 3px var(--primary-glow); }

/* ── Inline client form ── */
.inline-client-form {
  background: var(--bg-section);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.inline-form-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}
.inline-form-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.client-saved-badge {
  margin-top: var(--space-sm);
  font-size: 0.87rem;
}
.saved-ok {
  color: var(--success);
  font-weight: 500;
}

/* ── Cliente existente encontrado al buscar por ID ── */
#nic-existing-preview {
  margin: var(--space-sm) 0;
}
.nic-found-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
}
.nic-found-icon {
  color: #16a34a;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
}
.nic-found-info {
  flex: 1;
  min-width: 0;
}
.nic-found-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text-main);
}
.nic-found-detail {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.nic-found-note {
  font-size: 0.78rem;
  color: #16a34a;
  margin-top: 3px;
  font-style: italic;
}
.inline-form-actions-alt {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

/* ── Text link button ── */
.btn-text-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.83rem;
  cursor: pointer;
  padding: 3px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  align-self: flex-start;
  text-align: left;
}
.btn-text-link:hover { color: var(--primary-dark); }

/* ── Botón Crear nuevo cliente ── */
.btn-new-client {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #4caf50;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(67,160,71,0.28);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  white-space: nowrap;
}
.btn-new-client:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(67,160,71,0.38);
}
.btn-new-client:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

/* ── Mono cell ── */
.mono-cell { font-family: var(--font-mono); font-size: 0.88rem; }

/* ── Print modal ── */
.modal-print-inner {
  max-width: 500px;
  width: 100%;
}

/* ── Vista previa de impresión (iframe inline) ── */
.print-preview-box {
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.28);
}
/* Tamaños por formato */
.ppb-a4     { width: 880px;  max-width: 96vw; height: 94vh; }
.ppb-ticket { width: 420px;  max-width: 96vw; height: 90vh; }
.ppb-label  { width: 640px;  max-width: 96vw; height: 380px; }

.print-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--bg-section);
  border-bottom: 1.5px solid var(--border-light);
  flex-shrink: 0;
  gap: var(--space-md);
}
.print-preview-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
}
.print-preview-actions { display: flex; gap: var(--space-sm); }

/* Área scrollable con fondo gris */
.print-preview-content {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  background: #d8d8d8;
}
.ppc-label {
  align-items: center;
  justify-content: center;
}

/* iframes por formato */
.pf-a4 {
  width: 794px;
  min-height: 1060px;
  border: none;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.22);
}
.pf-ticket {
  width: 310px;
  min-height: 600px;
  border: none;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.22);
}

/* Etiqueta: wrapper que ocupa el espacio del iframe escalado */
.label-preview-wrap {
  width: 576px;   /* 192px × 3 */
  height: 288px;  /* 96px  × 3 */
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  border-radius: 6px;
}
.pf-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 192px;
  height: 96px;
  border: none;
  transform: scale(3);
  transform-origin: top left;
}
.print-select-icon { font-size: 2.5rem; display: block; text-align: center; margin-bottom: 4px; }
.print-options {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin: var(--space-lg) 0;
}
.print-opt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-lg) var(--space-xl);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-white);
  cursor: pointer;
  transition: all var(--ease);
  min-width: 110px;
}
.print-opt-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.po-icon { font-size: 1.8rem; }
.po-label { font-size: 1rem; font-weight: 700; color: var(--text); }
.po-sub { font-size: 0.72rem; color: var(--text-faint); text-align: center; }

.print-opt-ticket { border-color: #2980b9; }
.print-opt-ticket:hover { background: rgba(41,128,185,0.06); border-color: #2980b9; }
.print-opt-ticket .po-label { color: #2980b9; }

.print-opt-a4 { border-color: var(--danger); }
.print-opt-a4:hover { background: rgba(176,64,64,0.05); }
.print-opt-a4 .po-label { color: var(--danger); }

.print-opt-label { border-color: var(--success); }
.print-opt-label:hover { background: rgba(46,125,82,0.06); }
.print-opt-label .po-label { color: var(--success); }

/* ── Business settings collapsible ── */
.biz-settings-details {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.biz-settings-details summary {
  padding: 10px 14px;
  cursor: pointer;
  background: var(--bg-section);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  list-style: none;
  user-select: none;
}
.biz-settings-details summary::-webkit-details-marker { display: none; }
.biz-settings-details[open] summary {
  border-bottom: 1px solid var(--border-light);
  color: var(--primary);
}
.biz-settings-form {
  padding: var(--space-lg);
  background: var(--bg-white);
}

@media (max-width: 640px) {
  .print-options { flex-direction: column; align-items: center; }
  .form-row-4    { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════
   MÓDULO REPORTES
   ═══════════════════════════════════════════════ */
.rep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.rep-header-actions { display: flex; gap: var(--space-sm); }

/* Tabs */
.rep-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.rep-tab {
  background: none;
  border: none;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.rep-tab:hover  { color: var(--primary); background: var(--bg-hover); }
.rep-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Panels */
.rep-panel { display: none; }
.rep-panel.active { display: block; }

/* KPI row */
.rep-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.rep-kpi {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.rep-kpi.green { border-color: var(--primary-light); background: #f1f8f1; }
.rep-kpi-val { font-size: 1.6rem; font-weight: 800; color: var(--text-dark); line-height: 1; }
.rep-kpi.green .rep-kpi-val { color: var(--primary-dark); }
.rep-kpi-lbl { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; text-align: center; }

/* Chart wrappers */
.rep-chart-wrap {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.rep-chart-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--space-md);
}
.rep-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.rep-chart-half { margin-bottom: 0; }

/* Tables */
.rep-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-light);
}
.rep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.rep-table th {
  background: var(--bg-section);
  padding: 9px 12px;
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.rep-table td {
  padding: 9px 12px;
  border-top: 1px solid var(--border-light);
  color: var(--text-dark);
  vertical-align: middle;
  text-align: center;
}
.rep-table tr:hover td { background: var(--bg-hover); }
.rep-table td.num  { text-align: center; font-variant-numeric: tabular-nums; }
.rep-table td.bold { font-weight: 700; }
.rep-table td.green { color: var(--primary-dark); }
.rep-table tr.sep td { border-top: 2px solid var(--border-light); }
.rep-table tr.green-row td { background: #f1f8f1; }

/* Rate badges */
.rep-rate { display: inline-block; padding: 2px 8px; border-radius: 20px; font-weight: 700; font-size: 0.8rem; }
.rep-rate-ok  { background: #e8f5e9; color: #2e7d32; }
.rep-rate-mid { background: #fff8e1; color: #f57f17; }
.rep-rate-low { background: #fce4ec; color: #c62828; }

/* Finance cards grid */
.rep-fin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.rep-fin-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.rep-fin-card.green  { border-color: var(--primary-light); background: #f1f8f1; }
.rep-fin-card.warn   { border-color: #ffe082; background: #fffde7; }
.rep-fin-card.danger { border-color: #ef9a9a; background: #fce4ec; }
.rep-fin-icon { font-size: 1.6rem; line-height: 1; }
.rep-fin-val  { font-size: 1.4rem; font-weight: 800; color: var(--text-dark); }
.rep-fin-lbl  { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

.rep-finance-summary { margin-top: var(--space-lg); }
.rep-empty { padding: var(--space-xl); text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* Pastillas de estado en distribución */
.rep-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-md);
}
.rep-status-pills .status-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  gap: 5px;
}
.rep-status-pills .status-badge strong {
  font-size: 0.82rem;
  font-weight: 800;
  margin-left: 2px;
}
.rep-pill-zero {
  opacity: 0.38;
  filter: grayscale(0.6);
}

/* ================================================================
   RECORDATORIOS DE MANTENIMIENTO
   ================================================================ */

/* Nav badge */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e53935;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: auto;
  line-height: 1;
}

/* Widget en dashboard */
.maint-alert-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  border-left: 5px solid #f9a825;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.maint-alert-icon { font-size: 1.7rem; flex-shrink: 0; }
.maint-alert-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.maint-alert-body strong { font-size: .95rem; color: #5d4037; }
.maint-alert-body span  { font-size: .82rem; color: #795548; }

/* Sección recordatorios */
.section-header { margin-bottom: 20px; }
.section-header h2 { font-size: 1.25rem; color: var(--green-dark); margin: 0 0 4px; }
.section-sub { font-size: .85rem; color: var(--muted); margin: 0; }

.maint-list { display: flex; flex-direction: column; gap: 14px; }

.maint-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.maint-card-sent { border-color: #a5d6a7; background: #f1f8e9; }

.maint-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.maint-card-client { display: flex; flex-direction: column; gap: 3px; }
.maint-client-name { font-weight: 700; font-size: 1rem; color: var(--text); }
.maint-client-contact { font-size: .8rem; color: var(--muted); }

.maint-card-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.maint-order-num { font-size: .78rem; font-weight: 600; color: var(--green-dark); background: var(--green-ultra-light); padding: 2px 8px; border-radius: 20px; }
.maint-days-ago  { font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.maint-soon    { background: #fff3e0; color: #e65100; }
.maint-overdue { background: #ffebee; color: #c62828; }

.maint-card-device {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: .85rem;
  color: var(--text);
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--green-ultra-light);
  border-radius: 6px;
}
.maint-service-txt { font-size: .78rem; color: var(--muted); }

.maint-reminded-badge {
  font-size: .78rem;
  color: #2e7d32;
  background: #e8f5e9;
  border-radius: 6px;
  padding: 3px 8px;
  margin-bottom: 8px;
  display: inline-block;
}

.maint-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-maint-action   { text-decoration: none; }
.maint-no-contact   { font-size: .75rem; color: #bbb; font-style: italic; }

/* ── Print/PDF reportes ── */
@media print {
  body:not(.printing-report) .rep-header,
  body:not(.printing-report) .rep-tabs,
  body:not(.printing-report) .rep-panel { display: none !important; }

  body.printing-report #header,
  body.printing-report .app-sidebar,
  body.printing-report .trial-banner,
  body.printing-report .rep-header-actions,
  body.printing-report .rep-tabs { display: none !important; }

  body.printing-report .rep-panel { display: block !important; }
  body.printing-report .rep-chart-wrap { page-break-inside: avoid; }
  body.printing-report .rep-table-wrap { page-break-inside: avoid; }
}

@media (max-width: 700px) {
  .rep-charts-row { grid-template-columns: 1fr; }
  .rep-kpi-val    { font-size: 1.3rem; }
}


/* ────────────────────────────────────────────────────────────────
   MÓDULO – SERVICIO A DOMICILIO (ÓRDENES EXTERNAS)
   ──────────────────────────────────────────────────────────────── */

.ext-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.ext-stats {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.ext-stat {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  min-width: 110px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ext-stat span  { display: block; font-size: 1.5rem; font-weight: 800; color: var(--primary-dark); }
.ext-stat small { font-size: .75rem; color: var(--text-muted); }
.ext-stat.green span { color: #2e7d32; }

.ext-table td.num-cell   { font-weight: 700; font-size: .85rem; }
.ext-table td.small-text { font-size: .78rem; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Formulario externa ── */
.ext-panels-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

/* ── Detalle externa ── */
.ext-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.detail-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.detail-card-title {
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary-dark);
  margin-bottom: var(--space-sm);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: .82rem;
  line-height: 1.4;
}
.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.detail-row.bold { font-weight: 800; font-size: .88rem; color: #1b5e20; }
.detail-row .green { color: #2e7d32; font-weight: 700; }

/* ── Modal notificar técnico ── */
.notify-msg-preview {
  font-size: .8rem;
  line-height: 1.6;
  background: #f5f9f5;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.cred-biz {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.cred-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ── Total en tiempo real (panel costos ext) ── */
.costos-total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: #e8f5e9;
  border: 2px solid #a5d6a7;
  border-radius: var(--radius-md);
}
.costos-total-lbl {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #2e7d32;
}
.costos-total-val {
  font-size: 1.4rem;
  font-weight: 900;
  color: #1b5e20;
}

/* ── Google Maps link input ── */
.maps-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.form-hint-inline {
  font-size: .73rem;
  color: var(--text-muted);
  font-weight: 400;
}
.maps-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.maps-input {
  flex: 1;
  min-width: 0;
  font-size: .82rem;
  color: #1565c0;
}
.maps-input::placeholder { color: #bbb; }
.btn-maps-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: #1565c0;
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s;
  flex-shrink: 0;
}
.btn-maps-open:hover { background: #0d47a1; }
.maps-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
  border-radius: var(--radius-pill);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.maps-link-btn:hover { background: #bbdefb; }

@media (max-width: 768px) {
  .ext-panels-row  { grid-template-columns: 1fr; }
  .form-row-4      { grid-template-columns: 1fr 1fr; }
  .ext-detail-grid { grid-template-columns: 1fr; }
}


/* ────────────────────────────────────────────────────────────────
   HISTORIAL TÉCNICO — rediseño completo
   ──────────────────────────────────────────────────────────────── */

/* ── Header + tabs ── */
.hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.hist-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-section);
  padding: 4px;
  border-radius: var(--radius-md);
}
.hist-tab {
  padding: 7px 18px;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.hist-tab:hover { background: var(--bg-white); color: var(--text-body); }
.hist-tab-active { background: var(--bg-white) !important; color: var(--primary-dark) !important; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ── Filtros ── */
.hist-filters {
  display: flex;
  align-items: flex-end;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
}
.hist-filter-group { display: flex; flex-direction: column; gap: 4px; }
.hist-filter-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.hist-select { padding: 7px 10px; border: 1.5px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-base); font-size: .84rem; }
.hist-date-range { flex-direction: row; align-items: center; gap: 6px; }
.hist-date-inp { padding: 7px 10px; border: 1.5px solid var(--border-light); border-radius: var(--radius-sm); font-size: .82rem; background: var(--bg-base); }
.hist-search-wrap { display: flex; gap: 6px; }
.hist-search-inp { flex: 1; padding: 8px 12px; border: 1.5px solid var(--border-light); border-radius: var(--radius-sm); font-size: .85rem; background: var(--bg-base); min-width: 280px; }
.hist-search-inp:focus { border-color: var(--primary); outline: none; }

/* ── Barra resumen ── */
.hist-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  padding: 0 2px;
}

/* ── Tarjeta de orden (timeline) ── */
.hist-orders-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.hist-order-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: border-color .15s;
}
.hist-order-card:hover { border-color: var(--primary-light); }
.hist-order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
}
.hist-order-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hist-order-num { font-size: .88rem; font-weight: 800; color: var(--primary-dark); font-family: monospace; }
.hist-order-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--text-muted); flex: 1; padding: 0 var(--space-sm); }
.hist-order-device { color: var(--text-body); font-weight: 600; }
.hist-order-total  { color: #2e7d32; font-weight: 700; }
.hist-order-actions { display: flex; gap: 4px; flex-shrink: 0; }
.badge-ext { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px; background: #e3f2fd; color: #1565c0; border-radius: 20px; border: 1px solid #90caf9; }

/* ── Eventos de la orden (línea de tiempo interna) ── */
.htl-events-wrap {
  border-top: 1px solid var(--border-light);
  background: var(--bg-base);
  padding: var(--space-sm) var(--space-md) var(--space-sm) calc(var(--space-md) + 8px);
}
.htl-events-list { display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--primary-light); padding-left: var(--space-md); }
.htl-event { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; position: relative; }
.htl-event-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
  margin-top: 4px; margin-left: -20px;
  border: 2px solid var(--bg-white);
  box-shadow: 0 0 0 1px var(--primary-light);
}
.htl-event-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: .81rem; }
.htl-event-action { font-weight: 600; color: var(--text-body); }
.htl-event-notes  { color: var(--text-muted); font-style: italic; }
.htl-event-date   { font-size: .74rem; color: var(--text-muted); white-space: nowrap; }

/* ── Tarjetas de equipos (búsqueda) ── */
.hist-eq-list { display: flex; flex-direction: column; gap: var(--space-md); }
.hist-eq-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.hist-eq-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-section);
  border-bottom: 1px solid var(--border-light);
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.hist-eq-num-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-eq-date { font-size: .76rem; color: var(--text-muted); }
.hist-eq-actions { display: flex; gap: 4px; }
.hist-eq-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.hist-eq-block {
  padding: var(--space-sm) var(--space-md);
  border-right: 1px solid var(--border-light);
}
.hist-eq-block:last-child { border-right: none; }
.hist-eq-block-title {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary-dark);
  margin-bottom: 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border-light);
}
.hist-eq-val { font-size: .81rem; color: var(--text-body); line-height: 1.5; }

/* ── Estados vacíos ── */
.hist-empty {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--text-muted);
  font-size: .9rem;
  background: var(--bg-white);
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-md);
}
.hist-search-hint { font-size: .85rem; }

/* ── Modal resumen de orden (solo lectura) ── */
.hom-box {
  max-width: 820px;
  width: 96vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}
.hom-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-section);
  border-bottom: 1.5px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1;
}
.hom-topbar-left  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hom-topbar-right { display: flex; gap: 6px; }
.hom-num { font-size: 1.1rem; font-weight: 900; color: var(--primary-dark); font-family: monospace; }
.hom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  padding: var(--space-md);
  padding-bottom: 0;
}
.hom-col {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}
.hom-section-title {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--primary-dark);
  background: #e8f5e9;
  padding: 4px 10px;
  border-left: 3px solid var(--primary);
  margin: var(--space-sm) var(--space-md) 6px;
}
.hom-col .hom-section-title { margin: 0 0 6px; padding: 3px 0; background: transparent; border-left: none; border-bottom: 1px solid var(--border-light); }
.hom-field {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: .8rem;
  padding: 3px 0;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.4;
}
.hom-field:last-child { border-bottom: none; }
.hom-field span:first-child { color: var(--text-muted); flex-shrink: 0; }
.hom-field-total { font-size: .9rem; font-weight: 900; color: #1b5e20; border-top: 1.5px solid #a5d6a7 !important; margin-top: 3px; padding-top: 3px; }
.hom-fault-box {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin: 0 var(--space-md) 6px;
  font-size: .84rem;
}
.hom-fault-label { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.hom-fault-text  { line-height: 1.5; color: var(--text-body); }
.hom-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 var(--space-md) var(--space-sm);
}
.hom-photo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
}
.hom-timeline {
  margin: 0 var(--space-md) var(--space-md);
  border-left: 2px solid var(--primary-light);
  padding-left: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hom-tl-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; position: relative; }
.hom-tl-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
  margin-top: 3px; margin-left: -20px;
  border: 2px solid var(--bg-white);
  box-shadow: 0 0 0 1px var(--primary-light);
}
.hom-tl-body { font-size: .8rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.hom-tl-action { font-weight: 600; color: var(--text-body); }
.hom-tl-notes  { color: var(--text-muted); font-style: italic; }
.hom-tl-date   { font-size: .73rem; color: var(--text-muted); white-space: nowrap; }
.hom-tl-empty  { color: var(--text-muted); font-size: .82rem; padding: var(--space-sm) 0; }

@media (max-width: 860px) {
  .hom-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .hom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .hist-header   { flex-direction: column; align-items: flex-start; }
  .hist-eq-grid  { grid-template-columns: 1fr 1fr; }
  .hist-eq-block { border-bottom: 1px solid var(--border-light); }
  .hist-eq-block:nth-child(2n) { border-right: none; }
}
@media (max-width: 600px) {
  .hist-eq-grid  { grid-template-columns: 1fr; }
  .hist-eq-block { border-right: none; }
  .hist-order-info { display: none; }
}

/* ── Órdenes urgentes (por_reparar) en tabla ── */
@keyframes urgent-pulse {
  0%, 100% { background-color: #fff3cd; }
  50%       { background-color: #ffe082; }
}
.order-row-urgent {
  animation: urgent-pulse 2s ease-in-out infinite;
  border-left: 4px solid #e65100 !important;
}
.order-row-urgent td:first-child .order-num {
  color: #bf360c;
  font-weight: 700;
}

/* ── Órdenes reparadas esperando retiro ── */
.order-row-ready { border-left: 4px solid #26a69a !important; }

@keyframes ready-pulse-warn {
  0%, 100% { background-color: #fffde7; }
  50%       { background-color: #fff9c4; }
}
@keyframes ready-pulse-alert {
  0%, 100% { background-color: #fff3e0; }
  50%       { background-color: #ffe0b2; }
}
@keyframes ready-pulse-critical {
  0%, 100% { background-color: #fce4ec; }
  50%       { background-color: #f8bbd0; }
}
.ready-ok-row    { background-color: #e8f5e9; }
.ready-warn-row  { animation: ready-pulse-warn     2.5s ease-in-out infinite; border-left-color: #f9a825 !important; }
.ready-alert-row { animation: ready-pulse-alert    2s ease-in-out infinite;   border-left-color: #ef6c00 !important; }
.ready-critical-row { animation: ready-pulse-critical 1.5s ease-in-out infinite; border-left-color: #c62828 !important; }

.badge-ready {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 4px;
  white-space: nowrap;
}
.badge-ready.ready-ok       { background: #c8e6c9; color: #1b5e20; }
.badge-ready.ready-warn     { background: #fff9c4; color: #f57f17; border: 1px solid #f9a825; }
.badge-ready.ready-alert    { background: #ffe0b2; color: #e65100; border: 1px solid #ef6c00; }
.badge-ready.ready-critical { background: #fce4ec; color: #b71c1c; border: 1px solid #c62828; }

/* ── Tarjetas cascada de órdenes pendientes (bottom-right, fixed) ── */
.pend-card {
  position: fixed;
  right: -340px;
  width: 300px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.12);
  border-left: 5px solid #e65100;
  z-index: 99999;
  overflow: hidden;
  opacity: 0;
  transition: right .45s cubic-bezier(.22,1,.36,1), bottom .3s ease, opacity .35s ease;
}
.pend-card-in {
  right: 20px;
  opacity: 1;
  animation: pend-wobble .55s ease .7s 3;
}
.pend-card-out {
  right: -340px !important;
  opacity: 0 !important;
}
@keyframes pend-wobble {
  0%,100% { transform: rotate(0) translateX(0); }
  15%      { transform: rotate(-2deg) translateX(-4px); }
  30%      { transform: rotate(2deg) translateX(4px); }
  45%      { transform: rotate(-1.2deg) translateX(-2px); }
  60%      { transform: rotate(1.2deg) translateX(2px); }
  75%      { transform: rotate(-.6deg) translateX(-1px); }
}
.pend-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 9px;
  background: linear-gradient(135deg, #bf360c, #e65100);
  color: #fff;
}
.pend-card-bell {
  font-size: 1.4rem;
  flex-shrink: 0;
  animation: pend-bell 1.2s ease infinite;
}
@keyframes pend-bell {
  0%,55%,100% { transform: rotate(0); }
  10%  { transform: rotate(-18deg); }
  20%  { transform: rotate(18deg); }
  30%  { transform: rotate(-12deg); }
  40%  { transform: rotate(12deg); }
  50%  { transform: rotate(0); }
}
.pend-card-titles { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.pend-card-label  { font-size: .65rem; font-weight: 700; letter-spacing: .8px; opacity: .85; text-transform: uppercase; }
.pend-card-num    { font-size: 1rem; font-weight: 800; letter-spacing: .3px; }
.pend-close {
  background: rgba(255,255,255,.18);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: #fff;
  font-size: .78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.pend-close:hover { background: rgba(255,255,255,.38); }
.pend-card-body { padding: 10px 13px 6px; display: flex; flex-direction: column; gap: 4px; }
.pend-card-row   { font-size: .84rem; color: #444; display: flex; align-items: center; gap: 5px; }
.pend-card-client{ font-weight: 700; color: #222; }
.pend-card-time  { font-size: .78rem; color: #777; }
.pend-card-time-old { color: #c62828; font-weight: 700; }
.pend-card-actions {
  display: flex;
  gap: 6px;
  padding: 8px 13px 10px;
}
.pend-card-actions .btn { flex: 1; font-size: .79rem; padding: 5px 6px; }
.pend-card-more {
  text-align: center;
  font-size: .72rem;
  color: #bf360c;
  background: #fff3e0;
  padding: 5px;
  border-top: 1px solid #ffcc80;
  font-weight: 700;
  letter-spacing: .2px;
}

/* ── Tarjetas: variantes transferencia y disponible ── */
.pend-card-avail   { border-left-color: #2e7d32; }
.pend-card-takeover{ border-left-color: #1565c0; }

.pend-hdr-avail {
  background: linear-gradient(135deg, #1b5e20, #2e7d32) !important;
}
.pend-hdr-takeover {
  background: linear-gradient(135deg, #0d47a1, #1565c0) !important;
}

.pend-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #1a237e;
  background: #e8eaf6;
  border-radius: 6px;
  padding: 5px 8px;
  margin-top: 2px;
}
.pend-code-badge {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: #1565c0;
  background: #fff;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1.5px solid #90caf9;
  font-family: monospace;
}
.pend-code-entry {
  background: #f9fbe7;
  border-top: 1px solid #e6ee9c;
  padding: 8px 13px !important;
}
.pend-code-entry small { font-size: 0.72rem; color: #555; }
.pend-code-input-row {
  display: flex;
  gap: 6px;
  margin-top: 5px;
}
.pend-code-inp {
  flex: 1;
  border: 1.5px solid #aed581;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.9rem;
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
}
.pend-code-inp:focus { outline: none; border-color: #7cb342; }

/* ── Módulo Mi Rendimiento (técnicos) ── */
.mr-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.mr-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.mr-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.mr-kpi-highlight {
  border-color: #66bb6a;
  background: #f1f8f1;
}
.mr-kpi-icon { font-size: 1.5rem; }
.mr-kpi-val  { font-size: 1.7rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.mr-kpi-lbl  { font-size: 0.74rem; color: var(--text-muted); font-weight: 500; }

.mr-rate-val        { }
.mr-rate-ok  .mr-kpi-val, .mr-rate-val.mr-rate-ok   { color: #2e7d32; }
.mr-rate-mid .mr-kpi-val, .mr-rate-val.mr-rate-mid  { color: #f57f17; }
.mr-rate-low .mr-kpi-val, .mr-rate-val.mr-rate-low  { color: #c62828; }

.mr-cur-month { background: #f1f8f1; font-weight: 600; }
.mr-now-tag {
  display: inline-block;
  font-size: 0.65rem;
  background: var(--primary);
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  vertical-align: middle;
  margin-left: 4px;
}
.mr-disclaimer {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 8px 16px 4px;
  font-style: italic;
}
.mr-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 18px;
}
.mr-filter-lbl { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.mr-filter-sep { color: var(--text-muted); font-weight: 700; }
.mr-date-inp {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--text-primary);
  cursor: pointer;
}

/* ── Dashboards por rol ── */
.welcome-card-tech {
  border-left: 4px solid #66bb6a;
  background: linear-gradient(135deg, #e8f5e9 0%, #f9fbe7 100%);
}
.welcome-card-reg {
  border-left: 4px solid #42a5f5;
  background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
}
/* Sobreescribir colores de texto para fondos claros */
.welcome-card-tech .welcome-text h2,
.welcome-card-reg  .welcome-text h2  { color: var(--text-primary); }
.welcome-card-tech .welcome-text p,
.welcome-card-reg  .welcome-text p   { color: var(--text-secondary); }
.welcome-card-tech .welcome-date,
.welcome-card-reg  .welcome-date     { color: var(--text-muted); }

.role-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  vertical-align: middle;
}
.role-badge-inline.badge-admin       { background: #ede7f6; color: #4527a0; }
.role-badge-inline.badge-tech        { background: #e8f5e9; color: #1b5e20; }
.role-badge-inline.badge-registrador { background: #e3f2fd; color: #0d47a1; }

.user-info-role { margin-top: 4px; }

.role-dash-notice {
  background: #fff8e1;
  border: 1.5px solid #ffa000;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.83rem;
  color: #5d4037;
  margin-bottom: 16px;
}

.reg-cta-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
}
.reg-btn-nueva {
  flex: 1;
  min-width: 200px;
}

/* ── Modal registrar entrega ── */
.entrega-order-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.entrega-num    { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.entrega-device { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.entrega-client { font-size: 0.85rem; color: var(--text-secondary); }

/* ── Botones de opción tipo tab ── */
.entrega-toggle-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.entrega-opt-btn {
  flex: 1;
  padding: 10px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  text-align: center;
}
.entrega-opt-btn.active {
  border-color: var(--primary);
  background: #f1f8f1;
  color: var(--primary-dark, #388e3c);
}
.entrega-opt-btn:hover:not(.active) {
  border-color: #bdbdbd;
  background: #f5f5f5;
}

/* ── Paneles del modal de entrega ── */
.entrega-panel {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  background: #fafafa;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}
.entrega-panel .form-row-2 {
  grid-template-columns: 1fr 1fr;
  min-width: 0;
}
.entrega-panel .form-row-2 > * {
  min-width: 0;
}
.entrega-panel .form-group input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.entrega-tercero-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark, #388e3c);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 12px;
}

/* ── Datos del dueño (panel solo lectura) ── */
.entrega-owner-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.entrega-owner-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
}
.entrega-owner-row:last-child { border-bottom: none; }
.eor-lbl { color: var(--text-muted); font-size: .8rem; }
.eor-val { font-weight: 600; color: var(--text-primary); }
.entrega-owner-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

/* Sección en detalle de orden */
.entrega-tercero-detail {
  border-left: 3px solid #66bb6a;
}
.entrega-tercero-detail .detail-section-title {
  color: #388e3c;
}

/* ── Carga laboral de técnicos (formulario de orden) ── */
.tech-workload-panel {
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.twp-row {
  display: grid;
  grid-template-columns: 1fr 90px 38px;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.twp-row:hover { background: var(--bg); }
.twp-row.twp-sel {
  background: #e8f5e9;
  outline: 1.5px solid var(--primary);
}
.twp-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.twp-bar {
  display: block;
  height: 7px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}
.twp-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.twp-fill.twp-free { width: 0; }
.twp-fill.twp-low  { background: #66bb6a; }
.twp-fill.twp-mid  { background: #ffa726; }
.twp-fill.twp-high { background: #ef5350; }
.twp-cnt {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.twp-cnt-free { color: #66bb6a; }
.twp-cnt-low  { color: #66bb6a; }
.twp-cnt-mid  { color: #ffa726; }
.twp-cnt-high { color: #ef5350; }

/* ── Módulo Liquidación de Técnicos ── */
.liq-filters {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: var(--space-lg);
}
.liq-filter-lbl { font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.liq-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  background: var(--bg-white);
  color: var(--text);
  cursor: pointer;
}
.liq-date-inp {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  background: var(--bg-white);
  color: var(--text);
}
.liq-content { width: 100%; }

/* tarjetas resumen por técnico */
.liq-tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}
.liq-tech-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.liq-tech-card:hover { box-shadow: var(--shadow-md); }
.liq-tc-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border-bottom: 1px solid var(--border-light);
}
.liq-tc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
}
.liq-tc-name { font-weight: 700; font-size: 1rem; color: var(--text); }
.liq-tc-spec { font-size: .78rem; color: var(--text-muted); }
.liq-tc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-light);
}
.liq-tc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm) var(--space-xs);
  background: var(--bg-white);
  text-align: center;
}
.liq-tc-stat-val { font-size: .95rem; font-weight: 700; color: var(--primary-dark); }
.liq-tc-stat-lbl { font-size: .68rem; color: var(--text-muted); }
.liq-tc-totals {
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--border-light);
}
.liq-tc-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: .88rem;
}
.liq-tc-total-val { font-weight: 700; color: #2e7d32; font-size: .95rem; }
.liq-tc-pct span:first-child { color: var(--text-muted); }
.liq-tc-comm-val { font-weight: 700; color: #e65100; font-size: .95rem; }
.liq-tc-actions {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  background: var(--bg-light);
}
.liq-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  font-size: .9rem;
  background: var(--bg-white);
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-md);
}

/* detalle de técnico */
.liq-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.liq-detail-title {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.liq-detail-name { font-weight: 700; font-size: 1.1rem; color: var(--primary-dark); }
.liq-detail-spec { font-size: .8rem; color: var(--text-muted); }
.liq-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.liq-sc {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.liq-sc-val { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.liq-sc-lbl { font-size: .75rem; color: var(--text-muted); }
.liq-sc.green .liq-sc-val { color: #2e7d32; }
.liq-sc.green-dark { background: #e8f5e9; border-color: #a5d6a7; }
.liq-sc.green-dark .liq-sc-val { color: #1b5e20; font-size: 1.4rem; }
.liq-sc.orange { background: #fff3e0; border-color: #ffcc80; }
.liq-sc.orange .liq-sc-val { color: #e65100; font-size: 1.4rem; }
.liq-orders-table-wrap { background: var(--bg-white); border-radius: var(--radius-md); overflow: auto; border: 1px solid var(--border-light); }
.liq-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.liq-table thead th {
  background: #1b5e20;
  color: #fff;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.liq-row td { padding: 7px 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.liq-row:hover td { background: #f1f8e9; }
.liq-table tfoot .liq-foot td { background: #e8f5e9 !important; font-size: .9rem; border-top: 2px solid #2e7d32; }
.liq-table tfoot .liq-foot-comm td { background: #fff3e0 !important; font-size: .95rem; border-top: 1px solid #ffcc80; }
.liq-table .num { text-align: right; }
.liq-table .bold { font-weight: 700; }
.liq-table .green { color: #2e7d32; }
.liq-table .orange { color: #e65100; }

@media (max-width: 700px) {
  .liq-tech-grid { grid-template-columns: 1fr; }
  .liq-tc-stats  { grid-template-columns: repeat(2, 1fr); }
  .liq-summary-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ── Modal notificación post-creación orden externa ── */
.enc-notify-box {
  max-width: 860px;
  width: 96vw;
  padding: var(--space-lg) !important;
}
.enc-notify-subtitle {
  margin: 4px 0 var(--space-lg);
  font-size: .88rem;
  color: var(--text-muted);
}
.enc-notify-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}
.enc-notify-panel {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.enc-notify-panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 16px;
  color: #fff;
}
.enc-panel-client { background: linear-gradient(135deg, #1565c0, #1976d2); }
.enc-panel-tech   { background: linear-gradient(135deg, #2e7d32, #43a047); }
.enc-notify-panel-icon { font-size: 1.6rem; }
.enc-notify-panel-title { font-weight: 700; font-size: .98rem; }
.enc-notify-panel-sub   { font-size: .78rem; opacity: .88; margin-top: 2px; }
.enc-notify-msg {
  flex: 1;
  padding: 12px 14px;
  font-size: .78rem;
  line-height: 1.6;
  color: #444;
  background: #fafafa;
  border-bottom: 1px solid var(--border-light);
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.enc-notify-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: #fff;
}
.enc-wa-btn    { background: #25d366 !important; border-color: #25d366 !important; color: #fff !important; font-weight: 600; }
.enc-wa-btn:hover { background: #1ebe5d !important; }
.enc-email-btn { font-size: .82rem; }
.enc-notify-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}
@media (max-width: 640px) {
  .enc-notify-panels { grid-template-columns: 1fr; }
}

/* ── Checklist de diagnóstico por tipo de equipo ── */
.chk-wrapper {
  margin: 18px 0 8px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.chk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0faf0, #e8f5e9);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.chk-top-left  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chk-top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chk-main-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.chk-cat-badge {
  font-size: .72rem;
  font-weight: 600;
  background: #c8e6c9;
  color: #2e7d32;
  padding: 2px 8px;
  border-radius: 20px;
}
.chk-readonly-badge {
  font-size: .7rem;
  font-weight: 600;
  background: #f3e5f5;
  color: #7b1fa2;
  padding: 2px 8px;
  border-radius: 20px;
}
.chk-prog-wrap {
  width: 110px;
  height: 7px;
  background: #ddd;
  border-radius: 10px;
  overflow: hidden;
}
.chk-prog-bar {
  height: 100%;
  border-radius: 10px;
  transition: width .35s ease, background .3s ease;
}
.chk-prog-lbl {
  font-size: .78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 80px;
}

/* Body expandible */
.chk-body { padding: 0 16px 14px; }
.chk-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.chk-section {
  border: 1px solid var(--border-light);
  border-radius: 9px;
  overflow: hidden;
}
.chk-sec-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid var(--border-light);
}
.chk-sec-title { font-size: .82rem; font-weight: 700; color: var(--text-primary); }
.chk-sec-count {
  font-size: .75rem;
  font-weight: 700;
  color: #888;
  background: #e0e0e0;
  padding: 1px 7px;
  border-radius: 20px;
}
.chk-sec-all { background: #c8e6c9; color: #2e7d32; }

/* Items */
.chk-items { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.chk-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}
.chk-item:hover { background: #f5f5f5; }
.chk-item-done .chk-label {
  text-decoration: line-through;
  color: #aaa;
}
.chk-item-done .chk-box { background: #43a047; border-color: #43a047; }
.chk-item-done .chk-box::after { opacity: 1; }

/* Custom checkbox */
.chk-inp { display: none; }
.chk-box {
  display: inline-block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 2px solid #bbb;
  border-radius: 4px;
  background: #fff;
  transition: background .15s, border-color .15s;
  position: relative;
}
.chk-box::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(40deg);
  opacity: 0;
  transition: opacity .1s;
}
.chk-label {
  font-size: .82rem;
  color: var(--text-primary);
  line-height: 1.35;
  flex: 1;
  transition: color .15s;
}
/* Hover over label: highlight box */
.chk-item:hover .chk-box { border-color: #43a047; }

/* Disabled state (read-only) */
.chk-item:has(.chk-inp:disabled) { cursor: default; opacity: .75; }
.chk-item:has(.chk-inp:disabled):hover { background: transparent; }

/* Locked badge */
.chk-locked-badge {
  font-size: .7rem;
  font-weight: 700;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Footer */
.chk-footer {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 10px 10px;
  background: #fffde7;
}
.chk-footer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chk-warning-txt {
  font-size: .78rem;
  color: #e65100;
  font-weight: 600;
}
.chk-locked-notice {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: .8rem;
  font-weight: 600;
  flex-direction: row;
  align-items: center;
}
.chk-saved-msg {
  font-size: .78rem;
  color: #43a047;
  font-weight: 600;
}

/* Toggle button micro-style */
.btn.btn-xs {
  font-size: .74rem;
  padding: 3px 10px;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .chk-sections-grid { grid-template-columns: 1fr; }
  .chk-top { flex-direction: column; align-items: flex-start; }
  .chk-prog-wrap { width: 100%; }
}

/* ── Modal de vista previa del checklist ── */
.chkp-modal {
  max-width: 680px;
  width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chkp-info-bar {
  padding: 10px 16px;
  background: #f5f5f5;
  border-bottom: 1px solid var(--border-light);
}
.chkp-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: .83rem;
}
.chkp-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.chkp-badge-locked  { background: #e8f5e9; color: #2e7d32; }
.chkp-badge-pending { background: #fff3e0; color: #e65100; }
.chkp-prog-outer {
  height: 8px;
  background: #e0e0e0;
  margin: 10px 16px 0;
  border-radius: 6px;
  overflow: hidden;
}
.chkp-prog-fill {
  height: 100%;
  border-radius: 6px;
  transition: width .4s ease;
}
.chkp-prog-txt {
  font-size: .82rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 4px 0 8px;
}
.chkp-sections-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  align-content: start;
}
.chkp-section {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}
.chkp-sec-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  background: #f0f0f0;
  font-size: .8rem;
  font-weight: 700;
}
.chkp-sec-cnt {
  font-size: .72rem;
  font-weight: 700;
  background: #e0e0e0;
  padding: 1px 6px;
  border-radius: 20px;
  color: #666;
}
.chkp-sec-all { background: #c8e6c9; color: #2e7d32; }
.chkp-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 10px;
  border-bottom: 1px solid #f5f5f5;
  font-size: .79rem;
}
.chkp-item:last-child { border-bottom: none; }
.chkp-ico { font-size: .85rem; flex-shrink: 0; margin-top: 1px; color: #bbb; }
.chkp-done .chkp-ico { color: #43a047; }
.chkp-txt { color: #777; line-height: 1.35; }
.chkp-done .chkp-txt { color: #222; }
.chkp-modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 600px) {
  .chkp-sections-scroll { grid-template-columns: 1fr; }
}


/* ================================================================
   INFORME TÉCNICO (Fase 2B)
   ================================================================ */

/* Botón de acceso desde el detalle de orden */
.btn-report-accent {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.btn-report-accent:hover {
  background: var(--primary);
  color: #fff;
}
.rep-wa-btn {
  border-color: #25d366;
  color: #128c48;
  font-weight: 600;
}
.rep-wa-btn:hover {
  background: #25d366;
  color: #fff;
}

/* ── Botón Presupuesto en detalle de orden ─────────────────── */
.btn-quote-accent {
  border-color: #f57c00;
  color: #e65100;
  font-weight: 600;
}
.btn-quote-accent:hover {
  background: #f57c00;
  color: #fff;
}

/* ── Módulo Presupuestos ───────────────────────────────────── */
.quo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  border: 1.5px solid;
}
.quo-badge-draft    { background: #fff8e1; color: #e65100; border-color: #ffcc02; }
.quo-badge-sent     { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.quo-badge-approved { background: #e8f5e9; color: #1b5e20; border-color: #81c784; }
.quo-badge-rejected { background: #fce4ec; color: #c62828; border-color: #ef9a9a; }

.quo-table-wrap {
  overflow-x: auto;
  margin-bottom: 4px;
}
.quo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.quo-th {
  padding: 8px 10px;
  background: var(--surface-alt, #f5faf5);
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary-dark, #2e5e38);
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 2px solid var(--border, #c8e6c9);
  white-space: nowrap;
}
.quo-td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-light, #e8ede9);
  vertical-align: middle;
}
.quo-td-desc  { min-width: 200px; }
.quo-td-type  { min-width: 130px; }
.quo-td-num   { width: 80px; }
.quo-td-total { width: 90px; text-align: right; font-weight: 600; }
.quo-td-del   { width: 36px; text-align: center; }
.quo-empty-row {
  padding: 20px;
  text-align: center;
  color: var(--text-muted, #999);
  font-style: italic;
}

.quo-inp {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--border, #c8e6c9);
  border-radius: 5px;
  font-size: .85rem;
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  transition: border-color .15s;
}
.quo-inp:focus {
  outline: none;
  border-color: var(--primary, #2e7d32);
}
.quo-inp-num { text-align: right; }
.quo-sel     { cursor: pointer; }

.quo-del-btn {
  background: none;
  border: none;
  color: var(--danger, #e53935);
  cursor: pointer;
  font-size: .85rem;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background .15s;
}
.quo-del-btn:hover { background: #fce4ec; }

.quo-add-btn {
  margin-top: 12px;
  font-size: .83rem;
}

/* Resumen de totales */
.quo-tot-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px;
  font-size: .88rem;
  border-bottom: 1px solid var(--border-light, #e8ede9);
}
.quo-tot-disc { color: #c62828; }
.quo-tot-tax  { color: #1565c0; }
.quo-tot-total {
  display: flex;
  justify-content: space-between;
  padding: 10px 2px 2px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary, #2e7d32);
  margin-top: 4px;
}

.quo-adj-row {
  margin-bottom: 10px;
}
.quo-adj-row .rep-label {
  margin-bottom: 4px;
  display: block;
}

/* Campos inline del presupuesto (costo, tiempo, garantía) */
.quo-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  .quo-fields-row { grid-template-columns: 1fr; }
}
.quo-field-inp {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #c8e6c9);
  border-radius: 6px;
  font-size: .88rem;
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  transition: border-color .15s;
}
.quo-field-inp:focus {
  outline: none;
  border-color: #f57c00;
  box-shadow: 0 0 0 2px rgba(245,124,0,.12);
}
.quo-field-inp[readonly] {
  background: var(--surface-alt, #f5f5f5);
  color: var(--text-secondary, #666);
}

/* Botones de estado del presupuesto */
.quo-status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border, #c8e6c9);
}
.btn-quo-reject {
  border: 1.5px solid var(--danger, #e53935);
  color: var(--danger, #e53935);
  background: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-quo-reject:hover { background: #fce4ec; }

.quo-locked-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  font-weight: 600;
}
.quo-sent-note {
  font-size: .8rem;
  color: var(--text-secondary, #888);
}

/* Cabecera */
.rep-page-header {
  margin-bottom: 20px;
}
.rep-page-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rep-order-num {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: .95rem;
  color: var(--primary);
}
.rep-page-device {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Badges del informe */
.rep-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.rep-badge-draft  { background: #e8f2e3; color: var(--primary); border: 1px solid var(--border); }
.rep-badge-done   { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.rep-badge-locked { background: #fff3e0; color: #e65100; border: 1px solid #ffcc02; }

/* Layout dos columnas */
.rep-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

/* Cards de la columna principal */
.rep-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.rep-card-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rep-cat-label {
  font-size: .72rem;
  font-weight: 600;
  background: var(--bg-section);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
}
.rep-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.rep-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
  background: var(--bg-elevated);
  transition: border-color .15s;
}
.rep-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.rep-textarea[readonly] {
  background: var(--bg-base);
  color: var(--text-muted);
  cursor: default;
}

/* Barra de progreso del protocolo */
.rep-prog-bar-wrap {
  height: 6px;
  background: var(--border-light);
  border-radius: 99px;
  margin-bottom: 6px;
  overflow: hidden;
}
.rep-prog-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .3s;
}
.rep-prog-lbl {
  font-size: .75rem;
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

/* Secciones del protocolo */
.rep-sec-block { margin-bottom: 10px; }
.rep-sec-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 6px 0 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}
.rep-sec-items { display: flex; flex-direction: column; gap: 2px; }

/* Ítem del protocolo */
.rep-chk-item {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bg-base);
  margin-bottom: 3px;
}
.rep-chk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rep-chk-label {
  font-size: .82rem;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
}
.rep-item-note {
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: .75rem;
  color: var(--text-muted);
  background: #fff;
}
.rep-item-note:focus { outline: none; border-color: var(--primary); }
.rep-item-note[readonly] { background: transparent; border-color: transparent; }

/* Botones de estado (ok / fail / na) */
.rep-status-grp { display: flex; gap: 4px; flex-shrink: 0; }
.rep-sbtn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .12s;
  display: flex; align-items: center; justify-content: center;
}
.rep-ok  { border-color: #2e7d52; color: #2e7d52; }
.rep-ok:hover,  .rep-sa-active { background: #2e7d52 !important; color: #fff !important; border-color: #2e7d52 !important; }
.rep-fail { border-color: #b04040; color: #b04040; }
.rep-fail:hover, .rep-sf-active { background: #b04040 !important; color: #fff !important; border-color: #b04040 !important; }
.rep-na  { border-color: var(--border); color: var(--text-muted); }
.rep-na:hover,  .rep-sn-active { background: var(--text-muted) !important; color: #fff !important; }

/* Labels read-only */
.rep-ro {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.rep-ro-ok   { background: #e8f5e9; color: #2e7d52; }
.rep-ro-fail { background: #fce4e4; color: #b04040; }
.rep-ro-na   { background: var(--bg-section); color: var(--text-muted); }
.rep-ro-none { background: transparent; color: var(--text-faint); }

/* Fotos */
.rep-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.rep-photo-thumb {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-section);
}
.rep-photo-thumb img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.rep-photo-del {
  position: absolute;
  top: 6px; right: 6px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  font-size: .8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.rep-photo-del:hover { background: var(--danger); }
.rep-photo-cap {
  width: 100%;
  padding: 5px 8px;
  border: none;
  border-top: 1px solid var(--border-light);
  font-size: .75rem;
  color: var(--text-muted);
  background: #fff;
}
.rep-photo-cap:focus { outline: none; background: #f9fcf8; }
.rep-photos-empty {
  font-size: .83rem;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.rep-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.rep-photo-count {
  font-size: .75rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Columna lateral */
.rep-sidebar { display: flex; flex-direction: column; gap: 14px; }
.rep-side-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.rep-side-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.rep-side-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .82rem;
}
.rep-side-row:last-child { border-bottom: none; }
.rep-side-lbl { color: var(--text-muted); flex-shrink: 0; }

/* Tiempo */
.rep-time-row {
  display: flex;
  gap: 10px;
}
.rep-time-inp {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: .875rem;
  text-align: center;
  font-family: 'SF Mono', Consolas, monospace;
  background: var(--bg-elevated);
}
.rep-time-inp:focus { outline: none; border-color: var(--primary); }
.rep-time-display {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 6px 0;
}

/* Resumen de cobertura */
.rep-prog-summary { display: flex; flex-direction: column; gap: 4px; }
.rep-ps-row { font-size: .82rem; display: flex; justify-content: space-between; }

/* Botones de guardar / finalizar al fondo de la sección de fotos */
.rep-bottom-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.rep-btn-bottom {
  min-width: 160px;
}

/* Responsive */
@media (max-width: 768px) {
  .rep-layout {
    grid-template-columns: 1fr;
  }
  .rep-sidebar {
    order: -1;
  }
  .rep-photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .rep-bottom-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .rep-btn-bottom {
    min-width: unset;
    width: 100%;
  }
}

/* ── Tiempos de reparación ──────────────────────────────────── */
.wt-section { margin-top: 8px; }

.wt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 500px) { .wt-grid { grid-template-columns: 1fr; } }

.wt-card {
  background: #f8fdf8;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color .2s;
}
.wt-card.wt-active  { border-color: #43a047; background: #f1f8e9; }
.wt-card.wt-paused  { border-color: #ffa000; background: #fff8e1; }

.wt-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}
.wt-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1b5e20;
  font-variant-numeric: tabular-nums;
  min-height: 1.4em;
}
.wt-card.wt-paused .wt-value { color: #e65100; }
.wt-sub {
  font-size: .72rem;
  color: #888;
  margin-top: 3px;
}

/* Punto pulsante «en vivo» */
.wt-live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: #43a047;
  border-radius: 50%;
  animation: wt-pulse 1.4s ease-in-out infinite;
}
@keyframes wt-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.7); }
}

.wt-admin-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.wt-btn-pause  { background: #fff8e1; color: #e65100; border: 1px solid #ffcc02; }
.wt-btn-pause:hover  { background: #fff3cd; }
.wt-btn-resume { background: #e8f5e9; color: #1b5e20; border: 1px solid #81c784; }
.wt-btn-resume:hover { background: #d0f0d0; }

.wt-paused-badge {
  font-size: .78rem;
  color: #e65100;
  background: #fff3e0;
  border: 1px solid #ffcc02;
  border-radius: 12px;
  padding: 2px 10px;
}

/* ── Tab Tiempos / alertas ───────────────────────────────── */
.rep-tab-alert {
  position: relative;
  color: #c62828;
}
.rep-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c62828;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 9px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.4;
}

/* Fila de alarma en tabla */
.rep-row-alarm td { background: #fff5f5; }
.rep-row-alarm td:first-child { border-left: 3px solid #c62828; }

.rep-table-note {
  font-size: .76rem;
  color: #888;
  margin-top: 6px;
  padding: 0 2px;
}

/* Widget órdenes lentas en dashboard */
.slow-orders-widget {
  border-left-color: #e65100 !important;
  background: #fff8f5 !important;
}
.btn-warning-outline {
  background: transparent;
  color: #e65100;
  border: 1px solid #e65100;
}
.btn-warning-outline:hover { background: #fff3e0; }

/* ── Pricing — nuevo modelo pay-per-use ────────────────────── */
.pricing-all-included {
  background: #f1f8f1;
  border: 1px solid #c8e6c9;
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 32px;
  text-align: center;
}
.pai-title {
  font-size: .95rem;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 12px;
  letter-spacing: .2px;
}
.pai-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
}
.pai-features span {
  font-size: .82rem;
  color: #333;
  background: #fff;
  border: 1px solid #c8e6c9;
  border-radius: 20px;
  padding: 3px 10px;
}

/* ── Toggle Mensual / Anual ──────────────────────────────────── */
.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #f1f8f1;
  border: 1px solid #c8e6c9;
  border-radius: 999px;
  padding: 4px;
  width: fit-content;
  margin: 0 auto 28px;
}
.billing-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
  color: #4a6350;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.billing-opt.active {
  background: #2e7d32;
  color: #fff;
}
.billing-save-badge {
  background: #fff3e0;
  color: #e65100;
  font-size: .68rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: .2px;
}
.billing-opt.active .billing-save-badge {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.plan-annual-note {
  font-size: .74rem;
  color: #777;
  margin-top: 2px;
}
.plan-tax-note {
  font-size: .74rem;
  color: #777;
  margin-top: 2px;
}

.plans-grid-4 {
  grid-template-columns: repeat(4, 1fr) !important;
}
@media (max-width: 960px) { .plans-grid-4 { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 560px) { .plans-grid-4 { grid-template-columns: 1fr !important; } }

.plan-orders-badge {
  display: inline-block;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: .78rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 12px;
  margin: 4px 0 12px;
  border: 1px solid #a5d6a7;
}
.plan-orders-unlimited {
  background: #1b5e20;
  color: #fff;
  border-color: #1b5e20;
}

.feat-extra { color: #e65100 !important; }
.feat-extra .feat-icon { color: #e65100 !important; }

.plan-tier-basico     { background: #e3f2fd; color: #1565c0; }
.plan-tier-crecimiento{ background: #fce4ec; color: #ad1457; }
.plan-tier-ilimitado  { background: #1b5e20; color: #fff; }

/* ── Dashboard: widget de consumo ────────────────────────────── */
.plan-info-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.plan-price-tag {
  font-size: .82rem;
  color: #555;
  margin-left: auto;
  font-weight: 600;
}
.plan-usage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.plan-usage-label {
  font-size: .8rem;
  color: #555;
  white-space: nowrap;
  min-width: 120px;
}
.plan-usage-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.plan-usage-bar {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}
.plan-usage-fill {
  height: 100%;
  background: #43a047;
  border-radius: 4px;
  transition: width .4s;
  min-width: 0;
}
.plan-usage-fill.plan-usage-over { background: #e65100; }
.plan-usage-num {
  font-size: .8rem;
  color: #444;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.plan-usage-extra {
  font-size: .8rem;
  color: #e65100;
  font-weight: 600;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 6px;
  padding: 5px 10px;
  margin-bottom: 10px;
}
.plan-features-all {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8f5e9;
}
.plan-features-all span {
  font-size: .78rem;
  color: #2e7d32;
  font-weight: 500;
}
.plan-extra-note {
  font-size: .75rem;
  color: #888;
  margin-top: 8px;
}

/* ── Payment mode toggle (technician form) ── */
.pm-options {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.pm-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex: 1;
  transition: border-color .18s, background .18s;
  background: var(--surface);
}
.pm-option:hover {
  border-color: var(--primary);
}
.pm-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.pm-option.pm-selected {
  border-color: var(--primary);
  background: #f0fdf4;
}
@media (prefers-color-scheme: dark) {
  .pm-option.pm-selected { background: #1a2e1a; }
}
:root[data-theme="dark"] .pm-option.pm-selected { background: #1a2e1a; }
:root[data-theme="light"] .pm-option.pm-selected { background: #f0fdf4; }
.pm-label strong {
  display: block;
  font-size: .9rem;
  color: var(--text);
}
.pm-label small {
  font-size: .78rem;
  color: var(--text-muted);
}

/* ── Monthly badge ── */
.badge-monthly-sm {
  display: inline-block;
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 9px;
  white-space: nowrap;
  letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) {
  .badge-monthly-sm { background: #0d2a45; color: #90caf9; border-color: #1565c0; }
}
:root[data-theme="dark"] .badge-monthly-sm { background: #0d2a45; color: #90caf9; border-color: #1565c0; }
:root[data-theme="light"] .badge-monthly-sm { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }

/* ── Plan chip colors — new plans ── */
.plan-chip-starter     { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.plan-chip-profesional { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.plan-chip-business    { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.plan-chip-enterprise  { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }
@media (prefers-color-scheme: dark) {
  .plan-chip-starter     { background: #1b2e1b; color: #81c784; }
  .plan-chip-profesional { background: #0d2040; color: #90caf9; }
  .plan-chip-business    { background: #2e1a00; color: #ffcc80; }
  .plan-chip-enterprise  { background: #1e0a2e; color: #ce93d8; }
}
:root[data-theme="dark"] .plan-chip-starter     { background: #1b2e1b; color: #81c784; }
:root[data-theme="dark"] .plan-chip-profesional { background: #0d2040; color: #90caf9; }
:root[data-theme="dark"] .plan-chip-business    { background: #2e1a00; color: #ffcc80; }
:root[data-theme="dark"] .plan-chip-enterprise  { background: #1e0a2e; color: #ce93d8; }
:root[data-theme="light"] .plan-chip-starter     { background: #e8f5e9; color: #2e7d32; }
:root[data-theme="light"] .plan-chip-profesional { background: #e3f2fd; color: #1565c0; }
:root[data-theme="light"] .plan-chip-business    { background: #fff3e0; color: #e65100; }
:root[data-theme="light"] .plan-chip-enterprise  { background: #f3e5f5; color: #6a1b9a; }

/* ── Landing pricing — new plan tiers ── */
.plan-tier-starter     { background: #e8f5e9; color: #2e7d32; }
.plan-tier-profesional { background: #e3f2fd; color: #1565c0; }
.plan-tier-business    { background: #fff3e0; color: #e65100; }
.plan-tier-enterprise  { background: #f3e5f5; color: #6a1b9a; }

/* ── Topbar plan indicator ── */
.topbar-plan-ind {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface, #f8fafb);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .73rem;
  white-space: nowrap;
  max-width: 340px;
  overflow: hidden;
}
.tpi-name {
  font-weight: 600;
  color: var(--text, #222);
  font-size: .72rem;
}
.tpi-bar {
  width: 72px;
  height: 6px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.tpi-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}
.tpi-fill.tpi-green      { background: #43a047; }
.tpi-fill.tpi-yellow     { background: #fb8c00; }
.tpi-fill.tpi-red        { background: #e53935; }
.tpi-fill.tpi-over       { background: #b71c1c; animation: tpi-pulse .9s infinite alternate; }
.tpi-counts {
  font-weight: 700;
  font-size: .7rem;
}
.tpi-counts.tpi-green  { color: #2e7d32; }
.tpi-counts.tpi-yellow { color: #e65100; }
.tpi-counts.tpi-red,
.tpi-counts.tpi-over   { color: #c62828; }
.tpi-sep   { color: #bbb; font-size: .65rem; }
.tpi-renew { color: var(--text-muted, #888); font-size: .68rem; }
.tpi-unlimited { font-weight: 700; font-size: .72rem; color: #6a1b9a; }
.tpi-mode-unlimited { gap: 8px; }
@keyframes tpi-pulse { from { opacity: 1; } to { opacity: .6; } }
@media (max-width: 680px) {
  .topbar-plan-ind { display: none; }
}

/* ── Dashboard plan card additions ── */
.plan-cycle-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 6px;
  font-size: .78rem;
  color: var(--text-muted, #777);
}
.plan-projection {
  font-size: .74rem;
  color: #555;
  font-style: italic;
}
.plan-upgrade-hint {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: .77rem;
  color: #e65100;
  margin: 8px 0;
}
.plan-upgrade-hint.plan-upgrade-critical {
  background: #fce4e4;
  border-color: #ef9a9a;
  color: #c62828;
}
.plan-upgrade-note {
  font-size: .73rem;
  color: #aaa;
  margin: 8px 0 0;
  font-style: italic;
}
.plan-usage-fill.plan-usage-warn  { background: #fb8c00; }
.plan-usage-fill.plan-usage-alert { background: #e53935; }

/* ── Order limit modal stats ── */
.ols-stats {
  background: var(--surface, #f8fafb);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
}
.ols-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
  font-size: .82rem;
}
.ols-row:last-child { border-bottom: none; }
.ols-lbl { color: var(--text-muted, #888); }
.ols-val { font-weight: 600; color: var(--text, #222); }
.ols-val.ols-red { color: #c62828; }
.ols-next-row { background: #f0fdf4; border-radius: 6px; padding: 6px 8px; margin-top: 4px; }

/* ── Nueva Orden button — limit warning state ── */
.btn-limit-warn {
  background: #fff3e0 !important;
  color: #e65100 !important;
  border: 1.5px solid #ffcc80 !important;
}
.btn-limit-warn:hover {
  background: #ffe0b2 !important;
}

/* ── Badge variantes de urgencia / estado ──────────────────────── */
.badge-danger     { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.badge-suspended  { background: #fff8e1; color: #e65100; border: 1px solid #ffcc02; }
.badge-amber      { background: #fff3e0; color: #f57f17; border: 1px solid #ffb300; }

/* ── Módulo Promociones — tarjetas de renovación ───────────────── */
.promo-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.promo-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.promo-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.promo-card-name   { font-weight: 700; font-size: .92rem; color: var(--text, #222); }
.promo-card-device { font-size: .8rem; color: var(--text-muted, #888); margin-top: 2px; }
.promo-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid var(--border-light, #f0f0f0);
  padding-top: 8px;
}
