/* styles.css - Sistema de diseño industrial y moderno para PrintCost Pro */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Paleta de Colores Industrial Dark Mode */
  --bg-app: #0f172a;          /* Slate 900 */
  --bg-surface: #1e293b;      /* Slate 800 */
  --bg-surface-elevated: #334155; /* Slate 700 */
  --bg-surface-input: #0f172a;
  
  --border-subtle: #334155;
  --border-focus: #38bdf8;
  --border-highlight: #475569;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Acentos Funcionales */
  --accent-primary: #0284c7;   /* Sky 600 */
  --accent-primary-hover: #0369a1;
  --accent-cyan: #38bdf8;      /* Sky 400 */
  --accent-amber: #f59e0b;     /* Amber 500 (Mano de obra) */
  --accent-purple: #a855f7;    /* Purple 500 (Máquina) */
  --accent-emerald: #10b981;   /* Emerald 500 (Beneficio/Éxito) */
  --accent-rose: #f43f5e;      /* Rose 500 (Riesgo/Alerta) */
  --accent-gold: #fbbf24;

  /* Tipografías */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Sombras y Radios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 15px rgba(56, 189, 248, 0.15);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Tipografía de utilidad */
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-cyan); }
.text-success { color: var(--accent-emerald); }
.text-warning { color: var(--accent-amber); }
.text-danger { color: var(--accent-rose); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.mt-3 { margin-top: 0.75rem; }
.hidden { display: none !important; }

/* Contenedor Principal */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Barra de Navegación Superior */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon-box {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Pestañas de Navegación */
.nav-tabs-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-app);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.nav-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: #fff;
  background-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

/* Área Principal de Contenido */
.main-content {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Layout de la Calculadora Principal */
.calc-grid-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 1080px) {
  .calc-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* Tarjetas y Secciones */
.panel-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Formularios e Inputs */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 680px) {
  .form-grid-2, .form-grid-3, .form-grid-4 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label-sm {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-label-inline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-field {
  width: 100%;
  background-color: var(--bg-surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  transition: all var(--transition-fast);
  outline: none;
}

.input-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.input-sm {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

.input-inline-mini {
  width: 55px;
  background-color: var(--bg-surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  text-align: center;
}

.input-suffix-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-suffix-wrapper .input-field {
  padding-right: 3.5rem;
}

.input-suffix {
  position: absolute;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

select.input-field, select.select-sm {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
  padding-right: 2.2rem;
  cursor: pointer;
}

.select-sm {
  background-color: var(--bg-surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  outline: none;
}

textarea.input-field {
  resize: vertical;
  min-height: 70px;
}

/* Slider de margen de beneficio */
.slider-group {
  margin: 1.25rem 0;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.slider-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.slider-value-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profit-input-number {
  width: 75px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: right;
  color: var(--accent-emerald);
}

.custom-range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #334155;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.custom-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  cursor: pointer;
  transition: transform 0.1s;
}

.custom-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.margin-presets-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-margin-preset {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-margin-preset:hover {
  color: #fff;
  background-color: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
}

/* Filamentos / Materiales Cards */
.material-row-card {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  transition: border-color var(--transition-fast);
}

.material-row-card:hover {
  border-color: var(--border-highlight);
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.material-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background-color: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grid-form-3 {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 540px) {
  .grid-form-3 {
    grid-template-columns: 1fr;
  }
}

.row-footer-mini {
  margin-top: 0.4rem;
  display: flex;
  justify-content: flex-end;
}

/* Hardware / Extras Rows */
.hardware-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.6rem;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-subtle);
}

.hw-subtotal {
  text-align: right;
  font-size: 0.9rem;
  color: var(--accent-cyan);
}

.empty-hint-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem 0;
}

/* Botones y Acciones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}

.btn-success {
  background-color: var(--accent-emerald);
  color: #064e3b;
  font-weight: 700;
}
.btn-success:hover {
  background-color: #059669;
  color: #fff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background-color: #475569;
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-highlight);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-outline-sm {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-outline-sm:hover {
  color: #fff;
  border-color: var(--accent-cyan);
}

.btn-danger-sm {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-danger-sm:hover {
  background: var(--accent-rose);
  color: #fff;
}

.btn-icon-danger {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}
.btn-icon-danger:hover {
  color: var(--accent-rose);
}

/* Columna Derecha: Tarjetas de Precios y Resultados */
.sticky-results-column {
  position: sticky;
  top: 5rem;
}

.pricing-hero-card {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #0284c7;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(2, 132, 199, 0.15);
  position: relative;
  overflow: hidden;
}

.pricing-hero-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
  display: inline-block;
}

.hero-price-main {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 0.25rem;
}

.hero-price-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.profit-pill-highlight {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.hero-cost-footer {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* Niveles de Precios Alternativos */
.tier-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.tier-mini-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: transform var(--transition-fast);
}

.tier-mini-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
}

.tier-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.tier-price {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.tier-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tier-profit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-emerald);
  margin-top: 0.25rem;
}

/* Banner de Lote / Volumen */
.batch-banner {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.batch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.batch-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.batch-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

/* Desglose Detallado de Costes */
.cost-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cost-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.6rem;
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

.cost-row-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cost-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cost-row-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Gráfico SVG Donut */
.chart-flex-wrapper {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .chart-flex-wrapper {
    flex-direction: column;
  }
}

.donut-svg-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  flex-shrink: 0;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-segment {
  cursor: pointer;
  transition: stroke-width 0.2s, opacity 0.2s;
}

.donut-segment:hover, .donut-segment.segment-active {
  stroke-width: 44;
  opacity: 0.9;
}

.donut-center-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.donut-sublabel {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.donut-main-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.donut-profit-badge {
  font-size: 0.68rem;
  color: var(--accent-emerald);
  font-weight: 700;
}

.donut-legend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.legend-item:hover, .legend-item.legend-active {
  background-color: rgba(255, 255, 255, 0.05);
}

.legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label {
  color: var(--text-secondary);
  flex: 1;
}

.legend-val {
  color: var(--text-primary);
}

.legend-pct {
  color: var(--accent-cyan);
  width: 42px;
  text-align: right;
}

/* Tablas Generales */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.data-table th {
  background-color: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.row-active-tier td {
  background-color: rgba(56, 189, 248, 0.08) !important;
}

.discount-badge {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.badge-type {
  font-size: 0.7rem;
  font-weight: 700;
  background-color: var(--bg-surface-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.btn-icon-fav {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem;
  color: var(--text-muted);
  opacity: 0.6;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.btn-icon-fav:hover {
  transform: scale(1.25);
  opacity: 1;
}

.btn-icon-fav.is-fav {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(234, 179, 8, 0.5));
}

.fav-tag {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #fbbf24;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

.row-favorite td {
  background-color: rgba(234, 179, 8, 0.025);
}

/* Dropzone de Slicer */
.dropzone-box {
  border: 2px dashed var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.dropzone-box:hover, .dropzone-box.drag-over {
  border-color: var(--accent-cyan);
  background-color: rgba(56, 189, 248, 0.05);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.dropzone-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.dropzone-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.slicer-badges-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.slicer-chip {
  background-color: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.parse-success-card {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
}

.parse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.badge-success {
  color: #34d399;
  font-weight: 700;
  font-size: 0.85rem;
}

.file-name-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.parse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.parse-stat {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Asistente de Tarifa Horaria Cards */
.wizard-rates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 768px) {
  .wizard-rates-grid {
    grid-template-columns: 1fr;
  }
}

.wizard-rate-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.wizard-rate-card.featured {
  border-color: var(--accent-emerald);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1), transparent);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.rate-tier-name {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.rate-main-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.rate-tier-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Historial de Proyectos Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-card-header h4 {
  font-size: 0.98rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.project-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.project-meta-row {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.project-details {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.project-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.empty-state-card {
  text-align: center;
  padding: 3rem 1.5rem;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* Modales */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: auto;
}

.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast-info {
  border-left: 4px solid var(--accent-cyan);
}

.toast-warning {
  border-left: 4px solid var(--accent-amber);
}

.toast-error {
  border-left: 4px solid var(--accent-rose);
}

/* Documento de Presupuesto Imprimible (A4) */
.quote-preview-container {
  background-color: #ffffff;
  color: #1e293b;
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 850px;
  margin: 0 auto;
}

.print-document {
  font-family: var(--font-main);
  color: #1e293b;
  line-height: 1.4;
}

.print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.brand-block {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.brand-logo-badge {
  width: 48px;
  height: 48px;
  background-color: #0284c7;
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.brand-meta {
  font-size: 0.8rem;
  color: #64748b;
}

.quote-number-block {
  text-align: right;
}

.quote-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background-color: #e0f2fe;
  color: #0369a1;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.quote-code {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
}

.quote-dates {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.35rem;
}

.print-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.info-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.card-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #0369a1;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.card-value-primary {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.card-meta {
  font-size: 0.82rem;
  color: #475569;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.print-table th {
  background-color: #f1f5f9;
  color: #334155;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.65rem 0.75rem;
  border-bottom: 2px solid #cbd5e1;
  text-align: left;
}

.print-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
  color: #1e293b;
}

.item-subtext {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.print-totals-section {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.note-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  color: #475569;
}

.note-box strong {
  color: #0f172a;
}

.print-totals-box {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: #334155;
}

.total-highlight {
  border-top: 2px solid #0284c7;
  padding-top: 0.6rem;
  margin-top: 0.3rem;
  color: #0f172a;
}

.print-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 0.78rem;
  color: #64748b;
}

.legal-text {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* Reglas de Impresión (@media print) */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .nav-tabs-wrapper,
  .no-print,
  .panel-actions,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }

  .main-content {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .tab-pane {
    display: none !important;
  }

  #pane-quotes {
    display: block !important;
  }

  .quote-preview-container {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}
