﻿/* ════════════════════════════════════════════════════════════
   ARASAN QuoteCNC — Design System v3.0
   Estética: Glassmorphism · Purple/Violet · Neon Cyan
════════════════════════════════════════════════════════════ */
:root {
  /* Colores base */
  --bg:          #050814;
  --bg2:         #070d1f;

  /* Glassmorphism */
  --glass:       rgba(12, 18, 42, 0.78);
  --glass2:      rgba(16, 22, 52, 0.88);
  --glass-light: rgba(255, 255, 255, 0.04);

  /* Bordes */
  --border:      rgba(139, 92, 246, 0.20);
  --border2:     rgba(139, 92, 246, 0.32);
  --border-cyan: rgba(6, 182, 212, 0.25);

  /* Paleta de acento */
  --purple:      #8b5cf6;
  --purple-dark: #7c3aed;
  --violet:      #a855f7;
  --cyan:        #06b6d4;
  --cyan-light:  #22d3ee;
  --blue:        #3b82f6;
  --success:     #34d399;
  --warning:     #f59e0b;
  --danger:      #f87171;
  --amber:       #fbbf24;

  /* Texto */
  --text:        #f1f5ff;
  --text-muted:  rgba(241, 245, 255, 0.50);
  --text-faint:  rgba(241, 245, 255, 0.28);

  /* Gradientes de acento */
  --grad-main:   linear-gradient(135deg, #7c3aed, #4f7cff, #06b6d4);
  --grad-purple: linear-gradient(135deg, #7c3aed, #a855f7);
  --grad-cyan:   linear-gradient(135deg, #3b82f6, #06b6d4);

  /* Sombras */
  --shadow:      0 20px 60px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.12);
  --shadow-sm:   0 4px 20px rgba(0, 0, 0, 0.4);

  /* Layout */
  --sidebar-w:   86px;
  --radius:      14px;
  --radius-sm:   8px;
  --radius-xs:   5px;

  --transition:  0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Fondo con gradientes radiales + grid sutil */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 80% 0%, rgba(124, 58, 237, 0.14), transparent),
    radial-gradient(ellipse 60% 50% at 20% 100%, rgba(6, 182, 212, 0.09), transparent),
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(59, 130, 246, 0.05), transparent);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════════
   CANVAS + SCREENS
════════════════════════════════════════════════════════════ */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.screen { position: relative; z-index: 10; }
.screen.hidden { display: none !important; }
.hidden { display: none !important; }

/* ════════════════════════════════════════════════════════════
   INTRO SCREEN
════════════════════════════════════════════════════════════ */
#intro-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030610;
  overflow: hidden;
  transition: opacity 0.85s ease;
}
#intro-screen.fade-out { opacity: 0; pointer-events: none; }

.intro-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 78%);
}

.intro-scanline {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), rgba(6, 182, 212, 0.5), transparent);
  animation: scanline 3.5s linear infinite;
  z-index: 2;
}
@keyframes scanline { 0% { top: -2px; } 100% { top: 100%; } }

.intro-corner {
  position: absolute;
  width: 30px; height: 30px;
  border-color: rgba(139, 92, 246, 0.5);
  border-style: solid; border-width: 0;
  animation: cornerFadeIn 0.5s 0.4s both;
}
.intro-corner.tl { top: 22px; left: 22px; border-top-width: 2px; border-left-width: 2px; }
.intro-corner.tr { top: 22px; right: 22px; border-top-width: 2px; border-right-width: 2px; }
.intro-corner.bl { bottom: 22px; left: 22px; border-bottom-width: 2px; border-left-width: 2px; }
.intro-corner.br { bottom: 22px; right: 22px; border-bottom-width: 2px; border-right-width: 2px; }
@keyframes cornerFadeIn { from { opacity:0; transform:scale(0.6); } to { opacity:1; transform:scale(1); } }

.intro-body {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}

.intro-logo-wrap {
  position: relative; margin-bottom: 24px;
  animation: logoReveal 0.9s cubic-bezier(0.2,0.8,0.3,1) 0.2s both;
}
@keyframes logoReveal {
  from { opacity:0; transform: scale(0.6) translateY(20px); filter: blur(8px); }
  to   { opacity:1; transform: scale(1) translateY(0);     filter: blur(0); }
}
.intro-logo-glow {
  position: absolute; inset: -22px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22), transparent 65%);
  border-radius: 50%; animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100% { opacity:0.6; transform:scale(1); } 50% { opacity:1; transform:scale(1.1); } }

.intro-logo-img {
  width: 130px; height: auto; display: block;
  background: white; border-radius: 20px; padding: 14px; position: relative; z-index: 1;
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.3), 0 20px 60px rgba(0,0,0,0.6);
}

.intro-wordmark {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(42px,8vw,72px); font-weight: 800;
  letter-spacing: 0.3em; color: var(--text); line-height: 1;
  animation: slideUp 0.7s 0.7s both;
}
.intro-division {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(10px,1.8vw,13px); font-weight: 500;
  letter-spacing: 0.44em; color: var(--cyan); margin-top: 6px;
  animation: slideUp 0.7s 0.9s both;
}
@keyframes slideUp { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }

.intro-sep { display:flex; align-items:center; gap:12px; margin: 18px 0 14px; animation: slideUp 0.7s 1.0s both; }
.intro-sep-line { display:block; width:90px; height:1px; background:linear-gradient(90deg,transparent,rgba(139,92,246,0.55),transparent); }
.intro-sep-dot  { display:block; width:5px; height:5px; border-radius:50%; background:var(--purple); box-shadow:0 0 10px var(--purple); }

.intro-product {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(9px,1.6vw,11px); font-weight: 600;
  letter-spacing: 0.22em; color: var(--text-muted); text-transform: uppercase;
  animation: slideUp 0.7s 1.1s both;
}

.intro-bar-wrap { margin-top: 34px; width: clamp(240px,38vw,360px); animation: slideUp 0.7s 1.2s both; }
.intro-bar { width:100%; height:3px; background:rgba(139,92,246,0.14); border-radius:99px; overflow:hidden; }
.intro-bar-fill {
  height:100%; width:0%;
  background: var(--grad-main);
  border-radius: 99px;
  box-shadow: 0 0 12px rgba(139,92,246,0.8);
  transition: width 0.12s linear;
}
.intro-bar-label {
  margin-top: 10px; font-size: 11px; color: var(--text-faint);
  letter-spacing: 0.06em; font-family: 'Orbitron', sans-serif; text-align: center;
}
.intro-version {
  margin-top: 20px; font-size: 10px; color: rgba(139,92,246,0.35); letter-spacing: 0.14em;
  animation: slideUp 0.7s 1.4s both;
}

