
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-body: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --ad-bg: #f1f5f9;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-image:url("/images/background_halloween.png");
  background-attachment: fixed;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/*header */
header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

header nav {
  margin: 0 auto;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: lowercase;
}

header h1::first-letter {
  text-transform: uppercase;
}

/* Menu Principal */
nav > ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav li {
  position: relative;
}

nav a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  display: block;
  border-radius: 6px;
  transition: all 0.2s ease;
}

nav a:hover {
  background-color: var(--ad-bg);
  color: var(--primary);
}

/* Submenu */
nav ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  min-width: 220px;
  list-style: none;
  padding: 0.5rem 0;
}

nav li:hover > ul {
  display: block;
}

nav ul ul a {
  padding: 0.6rem 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

nav ul ul a:hover {
  color: var(--primary);
  background-color: #eff6ff;
}

/*anuncios */
.layout-container {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 1.5rem;
  max-width: 1300px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1;
}

/* Banners de Publicidad Lateral */
.ad-banner {
  background-color: var(--ad-bg);
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  height: 600px;
  position: sticky;
  top: 5rem;
}

/* main*/
main {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  min-height: 500px;
}

main h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

/*footer */
footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/*responsive */
@media (max-width: 900px) {
  header {
    flex-direction: column;
    gap: 1rem;
  }

  .layout-container {
    grid-template-columns: 1fr; /* Columna única en móviles */
  }

  .ad-banner {
    height: 120px;
    position: static;
  }

  nav > ul {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ==========================================================================
   ESTILOS PARA LA PÁGINA HOME Y WIDGET DÓLAR
   ========================================================================== */

/* Widget Dólar BNA */
.dolar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid #16a34a;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  max-width: 480px;
  margin: 0 auto 2rem auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

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

.dolar-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.dolar-badge {
  background-color: #dcfce7;
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.dolar-values {
  display: flex;
  gap: 1rem;
}

.dolar-box {
  flex: 1;
  background-color: var(--bg-body);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.dolar-box .label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dolar-box .value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.dolar-update {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: right;
}

/* Tarjetas Destacadas */
.featured-tools {
  text-align: center;
}

.featured-tools h2 {
  font-size: 1.6rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.featured-tools .subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
}

.card-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.btn-card {
  background-color: var(--primary);
  color: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  width: 100%;
}
/* ==========================================================================
   ESTILOS PARA PÁGINA DE FÓRMULAS
   ========================================================================== */
.formulas-container {
  max-width: 720px;
  margin: 0 auto;
}

.formulas-header {
  text-align: center;
  margin-bottom: 2rem;
}

.formulas-header h2 {
  font-size: 1.7rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.formulas-header .subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.formula-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.formula-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.formula-icon {
  font-size: 1.4rem;
}

.formula-card h3 {
  font-size: 1.15rem;
  color: var(--text-main);
  margin: 0;
}

.formula-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.math-box {
  background-color: #f1f5f9;
  border-left: 4px solid var(--primary);
  padding: 0.85rem 1rem;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.example-box {
  background-color: var(--bg-body);
  border: 1px dashed var(--border);
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-main);
}

.example-box ul {
  margin-top: 0.5rem;
  padding-left: 1.2rem;
  margin-bottom: 0;
}

.example-box li {
  margin-bottom: 0.25rem;
}
/* ==========================================================================
   6. ESTILOS DE LA CALCULADORA CLÁSICA
   ========================================================================== */
.tool-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.calculator {
  max-width: 320px;
  margin: 0 auto;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08);
}

.calc-display {
  width: 100%;
  height: 60px;
  background-color: var(--ad-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.8rem;
  font-weight: 700;
  text-align: right;
  padding: 0 1rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.calc-buttons button {
  height: 50px;
  font-size: 1.2rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.calc-buttons button:hover {
  background-color: var(--ad-bg);
  border-color: #cbd5e1;
}

.calc-buttons button:active {
  transform: scale(0.96);
}

.calc-buttons .btn-op {
  background-color: #eff6ff;
  color: var(--primary);
}

.calc-buttons .btn-func {
  background-color: #f1f5f9;
  color: #dc2626;
}

.calc-buttons .btn-equal {
  background-color: var(--primary);
  color: white;
  border: none;
}

.calc-buttons .btn-equal:hover {
  background-color: var(--primary-hover);
}

.calc-buttons .btn-zero {
  grid-column: span 2;
}

/* ==========================================================================
   7. CALCULADORA DE COSTOS FINALES
   ========================================================================== */
.calculator-card {
  max-width: 480px;
  margin: 0 auto;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-group input[type="number"] {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--bg-body);
  transition: border-color 0.2s;
}

.form-group input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--surface);
}

/* Opciones Radio y Checkbox */
.radio-group {
  display: flex;
  gap: 1rem;
  margin-top: 0.2rem;
}

.radio-label, .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: normal;
}

.checkbox-group {
  margin-top: 0.5rem;
}

/* Tarjeta de Resultados */
.results-box {
  margin-top: 1.5rem;
  background-color: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.result-row.final {
  border-top: 2px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--primary);
}

/* Estilos para Calculadora de Sueldos */
.results-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

.result-row.discount {
  color: #dc2626; /* Rojo para retenciones */
}

.employer-box {
  margin-top: 1rem;
  background-color: #f0fdf4; /* Verde claro suave */
  border-color: #bbf7d0;
}

.result-row.employer-final {
  color: #15803d; /* Verde oscuro para el costo total */
}

/* ==========================================================================
   ESTILOS PARA CREA UN PRESUPUESTO
   ========================================================================== */
/* ==========================================================================
   ESTILOS BASE EN PANTALLA
   ========================================================================== */
.presupuesto-card {
  max-width: 750px;
  background: #ffffff;
  border-radius: 8px;
  padding: 2rem;
}

.print-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--text-main);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.brand h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

.brand span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.doc-meta {
  text-align: right;
}

.doc-meta h2 {
  font-size: 1.25rem;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.client-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.client-section label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.client-section input {
  margin: 0;
  font-weight: 600;
}

/* Tabla simple y ordenada */
.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.items-table th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  padding: 0.5rem 0.25rem;
}

.items-table td {
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--border);
}

.items-table input {
  margin: 0;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.col-cant { width: 10%; }
.col-precio { width: 22%; }
.col-total { width: 22%; text-align: right; font-weight: 600; }
.col-action { width: 5%; text-align: center; }

.btn-del {
  background: none;
  border: none;
  color: #ef4444;
  font-weight: bold;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

.btn-add {
  background: none;
  border: 1px dashed var(--border);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  width: 100%;
  margin-bottom: 1.5rem;
}

.btn-add:hover {
  background: var(--ad-bg);
}

/* Disposición de totales */
.budget-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-top: 1rem;
}

.budget-controls {
  display: flex;
  gap: 1rem;
}

.summary-box {
  width: 260px;
  margin-left: auto;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.summary-row.final-total {
  border-top: 2px solid var(--text-main);
  margin-top: 0.4rem;
  padding-top: 0.5rem;
  font-size: 1.1rem;
  color: var(--text-main);
}

.print-footer {
  display: none;
}

/* ==========================================================================
   DISEÑO MINIMALISTA PARA PDF/IMPRESIÓN (@media print)
   ========================================================================== */   

   /* ==========================================================================
   CONFIGURACIÓN EXACTA PARA IMPRESIÓN Y PDF HOJA A4
   ========================================================================== */

/* 1. Definir dimensiones de hoja A4 y márgenes de impresión */
@page {
  size: A4 portrait;
  margin: 15mm 18mm 15mm 18mm; /* Arriba, Derecha, Abajo, Izquierda */
}



@media print {
  /* 2. Ocultar todos los elementos web y botones */
  header, 
  footer, 
  .ad-banner, 
  .no-print, 
  .tool-desc, 
  main > h2 {
    display: none !important;
  }

  /* 3. Limpiar el cuerpo de la página */
  html, body {
    width: 100%;
    height: 100%;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
    line-height: 1.4;
  }

  /* 4. Extender el contenedor al ancho y alto disponible de la hoja A4 */
  .layout-container, 
  main, 
  .presupuesto-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  /* Contenedor principal estructurado verticalmente para ocupar la hoja */
  .presupuesto-card {
    display: flex;
    flex-direction: column;
    min-height: 250mm; /* Forzar estructura limpia de página A4 */
  }

  /* 5. Encabezado principal ordenado */
  .print-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2pt solid #0f172a;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }

  .brand h1 {
    font-size: 20pt;
    font-weight: 800;
    color: #0f172a !important;
    margin: 0;
  }

  .brand span {
    font-size: 9pt;
    color: #475569 !important;
  }

  .doc-meta h2 {
    font-size: 14pt;
    font-weight: 800;
    letter-spacing: 1px;
    color: #0f172a !important;
    margin-bottom: 6px;
  }

  .doc-meta .meta-field {
    font-size: 9pt;
    color: #334155;
  }

  /* 6. Sección del Cliente organizada */
  .client-section {
    display: flex !important;
    align-items: center;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 10px;
    margin-bottom: 20px;
  }

  .client-section label {
    font-size: 9pt;
    font-weight: 700;
    color: #475569 !important;
    margin-right: 10px;
  }

  /* Transformar campos de texto editables a texto plano impreso */
  input, select {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 10pt !important;
    font-weight: 600 !important;
    color: #000000 !important;
    box-shadow: none !important;
  }

  /* 7. Tabla de ítems espaciada y legible */
  .items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
  }

  .items-table th {
    border-bottom: 1.5pt solid #0f172a;
    color: #0f172a !important;
    font-size: 8.5pt;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 4px;
    text-align: left;
  }

  .items-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 4px;
    font-size: 10pt;
    vertical-align: middle;
  }

  .col-total {
    text-align: right !important;
  }

  /* 8. Sección de totales bien alineada a la derecha */
  .budget-footer {
    display: flex !important;
    justify-content: flex-end;
    margin-top: auto; /* Empuja los totales hacia la parte inferior */
    padding-top: 15px;
  }

  .summary-box {
    width: 220px;
  }

  .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 9.5pt;
    color: #334155;
  }

  .summary-row.final-total {
    border-top: 1.5pt solid #0f172a;
    margin-top: 6px;
    padding-top: 8px;
    font-size: 12pt;
    font-weight: 800;
    color: #0f172a !important;
  }

  /* 9. Pie de página formal centrado abajo */
  .print-footer {
    display: block !important;
    margin-top: 30px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 8.5pt;
    color: #64748b;
  }
}

/* ==========================================================================
   ESTILOS PARA LA PÁGINA "ACERCA DE NOSOTROS"
   ========================================================================== */
.about-container {
  max-width: 700px;
  margin: 0 auto;
}

.about-header {
  text-align: center;
  margin-bottom: 2rem;
}

.about-header h2 {
  font-size: 1.8rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.about-header .subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-card {
  background-color: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.about-card h3 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 0.6rem;
}

.about-card p {
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.6;
}

.about-card p + p {
  margin-top: 0.75rem;
}

/* Tarjeta destacada para el futuro del proyecto */
.about-card.highlight {
  background-color: #eff6ff;
  border-color: #bfdbfe;
}

.about-card.highlight h3 {
  color: #1d4ed8;
}