/* ===========================
   HERRAMIENTAS / CALCULADORAS - DASHCOE
   Se carga después de Style.css
=========================== */

body {
  background: linear-gradient(135deg, #000000 0%, #0a1b2f 100%);
  background-attachment: fixed;
}

.tool-page {
  max-width: 1150px;
  margin: 0 auto;
  padding: 120px 20px 80px;
  color: #e5e7eb;
  text-align: left;
}

/* ===== ENCABEZADO ===== */
.tool-header {
  text-align: center;
  margin-bottom: 44px;
}

.tool-header h1 {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #0078ff, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-header p {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #c7ceda;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: #00d4ff;
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
}

/* ===== TARJETAS ===== */
.tool-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 120, 255, 0.2);
  border-radius: 18px;
  padding: 26px;
  backdrop-filter: blur(14px);
}

.tool-card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 18px;
}

/* ===== LAYOUT: FORMULARIO | RESULTADOS ===== */
.tool-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 24px;
  align-items: start;
}

.tool-results {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* ===== FORMULARIO ===== */
/* Anula el estilo global de "form" de Style.css (pensado para el formulario de contacto) */
.tool-form {
  display: block;
  font-weight: 400;
}

.tool-form .field {
  margin-bottom: 18px;
}

.tool-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #c7ceda;
  margin-bottom: 6px;
}

.input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 120, 255, 0.3);
  border-radius: 10px;
  transition: border-color 0.2s ease;
}

.input-wrap:focus-within {
  border-color: #00d4ff;
}

.input-wrap .affix {
  padding: 0 10px;
  color: #8f9bb0;
  font-size: 0.9rem;
  white-space: nowrap;
}

.tool-form input[type="number"],
.tool-form select {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1rem;
  padding: 11px 12px;
  outline: none;
}

.tool-form select {
  cursor: pointer;
}

.tool-form select option {
  background: #0a1422;
  color: #ffffff;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tool-form .field-hint {
  font-size: 0.75rem;
  color: #8f9bb0;
  margin-top: 6px;
  line-height: 1.5;
}

.checkbox-field {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.checkbox-field input {
  margin-top: 4px;
  accent-color: #0078ff;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.checkbox-field label {
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

/* ===== TARJETAS DE RESULTADO (KPI) ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 120, 255, 0.2);
  border-radius: 14px;
  padding: 16px 18px;
}

.stat-label {
  font-size: 0.8rem;
  color: #a0a8b8;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.stat.primary {
  border-color: rgba(0, 212, 255, 0.5);
  background: rgba(0, 120, 255, 0.12);
}

.stat-note {
  font-size: 0.75rem;
  color: #8f9bb0;
  margin-top: 4px;
}

.stat-note.good {
  color: #4cd98a;
}

/* ===== GRÁFICA ===== */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.85rem;
  color: #c7ceda;
  margin-bottom: 10px;
}

.chart-legend span,
.chart-tooltip div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-legend i,
.chart-tooltip i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.chart-plot {
  position: relative;
}

.chart-svg {
  display: block;
  max-width: 100%;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.chart-baseline {
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 1;
}

.chart-axis {
  fill: #8f9bb0;
  font-size: 11px;
  font-family: "Poppins", sans-serif;
}

.chart-hit {
  cursor: crosshair;
}

.chart-hit.active {
  fill: rgba(255, 255, 255, 0.05);
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #0d1a2c;
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: #e5e7eb;
  min-width: 190px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 6px;
  color: #ffffff;
}

.chart-tooltip div {
  justify-content: space-between;
  margin-top: 3px;
}

.chart-tooltip div span {
  flex: 1;
  color: #a0a8b8;
}

.chart-tooltip b {
  font-variant-numeric: tabular-nums;
}

/* ===== TABLA ===== */
.table-scroll {
  max-height: 420px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.tool-table th,
.tool-table td {
  padding: 9px 12px;
  text-align: right;
  white-space: nowrap;
}

.tool-table th:first-child,
.tool-table td:first-child {
  text-align: left;
}

.tool-table thead th {
  position: sticky;
  top: 0;
  background: #0d1a2c;
  color: #c7ceda;
  font-weight: 600;
  z-index: 1;
}

.tool-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.tool-table tbody td {
  color: #e5e7eb;
}

/* ===== FÓRMULA EXCEL Y NOTAS ===== */
.excel-formula {
  display: block;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 120, 255, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  color: #7fe0ff;
  overflow-x: auto;
  white-space: nowrap;
  margin: 10px 0;
}

.tool-card p {
  line-height: 1.7;
  color: #c7ceda;
  font-size: 0.92rem;
}

.tool-disclaimer {
  font-size: 0.8rem !important;
  color: #8f9bb0 !important;
}

/* ===== ÍNDICE DE HERRAMIENTAS ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 24px;
}

.tool-link-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tool-link-card:hover {
  transform: translateY(-6px);
  border-color: #0078ff;
  box-shadow: 0 20px 50px rgba(0, 120, 255, 0.25);
}

.tool-link-card .tool-icon {
  font-size: 2rem;
}

.tool-link-card h2 {
  margin: 0;
}

.tool-link-card span.cta {
  color: #00d4ff;
  font-weight: 600;
  margin-top: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .tool-page {
    padding: 100px 16px 60px;
  }

  .tool-header h1 {
    font-size: 2rem;
  }

  .tool-card {
    padding: 20px;
  }

  .stat-value {
    font-size: 1.25rem;
  }
}