/* ════════════════════════════════════════════════════════════
   LOGIN
════════════════════════════════════════════════════════════ */
#login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%; max-width: 400px;
  background: var(--glass2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow), var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: cardReveal 0.5s ease both;
}
@keyframes cardReveal {
  from { opacity:0; transform: translateY(24px) scale(0.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

.login-logo-row {
  display:flex; align-items:center; gap:14px; margin-bottom:8px;
}
.login-logo-img { width:54px; background:white; border-radius:12px; padding:6px; flex-shrink:0; }
.login-brand { font-family:'Orbitron',sans-serif; font-size:20px; font-weight:800; letter-spacing:0.2em; }
.login-brand-sub { font-size:11px; color:var(--purple); letter-spacing:0.18em; font-family:'Orbitron',sans-serif; margin-top:2px; }
.login-subtitle { font-size:12px; color:var(--text-muted); margin-bottom:20px; }

/* ════════════════════════════════════════════════════════════
   APP LAYOUT
════════════════════════════════════════════════════════════ */
#app-screen { display:flex; min-height:100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--glass2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 0;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-logo {
  padding: 18px 14px 16px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  display: flex; justify-content: center;
}
.sidebar-logo-img {
  width: 46px; background: white;
  border-radius: 12px; padding: 5px;
  box-shadow: 0 0 18px rgba(139,92,246,0.22);
}

.sidebar-nav {
  flex: 1;
  padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%;
}

.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px 10px;
  width: 100%;
  border: none; background: transparent;
  color: var(--text-muted);
  font-family: 'Manrope', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.65; transition: opacity var(--transition); }
.nav-item:hover { background: rgba(139,92,246,0.08); color: var(--text); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: rgba(139,92,246,0.16);
  color: var(--purple);
}
.nav-item.active svg { opacity: 1; color: var(--purple); }

.sidebar-footer {
  padding: 12px 8px 16px;
  border-top: 1px solid var(--border);
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.user-email {
  font-size: 9px; color: var(--text-faint);
  text-align: center; word-break: break-all; max-width: 70px; line-height: 1.3;
}
.btn-logout {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: transparent; border: none;
  color: var(--text-faint); font-size: 9px; font-weight: 700;
  cursor: pointer; padding: 6px 4px; border-radius: 6px; width: 100%;
  text-transform: uppercase; letter-spacing: 0.04em;
  transition: color var(--transition), background var(--transition);
}
.btn-logout svg { width: 16px; height: 16px; }
.btn-logout:hover { color: var(--danger); background: rgba(248,113,113,0.08); }

/* ── Content ── */
.content { flex: 1; min-width: 0; overflow-y: auto; max-height: 100vh; }

.page { display: none; padding: 0 0 60px; }
.page.active { display: block; }

/* ════════════════════════════════════════════════════════════
   PAGE TOPBAR
════════════════════════════════════════════════════════════ */
.page-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px 16px;
  border-bottom: 1px solid rgba(139,92,246,0.12);
  background: rgba(5, 8, 20, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-wrap: wrap; gap: 10px;
  position: sticky; top: 0; z-index: 30;
}
.page-topbar-left { display: flex; align-items: baseline; gap: 12px; }
.page-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px; font-weight: 800;
  letter-spacing: 0.12em; color: var(--text);
}
.page-title-sub {
  font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em;
  font-family: 'Orbitron', sans-serif;
}
.page-topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--purple);
  border: 1px solid rgba(139,92,246,0.3);
  background: rgba(139,92,246,0.08);
  padding: 4px 10px; border-radius: 999px;
}

/* ════════════════════════════════════════════════════════════
   COTIZAR LAYOUT — 2 columnas
════════════════════════════════════════════════════════════ */
.cotizar-layout {
  display: flex;
  gap: 14px;
  padding: 18px 18px 40px;
  align-items: flex-start;
}

.quoter-main-col { flex: 1; min-width: 0; }
.quoter-side-col { width: 290px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }

/* ════════════════════════════════════════════════════════════
   GLASS PANEL
════════════════════════════════════════════════════════════ */
.glass-panel {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.05), 0 0 0 1px rgba(139,92,246,0.04);
  overflow: hidden;
}

/* ── Panel head ── */
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(139,92,246,0.04);
  flex-wrap: wrap; gap: 8px;
}
.panel-head-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head-right { display: flex; align-items: center; gap: 8px; }

.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.10em; color: var(--text);
}
.panel-title-sm {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em; color: var(--text);
}

.panel-head-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--purple); background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.25);
  padding: 2px 8px; border-radius: 999px;
}
.panel-head-badge-sm {
  font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
  color: var(--cyan); background: rgba(6,182,212,0.10);
  border: 1px solid rgba(6,182,212,0.22);
  padding: 2px 7px; border-radius: 999px;
}

.panel-summary-pill {
  font-size: 10px; font-weight: 700;
  color: var(--purple); background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.25);
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.panel-menu-btn {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 18px; cursor: pointer;
  line-height: 1; padding: 2px; border-radius: 4px;
  transition: color var(--transition);
}
.panel-menu-btn:hover { color: var(--text); }

.panel-subtitle {
  padding: 8px 14px 4px;
  font-size: 10px; font-weight: 700; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── Panel interior del cotizador ── */
.quoter-panel > .panel-head { padding: 16px 20px 14px; }
.quoter-panel > form,
.quoter-panel > .cad-zone { padding: 0 20px; }
.quoter-panel > .cad-zone { padding: 16px 20px 0; }
.quoter-panel > form { padding: 0 20px 20px; }

/* ── Panel side ── */
.panel-side { padding: 0; }

/* ════════════════════════════════════════════════════════════
   CAD / 3D ZONE
════════════════════════════════════════════════════════════ */
.cad-zone { display: flex; flex-direction: column; gap: 10px; }

.cad-dropzone-wrap {
  border: 1.5px dashed rgba(139,92,246,0.28);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  cursor: pointer; transition: border-color var(--transition), background var(--transition);
  background: rgba(139,92,246,0.02);
}
.cad-dropzone-wrap:hover, .cad-dropzone-wrap.drag-over {
  border-color: rgba(139,92,246,0.55);
  background: rgba(139,92,246,0.05);
}

.cad-flow {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.cad-flow-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-muted);
}
.cad-flow-center { color: var(--purple); }
.cad-flow-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 10px;
  color: var(--purple);
}
.cad-3d-placeholder {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.32);
  border-radius: 12px;
  color: var(--purple);
  box-shadow: 0 0 20px rgba(139,92,246,0.18);
  animation: rotateSlow 12s linear infinite;
}
@keyframes rotateSlow {
  0% { box-shadow: 0 0 20px rgba(139,92,246,0.18); }
  50% { box-shadow: 0 0 30px rgba(6,182,212,0.22); }
  100% { box-shadow: 0 0 20px rgba(139,92,246,0.18); }
}
.cad-flow-arrow { color: rgba(139,92,246,0.5); font-size: 18px; font-weight: 300; }
.cad-flow-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }

