/* ══════════════════════════════════════════════
   RESONAR — Componentes reutilizables
   Navegación · Tarjetas · Botones · Formularios
   ══════════════════════════════════════════════ */

/* ── NAVEGACIÓN ─────────────────────────────── */
.nav {
  background: var(--gr1);
  display: flex;
  align-items: center;
  border-bottom: 2.5px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.nav-brand {
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.nav-brand .logo {
  width: 30px;
  height: 30px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-brand .logo span {
  color: var(--gr1);
  font-size: 13px;
  font-weight: 700;
}

.nav-brand h1 {
  color: #f0e8d8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.2;
}

.nav-brand p {
  color: var(--gr3);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  padding: 14px 16px;
  color: var(--gr3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .18s, border-color .18s, background .18s;
}

.nav-tab:hover {
  color: #f0e8d8;
  background: rgba(255,255,255,.06);
}

.nav-tab.active {
  color: var(--goldl);
  border-bottom-color: var(--goldl);
}

.tab-icon {
  font-size: 13px;
  opacity: .8;
}

/* ── ENCABEZADO DE SECCIÓN ─────────────────── */
.sec-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.sec-hd .bar {
  width: 3px;
  height: 20px;
  background: var(--bl2);
  border-radius: 2px;
  flex-shrink: 0;
}

.sec-hd h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--gr1);
  white-space: nowrap;
}

.sec-hd .line {
  flex: 1;
  height: 1px;
  background: var(--gr4);
}

/* ── TARJETAS ─────────────────────────────── */
.card {
  background: #fff;
  border: 0.5px solid var(--gr4);
  border-radius: var(--rad-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.card-bl   { border-left: 3px solid var(--bl2); }
.card-gold { border-left: 3px solid var(--gold); }
.card-gn   { border-left: 3px solid var(--gn); }
.card-dark {
  background: var(--gr1);
  border: none;
  color: #e8dfc8;
}

/* ── RESULTADO MÉTRICO ──────────────────────── */
.metric-card {
  background: var(--bl1);
  border-radius: var(--rad-lg);
  padding: 16px 10px;
  text-align: center;
}

.metric-card.gold-bg { background: var(--wd1); }
.metric-card.dark-bg { background: var(--gr1); }

.metric-val {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--goldl);
  line-height: 1.1;
}

.metric-lbl {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-top: 4px;
}

/* ── BOTONES ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--rad);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  border: 1px solid var(--gr4);
  background: #fff;
  color: var(--gr1);
  cursor: pointer;
  transition: all .15s;
}

.btn:hover { background: var(--gr5); border-color: var(--gr3); }
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--bl1);
  border-color: var(--bl1);
  color: #fff;
}
.btn-primary:hover { background: var(--bl2); border-color: var(--bl2); }

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.btn-gold:hover { background: var(--wd2); border-color: var(--wd2); }

.btn-full { width: 100%; justify-content: center; }

/* ── FORMULARIOS ──────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--gr2);
}

.form-control {
  padding: 9px 12px;
  border: 1px solid var(--gr4);
  border-radius: var(--rad);
  background: #fff;
  font-size: 14px;
  color: var(--ink);
  font-family: var(--font);
  width: 100%;
  transition: border-color .15s;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--bl2);
  box-shadow: 0 0 0 3px rgba(46, 95, 138, .12);
}

/* ── BADGE / PILL ─────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.badge-bl   { background: var(--bl1); color: var(--bl5); }
.badge-bl2  { background: var(--bl2); color: #fff; }
.badge-gray { background: var(--gr1); color: var(--gr4); }
.badge-gold { background: var(--gold); color: #fff; }
.badge-gn   { background: var(--gn);  color: #fff; }
.badge-rd   { background: var(--rd);  color: #fff; }

/* ── BARRAS DE PROGRESO ───────────────────── */
.progress-track {
  height: 6px;
  background: var(--gr4);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gn);
  border-radius: 3px;
  transition: width .35s ease;
}

/* ── BARRA VISUAL COMPARATIVA ─────────────── */
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.bar-row .name {
  font-size: 11px;
  color: var(--gr2);
  width: 50px;
  flex-shrink: 0;
  font-weight: 700;
}

.bar-track {
  flex: 1;
  height: 12px;
  background: var(--gr4);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width .4s ease;
}

.fill-bl  { background: var(--bl2); }
.fill-gld { background: var(--gold); }
.fill-wd  { background: var(--wd2); }

.bar-val {
  font-size: 11px;
  color: var(--gr1);
  width: 62px;
  text-align: right;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── TABLA ────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--gr1);
  color: var(--goldl);
  padding: 9px 12px;
  text-align: left;
  font-size: 10px;
  letter-spacing: .8px;
  text-transform: uppercase;
  font-weight: 700;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 0.5px solid var(--gr4);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: rgba(0,0,0,.025); }

/* ── FRASE FINAL ───────────────────────────── */
.frase-card {
  background: var(--gr1);
  border-radius: var(--rad-lg);
  padding: 22px 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: 20px;
}

.frase-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--gold);
}

.frase-card::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--gold);
}

.frase-card q {
  display: block;
  font-size: 13px;
  color: #e8dfc8;
  line-height: 1.75;
  font-style: italic;
  margin-bottom: 10px;
  quotes: '\201C''\201D';
}