.btn-cad-import {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.35);
  border-radius: var(--radius-sm);
  color: var(--purple);
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: background var(--transition), border-color var(--transition);
  letter-spacing: 0.03em;
}
.btn-cad-import:hover { background: rgba(139,92,246,0.25); border-color: rgba(139,92,246,0.55); }

.modelo-status-text { font-size: 11px; color: var(--text-faint); padding: 2px 0; }

.modelo-metricas {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.modelo-metrica {
  flex: 1; min-width: 80px;
  background: rgba(139,92,246,0.06);
  border-radius: 7px; padding: 7px 10px;
  border: 1px solid rgba(139,92,246,0.14);
}
.modelo-metrica-label { font-size: 9px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; display: block; }
.modelo-metrica-val { font-size: 12px; font-weight: 700; color: var(--cyan); margin-top: 2px; display: block; }

.modelo-viewer {
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius-sm);
  overflow: hidden; background: #050c18;
}
.modelo-viewer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid rgba(139,92,246,0.12);
  font-size: 12px; color: var(--text);
}
.modelo-viewer-badge {
  display: inline-block;
  background: rgba(139,92,246,0.18); color: var(--purple);
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  padding: 1px 6px; border-radius: 4px; text-transform: uppercase; margin-left: 5px;
}
.modelo-viewer-note { color: var(--text-faint); font-size: 10px; }

.viewer-3d-container { width: 100%; height: 380px; position: relative; overflow: hidden; background: #050c18; }
.viewer-3d-container canvas { width: 100% !important; height: 380px !important; display: block; }

.modelo-upload-state {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-faint);
}
.modelo-upload-state a { color: var(--cyan); }

.cad-docs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-cad-docs {
  background: rgba(6,182,212,0.12);
  border-color: rgba(6,182,212,0.32);
  color: var(--cyan);
}

.btn-cad-docs:hover {
  background: rgba(6,182,212,0.2);
  border-color: rgba(6,182,212,0.5);
}

.calidad-files-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.doc-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(6,182,212,0.35);
  background: rgba(6,182,212,0.1);
  color: #bff8ff;
  font-size: 10px;
  font-weight: 600;
}

.btn-icon-sm {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; padding: 1px 5px; border-radius: 4px;
  transition: color var(--transition);
}
.btn-icon-sm:hover { color: var(--danger); }

/* ════════════════════════════════════════════════════════════
   FORM CONTROLS ROW (material, qty, proceso, tolerancia)
════════════════════════════════════════════════════════════ */
.form-controls-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1.5fr;
  gap: 10px;
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

/* ════════════════════════════════════════════════════════════
   FORM SECTIONS GRID
════════════════════════════════════════════════════════════ */
.form-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-section {
  background: rgba(139,92,246,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.form-section-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 700;
  color: var(--purple); text-transform: uppercase; letter-spacing: 0.09em;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); margin: 0;
}

/* ════════════════════════════════════════════════════════════
   FIELDS
════════════════════════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 4px; }
.field-row { display: flex; gap: 8px; }
.field-row .field { flex: 1; min-width: 0; }

label {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.hint { font-size: 9px; font-weight: 400; color: var(--text-faint); text-transform: none; letter-spacing: 0; }
.unit { font-size: 9px; font-weight: 600; color: var(--cyan); text-transform: none; letter-spacing: 0; }

input[type="text"], input[type="email"], input[type="number"],
input[type="password"], input[type="date"], input[type="search"],
select, textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(139,92,246,0.22);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: 12px;
  padding: 8px 10px; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none; -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(139,92,246,0.6);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.10);
}
input::placeholder, textarea::placeholder { color: rgba(241,245,255,0.2); }
select option { background: #0d1030; color: var(--text); }
textarea { resize: vertical; min-height: 60px; }

/* Material info pills */
.mat-info-box {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.mat-prop {
  flex: 1; min-width: 75px;
  background: rgba(139,92,246,0.06);
  border-radius: 6px; padding: 6px 10px;
  border: 1px solid rgba(139,92,246,0.12);
}
.mat-prop-label { font-size: 9px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.mat-prop-val { font-size: 12px; font-weight: 700; color: var(--text); }

/* Tratamientos */
.tratamientos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px;
}
.check-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-muted); cursor: pointer;
  padding: 5px 8px; border-radius: 5px;
  border: 1px solid transparent; transition: all var(--transition);
}
.check-item:hover { color: var(--text); background: rgba(139,92,246,0.06); border-color: var(--border); }
.check-item input[type="checkbox"] {
  width: 13px; height: 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 3px; cursor: pointer; flex-shrink: 0; margin: 0;
  accent-color: var(--purple);
}

/* ════════════════════════════════════════════════════════════
   COST ESTIMATION BAR
════════════════════════════════════════════════════════════ */
.cost-bar {
  display: flex; align-items: stretch;
  background: rgba(139,92,246,0.07);
  border: 1px solid rgba(139,92,246,0.22);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 14px 0 10px;
}
.cost-item {
  flex: 1; display: flex; flex-direction: column; gap: 4px;
  padding: 12px 16px; align-items: flex-start;
}
.cost-total-item {
  background: rgba(139,92,246,0.10);
  border-left: 1px solid rgba(139,92,246,0.22);
}
.cost-divider { width: 1px; background: rgba(139,92,246,0.18); flex-shrink: 0; }
.cost-label {
  font-size: 9px; font-weight: 700; font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.07em; color: var(--text-muted); text-transform: uppercase;
}
.cost-val {
  font-size: 18px; font-weight: 800; color: var(--text);
  font-variant-numeric: tabular-nums; font-family: 'Orbitron', sans-serif;
  line-height: 1;
}
.cost-val-total { color: var(--success); font-size: 22px; }

/* ════════════════════════════════════════════════════════════
   GENERATE BUTTON (CTA)
════════════════════════════════════════════════════════════ */
.btn-generate {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px 24px;
  background: var(--grad-main);
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-family: 'Orbitron', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.10em;
  cursor: pointer; text-transform: uppercase;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 24px rgba(124,58,237,0.35), 0 0 40px rgba(6,182,212,0.12);
  margin-top: 4px;
}
.btn-generate:hover:not(:disabled) {
  opacity: 0.9; transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124,58,237,0.45), 0 0 50px rgba(6,182,212,0.18);
}
.btn-generate:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-generate.btn-full { border-radius: var(--radius-sm); }

/* ════════════════════════════════════════════════════════════
   BOTONES
════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  background: rgba(139,92,246,0.18);
  border: 1px solid rgba(139,92,246,0.4);
  border-radius: var(--radius-xs);
  color: var(--purple); font-family: 'Manrope', sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { background: rgba(139,92,246,0.28); border-color: rgba(139,92,246,0.6); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-primary.btn-full { width: 100%; justify-content: center; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  background: transparent; color: var(--cyan);
  border: 1px solid rgba(6,182,212,0.35);
  border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'Manrope', sans-serif; white-space: nowrap;
  transition: background var(--transition), border-color var(--transition);
}
.btn-secondary:hover { background: rgba(6,182,212,0.09); border-color: rgba(6,182,212,0.55); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: transparent; color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'Manrope', sans-serif; white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.btn-ghost.btn-sm { padding: 5px 10px; font-size: 11px; }

.btn-icon {
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 17px; line-height: 1; padding: 2px 6px; border-radius: 4px;
  transition: color var(--transition);
}
.btn-icon:hover { color: var(--text); }

/* ════════════════════════════════════════════════════════════
   RESULTADO
════════════════════════════════════════════════════════════ */
.resultado {
  background: var(--glass);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--radius);
  overflow: hidden; margin-top: 16px;
  box-shadow: 0 0 30px rgba(52,211,153,0.06);
}
.resultado-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(52,211,153,0.03);
}
.resultado-title-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.resultado-title-row h3 {
  font-family: 'Orbitron', sans-serif; font-size: 15px; font-weight: 700; color: var(--text);
}
.res-badges { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  background: rgba(139,92,246,0.12); color: var(--purple);
  border: 1px solid rgba(139,92,246,0.22);
}
.badge-proc { background: rgba(59,130,246,0.12); color: #93c5fd; border-color: rgba(59,130,246,0.22); }
.badge-qty  { background: rgba(251,191,36,0.10); color: var(--amber); border-color: rgba(251,191,36,0.2); }
.badge-mat  { background: rgba(59,130,246,0.12); color: #93c5fd; border-color: rgba(59,130,246,0.18); }
.badge-ens  { background: rgba(0,180,216,0.12); color: var(--accent); border-color: rgba(0,180,216,0.25); }
.hi-nt      { font-size: 9px; color: var(--accent); background: rgba(0,180,216,0.08); border-radius: 4px; padding: 1px 5px; margin-left: 5px; }

.resultado-precio-row {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.precio-sep { width: 1px; height: 40px; background: var(--border); }
.precio-block { display: flex; flex-direction: column; gap: 2px; }
.precio-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.precio-value {
  font-family: 'Orbitron', sans-serif; font-size: 22px; font-weight: 800;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.precio-total { color: var(--success); font-size: 28px; }

.resultado-body {
  padding: 20px 22px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  border-bottom: 1px solid var(--border);
}
.desglose-section h4, .params-section h4 {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 10px;
}
.desglose-grid { display: flex; flex-direction: column; gap: 5px; }
.desglose-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text); padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.desglose-row span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.desglose-row-muted { color: var(--text-muted); font-size: 11px; }

.params-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.param-pill {
  padding: 5px 10px;
  background: rgba(139,92,246,0.07); border: 1px solid rgba(139,92,246,0.16);
  border-radius: 999px; font-size: 11px; color: var(--text-muted); font-weight: 600;
}
.accent-pill { background: rgba(52,211,153,0.09); border-color: rgba(52,211,153,0.2); color: var(--success); }

.resultado-actions {
  padding: 16px 22px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.save-status { font-size: 12px; color: var(--success); margin-left: 4px; }

/* ════════════════════════════════════════════════════════════
   SIDE PANELS — producción mini + ofertas
════════════════════════════════════════════════════════════ */
.prod-mini-kpis { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.prod-kpi-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
}
.prod-kpi-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.prod-kpi-label { flex: 1; font-size: 11px; }
.prod-kpi-val { font-family: 'Orbitron', sans-serif; font-size: 13px; font-weight: 700; color: var(--text); }

/* Offers list */
.panel-offers-wrap { display: flex; flex-direction: column; }
.offers-list { flex: 1; padding: 4px 10px; display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.offers-list::-webkit-scrollbar { width: 3px; }
.offers-list::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.25); border-radius: 99px; }

.offer-card {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: 7px; padding: 8px 10px;
  cursor: pointer; transition: background var(--transition), border-color var(--transition);
}
.offer-card:hover { background: rgba(139,92,246,0.07); border-color: rgba(139,92,246,0.35); }
.offer-card-info { flex: 1; min-width: 0; }
.offer-num { font-size: 11px; font-weight: 700; color: var(--text); }
.offer-cliente { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offer-precio { font-size: 11px; font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer-estado-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 999px;
  font-size: 9px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.offer-estado-badge::before {
  content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.offer-presupuesto { background: rgba(100,116,139,0.15); color: #94a3b8; border-color: rgba(100,116,139,0.2); }
.offer-enviado     { background: rgba(6,182,212,0.12); color: var(--cyan); border-color: rgba(6,182,212,0.25); }
.offer-aceptado    { background: rgba(52,211,153,0.12); color: var(--success); border-color: rgba(52,211,153,0.25); }
.offer-fabricacion { background: rgba(245,158,11,0.12); color: var(--warning); border-color: rgba(245,158,11,0.25); }
.offer-entregado   { background: rgba(129,140,248,0.12); color: #a5b4fc; border-color: rgba(129,140,248,0.22); }
.offer-rechazado   { background: rgba(248,113,113,0.12); color: var(--danger); border-color: rgba(248,113,113,0.22); }

.panel-footer-btns {
  display: flex; gap: 6px; padding: 10px 10px 12px;
  border-top: 1px solid var(--border);
}
.btn-panel-action {
  flex: 1; padding: 7px 8px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-muted);
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: 'Manrope', sans-serif; text-align: center;
  transition: background var(--transition), color var(--transition);
}
.btn-panel-action:hover { background: rgba(139,92,246,0.10); color: var(--text); }
.btn-panel-action-primary {
  background: rgba(139,92,246,0.15); color: var(--purple);
  border-color: rgba(139,92,246,0.32);
}
.btn-panel-action-primary:hover { background: rgba(139,92,246,0.25); }

/* ════════════════════════════════════════════════════════════
   TAB BAR
════════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex; background: rgba(255,255,255,0.04);
  border-radius: var(--radius-xs); padding: 3px; margin-bottom: 16px;
}
.tab {
  flex: 1; padding: 8px 12px; border: none; background: transparent;
  color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer;
  border-radius: 5px; transition: all var(--transition); font-family: 'Manrope', sans-serif;
}
.tab.active { background: rgba(139,92,246,0.18); color: var(--purple); }

/* ════════════════════════════════════════════════════════════
   KPI BAR
════════════════════════════════════════════════════════════ */
.kpi-bar { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 18px 0; margin-bottom: 16px; }
.kpi-card {
  flex: 1; min-width: 90px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.kpi-card.kpi-accent  { border-color: rgba(139,92,246,0.3); background: rgba(139,92,246,0.07); }
.kpi-card.kpi-success { border-color: rgba(52,211,153,0.25); background: rgba(52,211,153,0.06); }
.kpi-card.kpi-warn    { border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.06); }

.kpi-val { font-family: 'Orbitron', sans-serif; font-size: 17px; font-weight: 700; color: var(--text); }
.kpi-accent .kpi-val  { color: var(--purple); }
.kpi-success .kpi-val { color: var(--success); }
.kpi-warn .kpi-val    { color: var(--warning); }
.kpi-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ════════════════════════════════════════════════════════════
   SEARCH / SELECT SMALL
════════════════════════════════════════════════════════════ */
.search-input, .select-small {
  padding: 7px 11px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text);
  font-size: 11px; font-family: 'Manrope', sans-serif;
}
.search-input { min-width: 180px; }
.select-small { min-width: 130px; appearance: none; -webkit-appearance: none; }

/* ════════════════════════════════════════════════════════════
   HISTORIAL
════════════════════════════════════════════════════════════ */
.historial-list {
  display: flex; flex-direction: column; gap: 7px;
  padding: 0 18px;
}
.historial-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  cursor: pointer; transition: border-color var(--transition), background var(--transition);
  flex-wrap: wrap;
}
.historial-item:hover { border-color: rgba(139,92,246,0.35); background: rgba(139,92,246,0.04); }

.hi-num { font-family: 'Orbitron', sans-serif; font-size: 11px; color: var(--purple); font-weight: 700; white-space: nowrap; min-width: 80px; }
.hi-nombre { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; min-width: 120px; }
.hi-cliente { font-size: 11px; color: var(--text-muted); min-width: 90px; }
.hi-badges { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.hi-fecha { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.hi-precio {
  font-family: 'Orbitron', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--success); white-space: nowrap; font-variant-numeric: tabular-nums;
  min-width: 80px; text-align: right;
}

.estado-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.estado-badge::before { content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.estado-presupuesto { background: rgba(100,116,139,0.15); color: #94a3b8; border-color: rgba(100,116,139,0.2); }
.estado-enviado     { background: rgba(6,182,212,0.12); color: var(--cyan); border-color: rgba(6,182,212,0.25); }
.estado-aceptado    { background: rgba(52,211,153,0.12); color: var(--success); border-color: rgba(52,211,153,0.25); }
.estado-fabricacion { background: rgba(245,158,11,0.12); color: var(--warning); border-color: rgba(245,158,11,0.25); }
.estado-entregado   { background: rgba(129,140,248,0.12); color: #a5b4fc; border-color: rgba(129,140,248,0.22); }
.estado-rechazado   { background: rgba(248,113,113,0.12); color: var(--danger); border-color: rgba(248,113,113,0.22); }

.hi-estado-select {
  padding: 3px 8px; font-size: 11px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text); cursor: pointer;
  font-family: 'Manrope', sans-serif; transition: border-color var(--transition);
}
.hi-estado-select:focus { outline: none; border-color: rgba(139,92,246,0.5); }

/* ════════════════════════════════════════════════════════════
   KANBAN
════════════════════════════════════════════════════════════ */
.kanban-board {
  display: flex; gap: 10px;
  overflow-x: auto; padding: 0 18px 16px;
  min-height: 380px;
}
.kanban-board::-webkit-scrollbar { height: 5px; }
.kanban-board::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.2); border-radius: 99px; }

.kanban-col {
  flex-shrink: 0; width: 220px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius-sm); display: flex; flex-direction: column;
  max-height: calc(100vh - 320px);
  transition: border-color var(--transition), background var(--transition);
}
.kanban-col.drag-over { border-color: rgba(139,92,246,0.5); background: rgba(139,92,246,0.05); }

.kanban-col-header {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 13px 9px; border-bottom: 2px solid transparent; flex-shrink: 0;
}
.kanban-col-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.kanban-col-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; flex: 1; }
.kanban-col-count {
  font-size: 10px; background: rgba(255,255,255,0.06);
  padding: 1px 6px; border-radius: 99px; font-weight: 700;
}
.kanban-col-cards {
  flex: 1; overflow-y: auto; padding: 7px; display: flex; flex-direction: column; gap: 5px;
}
.kanban-col-cards::-webkit-scrollbar { width: 3px; }
.kanban-col-cards::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 99px; }

.kanban-empty { font-size: 10px; color: rgba(241,245,255,0.18); text-align: center; padding: 18px 8px; font-style: italic; }

.kanban-card {
  background: var(--glass2); border: 1px solid var(--border);
  border-left-width: 3px; border-radius: 7px; padding: 9px 11px;
  position: relative; cursor: grab;
  transition: transform var(--transition), box-shadow var(--transition);
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.kanban-card.dragging { opacity: 0.4; transform: scale(0.97); }
.kanban-card.tiene-cotizacion { cursor: pointer; }

.card-del {
  position: absolute; top: 5px; right: 7px;
  background: transparent; border: none;
  color: rgba(241,245,255,0.18); cursor: pointer; font-size: 11px;
  line-height: 1; padding: 2px 3px; border-radius: 3px;
  transition: color var(--transition);
}
.card-del:hover { color: var(--danger); }

.card-ref { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 2px; padding-right: 18px; }
.card-cliente { font-size: 10px; color: var(--text-muted); margin-bottom: 5px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 5px; flex-wrap: wrap; }
.card-badges { display: flex; gap: 3px; flex-wrap: wrap; }
.card-valor { font-size: 11px; font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-fecha { font-size: 9px; color: var(--text-muted); margin-top: 4px; }
.card-fecha.overdue { color: var(--danger); font-weight: 700; }
.card-fecha.soon    { color: var(--warning); font-weight: 600; }
.card-3d { display: flex; align-items: center; gap: 3px; font-size: 9px; color: var(--text-muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-quote-link { margin-top: 6px; font-size: 9px; color: var(--cyan); cursor: pointer; opacity: .7; transition: opacity var(--transition); }
.kanban-card.tiene-cotizacion:hover .card-quote-link { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   MODALES
════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(3, 6, 18, 0.80); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: var(--glass2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 22px;
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  animation: modalReveal 0.22s ease both;
  box-shadow: var(--shadow), 0 0 60px rgba(139,92,246,0.12);
}
.modal-card-lg  { max-width: 580px; }
.modal-card-xl  { max-width: 720px; }

/* ── Trazabilidad: strip P/N · S/N · Estado ── */
.mcq-traceable { display:flex; flex-wrap:wrap; gap:6px; padding:8px 0; }
.trace-badge { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:20px; font-size:10.5px; font-weight:700; letter-spacing:.03em; border:1px solid; }
.trace-key { font-size:8.5px; font-weight:900; text-transform:uppercase; letter-spacing:.08em; opacity:.75; }
.trace-pn { background:rgba(0,180,216,.10); border-color:rgba(0,180,216,.30); color:#00b4d8; }
.trace-sn { background:rgba(139,92,246,.10); border-color:rgba(139,92,246,.30); color:#a78bfa; }
.trace-estado { font-size:10px; }

/* ── Barra de acciones del modal cotización ── */
.mcq-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:10px 0 0; border-top:1px solid var(--border); margin-top:4px; }
.mcq-actions .btn-primary, .mcq-actions .btn-ghost { font-size:11.5px; padding:6px 14px; }
.mcq-estado-select { margin-left:auto; font-size:11px; padding:5px 8px; background:var(--surface); border:1px solid var(--border2); border-radius:var(--radius-sm); color:var(--text); cursor:pointer; }

/* ── Formulario de edición inline del modal ── */
.mcq-edit-form { background:rgba(0,0,0,.18); border:1px solid var(--border2); border-radius:var(--radius-sm); padding:14px; margin-top:4px; display:flex; flex-direction:column; gap:10px; }
.mcq-edit-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--purple); margin-bottom:2px; }
.mcq-edit-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; }
.mcq-edit-full { grid-column:1/-1; }
.mcq-edit-grid .field { gap:3px; margin:0; }
.mcq-edit-grid .field label { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); }
.mcq-edit-grid input, .mcq-edit-grid textarea { background:var(--surface); border:1px solid var(--border2); color:var(--text); border-radius:var(--radius-sm); padding:5px 8px; font-size:12px; width:100%; }
.mcq-edit-grid textarea { resize:vertical; min-height:48px; }
.mcq-edit-actions { display:flex; gap:8px; }
@keyframes modalReveal { from { opacity:0; transform:scale(0.95) translateY(16px); } to { opacity:1; transform:scale(1) translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-family: 'Orbitron', sans-serif; font-size: 13px; font-weight: 700; color: var(--text); }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
}
.modal-card .field { gap: 4px; }
.modal-card form { display: flex; flex-direction: column; gap: 10px; }

/* Modal cotización detalle */
.modal-cotizacion-body { display: flex; flex-direction: column; gap: 14px; }
.mcq-header { display:flex; align-items:center; justify-content:space-between; padding-bottom:10px; border-bottom:1px solid var(--border); }
.mcq-num { font-family:'Orbitron',sans-serif; font-size:17px; font-weight:700; color:var(--purple); }
.mcq-fecha { font-size:11px; color:var(--text-muted); }
.mcq-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; }
.mcq-field { display:flex; flex-direction:column; gap:2px; }
.mcq-label { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); }
.mcq-val { font-size:12px; color:var(--text); font-weight:500; }
.mcq-precio { display:flex; gap:14px; padding:12px 14px; border-radius:var(--radius-sm); background:rgba(139,92,246,.06); border:1px solid rgba(139,92,246,.15); }
.mcq-precio-item { flex:1; display:flex; flex-direction:column; gap:3px; }
.mcq-precio-label { font-size:10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; }
.mcq-precio-val { font-size:17px; font-weight:800; color:var(--text); font-variant-numeric:tabular-nums; }
.mcq-precio-total .mcq-precio-val { font-size:22px; color:var(--success); }
.mcq-tratamientos,.mcq-notas { font-size:11px; color:var(--text-muted); padding:7px 10px; border-radius:7px; background:rgba(255,255,255,.03); border:1px solid var(--border); }
.mcq-3d-link a { color:var(--purple); font-size:12px; }
.mcq-docs-panel { border:1px solid var(--border); border-radius:var(--radius-sm); background:rgba(255,255,255,.025); padding:12px; display:flex; flex-direction:column; gap:10px; }
.mcq-docs-panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.mcq-docs-title { font-size:11px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--cyan); }
.mcq-docs-sub { font-size:11px; color:var(--text-muted); margin-top:2px; }
.mcq-docs-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.mcq-doc-folder { border:1px solid var(--border2); border-radius:10px; background:rgba(0,0,0,.15); padding:10px; display:flex; flex-direction:column; gap:8px; min-height:120px; }
.mcq-doc-folder-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.mcq-doc-folder-title { font-size:11px; font-weight:700; color:var(--text); }
.mcq-doc-folder-sub { font-size:10px; color:var(--text-faint); }
.mcq-doc-list { display:flex; flex-direction:column; gap:6px; }
.mcq-doc-item { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 9px; border-radius:8px; border:1px solid rgba(6,182,212,.18); background:rgba(6,182,212,.06); text-decoration:none; }
.mcq-doc-item:hover { border-color:rgba(6,182,212,.35); background:rgba(6,182,212,.1); }
.mcq-doc-name { font-size:11px; color:var(--text); font-weight:600; word-break:break-word; }
.mcq-doc-meta { font-size:10px; color:var(--cyan); white-space:nowrap; }

/* ════════════════════════════════════════════════════════════
   ERROR + EMPTY STATES
════════════════════════════════════════════════════════════ */
.error {
  font-size: 12px; color: var(--danger);
  background: rgba(248,113,113,0.09); border: 1px solid rgba(248,113,113,0.25);
  border-radius: 5px; padding: 8px 11px;
}
.empty-state { text-align: center; color: var(--text-muted); font-size: 13px; padding: 40px 20px; }
.empty-state-sm { text-align: center; color: var(--text-faint); font-size: 11px; padding: 20px 10px; }

/* ════════════════════════════════════════════════════════════
   PRINT
════════════════════════════════════════════════════════════ */
.print-area { display: none; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .quoter-side-col { width: 250px; }
}

@media (max-width: 900px) {
  .cotizar-layout { flex-direction: column; padding: 12px; }
  .quoter-side-col { width: 100%; flex-direction: row; }
  .panel-offers-wrap { flex: 1; }
  .form-sections-grid { grid-template-columns: 1fr; }
  .form-controls-row { grid-template-columns: 1fr 1fr; }
  .resultado-body { grid-template-columns: 1fr; }
  .mcq-docs-grid { grid-template-columns: 1fr; }
  .viewer-3d-container, .viewer-3d-container canvas { height: 260px !important; }
}

/* ═══════════════════════════════════════════════════════════
   S/N INDICATOR + PEDIDO CANASTA
   ═══════════════════════════════════════════════════════════ */

/* S/N indicador de validación */
.sn-indicador { display: block; font-size: 9px; margin-top: 3px; min-height: 14px; border-radius: 4px; padding: 2px 6px; }
.sn-indicador.sn-info { color: var(--accent); background: rgba(0,180,216,0.08); }
.sn-indicador.sn-warn { color: #f59e0b; background: rgba(245,158,11,0.10); }
.sn-indicador.sn-ok  { color: #34d399; background: rgba(52,211,153,0.08); }

/* Canasta del pedido */
.pedido-canasta { background: var(--surface); border: 1.5px solid var(--accent); border-radius: 12px; padding: 16px 18px; margin-top: 16px; }
.canasta-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.canasta-title  { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.canasta-count  { font-size: 10px; color: var(--text-muted); background: rgba(255,255,255,0.05); border-radius: 10px; padding: 2px 8px; }
.canasta-ens-fields { display: flex; align-items: center; gap: 6px; }
.canasta-ens-label  { font-size: 9px; color: var(--text-muted); }
.canasta-ens-fields input { width: 56px; }
.canasta-total-row   { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.canasta-total-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.canasta-total-price { font-size: 16px; font-weight: 800; color: var(--accent); }
.canasta-list  { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.canasta-item  { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.canasta-item-num    { font-size: 10px; font-weight: 800; color: var(--accent); min-width: 18px; }
.canasta-item-info   { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.canasta-item-nombre { font-size: 12px; font-weight: 600; color: var(--text); }
.canasta-item-meta   { font-size: 10px; color: var(--text-muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.canasta-item-dias   { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.canasta-item-precio { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.canasta-remove      { color: var(--text-muted); }
.canasta-remove:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.plan-id-badge        { display:inline-flex; align-items:center; padding:2px 7px; border-radius:999px; background:rgba(0,180,216,0.10); border:1px solid rgba(0,180,216,0.25); color:var(--accent); font-size:9px; font-weight:700; }
.canasta-gantt-wrap   { margin: 10px 0; }
.canasta-gantt-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.canasta-gantt-title  { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); display: flex; align-items: center; gap: 5px; }
.gantt-date-ctrl      { display: flex; align-items: center; gap: 6px; }
.gantt-date-label     { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.gantt-date-input     { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 10px; padding: 2px 6px; cursor: pointer; }
.gantt-date-input:focus { outline: none; border-color: var(--accent); }
.canasta-plan-editor  { display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.plan-editor-head,
.plan-editor-row      { display:grid; grid-template-columns:minmax(180px,2fr) 72px minmax(180px,2fr) minmax(120px,1.2fr) 64px 64px; gap:8px; align-items:center; }
.plan-editor-head     { font-size:9px; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-muted); padding:0 4px; }
.plan-editor-row      { position:relative; padding:10px; border:1px solid var(--border); border-radius:8px; background:rgba(255,255,255,0.02); }
.plan-editor-piece    { display:flex; flex-direction:column; gap:3px; min-width:0; }
.plan-editor-piece strong { font-size:11px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.plan-editor-piece span { font-size:9px; color:var(--text-muted); }
.plan-input           { width:100%; background:var(--surface); border:1px solid var(--border); border-radius:6px; color:var(--text); padding:6px 8px; font-size:11px; }
.plan-input:focus     { outline:none; border-color:var(--accent); }
.plan-chip-list       { display:flex; flex-wrap:wrap; gap:4px; min-height:24px; }
.plan-chip            { display:inline-flex; align-items:center; padding:2px 6px; border-radius:999px; font-size:9px; color:#a5f3fc; background:rgba(0,180,216,0.12); border:1px solid rgba(0,180,216,0.25); }
.plan-empty           { font-size:10px; color:var(--text-muted); }
.plan-day             { text-align:center; font-size:11px; font-weight:700; color:var(--text); }
.plan-alert           { grid-column:1 / -1; font-size:10px; color:#f59e0b; }
.plan-editor-help     { font-size:10px; color:var(--text-muted); padding:2px 4px 0; }
.gantt-help-panel     { display:flex; flex-direction:column; gap:6px; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:rgba(255,255,255,0.02); }
.gantt-help-panel strong { color:var(--text); }
.gantt-help-selected  { color:#a5f3fc; }
.gantt-editor-grid    { display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:8px; margin-top:8px; }
.gantt-editor-card    { border:1px solid var(--border); border-radius:8px; padding:8px; background:rgba(255,255,255,0.02); display:flex; flex-direction:column; gap:7px; }
.gantt-editor-title   { font-size:10px; text-transform:uppercase; letter-spacing:0.08em; color:var(--accent); font-weight:700; }
.gantt-editor-note    { font-size:10px; color:var(--text-muted); }
.gantt-template-head  { display:grid; grid-template-columns:minmax(120px,1.4fr) 64px 1fr 58px; gap:6px; font-size:9px; color:var(--text-muted); text-transform:uppercase; }
.gantt-template-list,
.gantt-subtask-list   { display:flex; flex-direction:column; gap:6px; max-height:220px; overflow:auto; padding-right:2px; }
.gantt-template-row   { display:grid; grid-template-columns:minmax(120px,1.4fr) 64px 1fr 58px; gap:6px; align-items:center; }
.gantt-subtask-row    { display:grid; grid-template-columns:minmax(120px,1.4fr) 64px 58px; gap:6px; align-items:center; }
.gantt-template-row input,
.gantt-template-row select,
.gantt-subtask-row input { width:100%; background:var(--surface); border:1px solid var(--border); border-radius:6px; color:var(--text); padding:5px 7px; font-size:10.5px; }
.gantt-template-row input:focus,
.gantt-template-row select:focus,
.gantt-subtask-row input:focus { outline:none; border-color:var(--accent); }
.gantt-editor-actions { display:flex; gap:6px; flex-wrap:wrap; }
.precio-manual-row    { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px; }
.precio-manual-label  { font-size:10px; color:var(--text-muted); }
.precio-manual-input  { width:130px; background:var(--surface); border:1px solid var(--border); border-radius:6px; color:var(--text); padding:5px 8px; font-size:11px; }
.precio-manual-input:focus { outline:none; border-color:var(--accent); }
.btn-xs               { padding:5px 8px; font-size:10px; }
.precio-manual-mode   { font-size:10px; color:#a5f3fc; }
.canasta-gantt        { border: 1px solid var(--border); border-radius: 8px; overflow: auto; padding: 6px; background: rgba(255,255,255,0.02); }
.canasta-gantt svg    { user-select:none; -webkit-user-select:none; }
.canasta-gantt .gantt-bar-body:hover { filter: brightness(1.08); }
.canasta-gantt .gantt-bar-handle:hover { fill: #fff; }
.canasta-actions      { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); }
#pedido-save-status   { font-size: 10px; color: #34d399; }
/* Config PDF checkboxes */
.check-item           { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text); cursor: pointer; padding: 3px 0; }
.check-item input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; }

@media (max-width: 640px) {
  .form-controls-row { grid-template-columns: 1fr; }
  .historial-item { flex-direction: column; align-items: flex-start; gap: 6px; }
  .hi-precio { text-align: left; }
  .kanban-board { flex-direction: column; }
  .kanban-col { width: 100%; max-height: none; }
  .cost-bar { flex-direction: column; }
  .cost-divider { width: 100%; height: 1px; }
  .ens-parte-body .field-row { flex-direction: column; }
  .ens-gantt-grid { font-size: 9px; }
}

/* ═══════════════════════════════════════════════════════════
   ENSAMBLAJE — Estilos página de presupuesto multi-pieza
   ═══════════════════════════════════════════════════════════ */

/* Cabecera / formulario del ensamblaje */
.ens-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Sección de piezas */
.ens-parts-section {
  margin-bottom: 12px;
}
.ens-parts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ens-parts-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Barra calcular */
.ens-calc-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0;
}
.ens-parts-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* Tarjeta de pieza individual */
.ens-parte-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.ens-parte-card:focus-within {
  border-color: var(--accent);
}

.ens-parte-header {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 8px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.ens-parte-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(0,180,216,0.1);
  border-radius: 5px;
  padding: 3px 7px;
  align-self: center;
  flex-shrink: 0;
}

.ens-remove-btn {
  margin-left: auto;
  align-self: center;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  width: 26px; height: 26px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.ens-remove-btn:hover { background: rgba(239,68,68,0.12); color: #ef4444; }

.ens-parte-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Resultado inline tras calcular */
.ens-parte-result {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: rgba(0,180,216,0.05);
  border: 1px solid rgba(0,180,216,0.15);
  border-radius: 7px;
  margin-top: 4px;
}
.ens-res-badge {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ens-res-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.ens-res-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.ens-res-total .ens-res-val { color: var(--accent); font-size: 14px; }

/* KPIs de resultados */
.ens-kpi-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ens-kpi-card {
  flex: 1;
  min-width: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ens-kpi-card.ens-kpi-accent { border-color: rgba(0,180,216,0.3); background: rgba(0,180,216,0.04); }
.ens-kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.ens-kpi-accent .ens-kpi-val { color: var(--accent); }
.ens-kpi-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

/* Títulos de sección dentro de resultados */
.ens-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ens-gantt-hint {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* Tabla resumen */
.ens-table-section { margin-bottom: 20px; }
.ens-table-wrap { overflow-x: auto; }
.ens-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.ens-table th {
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 7px 9px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ens-table td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(42,47,61,0.5);
  color: var(--text);
  vertical-align: middle;
}
.ens-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.ens-table tfoot td {
  padding: 9px;
  font-weight: 800;
  color: var(--accent);
  font-size: 12px;
  border-top: 2px solid var(--border);
}

/* Sección Gantt */
.ens-gantt-section { margin-bottom: 20px; }

.ens-gantt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  padding: 8px;
}

/* Grid del Gantt */
.gantt-grid {
  display: grid;
  grid-template-columns: 160px repeat(var(--gantt-cols), minmax(30px, 1fr)) 70px;
  gap: 0;
  min-width: 400px;
}

.gantt-header-row {
  display: contents;
}

.gantt-label-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 8px;
  border-right: 1px solid var(--border);
  min-height: 32px;
}
.gantt-idx { font-size: 8px; font-weight: 700; color: var(--accent); }
.gantt-nombre { font-size: 10px; font-weight: 600; color: var(--text); line-height: 1.2; }
.gantt-proc { font-size: 8px; }

.gantt-day-header {
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 5px 2px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  border-right: 1px solid rgba(42,47,61,0.3);
}

.gantt-row {
  display: contents;
}

.gantt-cell {
  min-height: 34px;
  border-bottom: 1px solid rgba(42,47,61,0.3);
  border-right: 1px solid rgba(42,47,61,0.15);
  position: relative;
  transition: background 0.1s;
}

.gantt-bar-label {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

.gantt-start-ctrl {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-bottom: 1px solid rgba(42,47,61,0.3);
  border-left: 1px solid var(--border);
}
.gantt-start-input {
  width: 52px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 11px;
  text-align: center;
  padding: 3px 5px;
}
.gantt-start-input:focus { border-color: var(--accent); outline: none; }

/* Botones de acción finales */
.ens-result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 0;
}
.ens-save-status {
  font-size: 11px;
  color: #34d399;
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════
   CONFIGURACIÓN DEL TALLER
   ═══════════════════════════════════════════════════════════ */

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px 24px;
  max-width: 1100px;
}
.config-panel {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.config-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.config-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
/* Logo upload area */
.logo-upload-area {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 10px;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  transition: border-color .2s;
}
.logo-upload-area:hover { border-color: var(--accent); }
.logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
}
.logo-placeholder svg { opacity: .4; }
.logo-preview-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-preview-img {
  max-height: 72px;
  max-width: 220px;
  object-fit: contain;
  border-radius: 6px;
}
.btn-icon-sm {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════
   OPCIONES AVANZADAS DEL FORMULARIO (collapsible)
   ═══════════════════════════════════════════════════════════ */

.form-advanced-details {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.form-advanced-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  list-style: none;
  background: var(--bg);
  transition: background .15s, color .15s;
}
.form-advanced-summary:hover { color: var(--text); background: var(--surface); }
.form-advanced-details[open] .form-advanced-summary { color: var(--accent); background: var(--surface); }
.form-advanced-summary::-webkit-details-marker { display: none; }
.form-advanced-hint {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: auto;
}
.form-advanced-body {
  padding: 14px 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border);
}