.frase-card cite {
  font-size: 11px;
  color: var(--goldl);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 700;
  font-style: normal;
}

/* ── CHECKLIST ─────────────────────────────── */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: #fff;
  border-radius: var(--rad);
  border: 0.5px solid var(--gr4);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}

.check-item:hover { border-color: var(--bl3); background: var(--bl5); }

.check-item.done {
  background: var(--gn-lt);
  border-color: #9ec9ac;
}

.check-box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1.5px solid var(--gr3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.check-item.done .check-box {
  background: var(--gn);
  border-color: var(--gn);
}

.check-tick { display: none; color: #fff; font-size: 12px; font-weight: 700; }
.check-item.done .check-tick { display: block; }

.check-text { font-size: 13px; color: var(--gr1); flex: 1; }
.check-item.done .check-text { text-decoration: line-through; color: var(--gr3); }

.check-cat {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--gr3);
  flex-shrink: 0;
}

/* ── DIAGNÓSTICO ──────────────────────────── */
.diag-item {
  border-radius: var(--rad);
  padding: 13px;
  border-left: 3px solid transparent;
}

.diag-item.ok  { background: var(--gn-lt); border-color: var(--gn); }
.diag-item.warn{ background: var(--yl-lt); border-color: #c49a3c; }
.diag-item.err { background: var(--rd-lt); border-color: var(--rd); }
.diag-item.info{ background: var(--bl4);   border-color: var(--bl2); }

.diag-sym {
  font-size: 20px;
  margin-bottom: 5px;
  line-height: 1;
}

.diag-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 4px;
}

.diag-desc { font-size: 12px; line-height: 1.5; color: var(--gr1); }

/* ── MADERA CARD ──────────────────────────── */
.wood-card {
  border-radius: var(--rad-lg);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.1);
  box-shadow: var(--shadow-sm);
}

.wood-swatch {
  height: 60px;
  position: relative;
}

.wood-grain {
  position: absolute;
  inset: 0;
}

.wood-info {
  padding: 10px 12px;
  background: #fff;
}

.wood-name   { font-size: 12px; font-weight: 700; color: var(--gr1); }
.wood-latin  { font-size: 10px; color: var(--gr3); font-style: italic; margin-bottom: 4px; }
.wood-desc   { font-size: 11px; color: var(--gr2); line-height: 1.4; }

/* ── ZONA BAR ─────────────────────────────── */
.zone-bar {
  position: relative;
  height: 22px;
  background: var(--wd4);
  border-radius: 6px;
  margin: 10px 0 4px;
  border: 1px solid var(--wd3);
  overflow: hidden;
}

.zone-inactive { position: absolute; top: 0; height: 100%; background: rgba(0,0,0,.06); }
.zone-active   { position: absolute; top: 0; height: 100%; background: var(--bl2); opacity: .35; }

.zone-markers {
  position: relative;
  height: 16px;
  margin-top: 3px;
}

.zone-mark {
  position: absolute;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--bl1);
  font-weight: 700;
}

/* ── FASES DE ACABADO ─────────────────────── */
.phase-flow { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; }

.phase-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--rad);
}

.phase-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: rgba(255,255,255,.12);
}

.phase-connector {
  width: 3px;
  height: 12px;
  background: var(--goldl);
  margin: 0 auto 0 21px;
  border-radius: 2px;
}

.phase-title { font-size: 12px; font-weight: 700; }
.phase-desc  { font-size: 11px; margin-top: 2px; opacity: .7; }

/* ── GRIT BOX ─────────────────────────────── */
.grit-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.grit-box {
  flex: 1;
  border-radius: 6px;
  padding: 12px 4px;
  text-align: center;
}

.grit-num  { font-size: 14px; font-weight: 700; }
.grit-lbl  { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; opacity: .7; margin-top: 2px; }
.grit-arrow{ display: flex; align-items: center; justify-content: center; color: var(--goldl); font-size: 16px; }

/* ── HOLE DOTS ────────────────────────────── */
.hole-dots { display: flex; gap: 8px; align-items: center; margin: 6px 0; }

.hole-dot {
  width: 14px;
  height: 14px;
  background: var(--gr1);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.hole-dot::after {
  content: '';
  position: absolute;
  top: 3.5px; left: 3.5px;
  width: 7px; height: 7px;
  background: var(--ink);
  border-radius: 50%;
}

/* ── TOOLTIP FLAUTA ───────────────────────── */
.part-tooltip {
  background: var(--bl4);
  border: 1px solid var(--bl3);
  border-radius: var(--rad);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: none;
}

.part-tooltip.visible { display: block; }
.part-tooltip-title { font-size: 12px; font-weight: 700; color: var(--bl1); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.part-tooltip-desc  { font-size: 13px; color: var(--gr1); line-height: 1.6; }

/* ── RESPONSIVE AJUSTES ──────────────────── */
@media (max-width: 480px) {
  .nav-tab { padding: 12px 11px; font-size: 10px; }
  .tab-icon { display: none; }
  .nav-brand { padding: 10px 12px; }
  .nav-brand h1 { font-size: 13px; }
}
