/* ═══════════════════════════════════════════════════════════
   ALVATOWASH · components.css
   Campos, botones, cards, tablas, badges, modales, formularios
   ═══════════════════════════════════════════════════════════ */

/* ─── Campos de formulario ─── */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11px; font-weight: 700; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px;
  background: var(--bg-soft); border: 1px solid var(--hair);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color .15s, background .15s; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); background: white;
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* ─── Botones ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; }
.btn-primary  { background: var(--accent); color: white; }
.btn-primary:hover  { background: var(--accent-dk); }
.btn-primary:active { transform: scale(.98); }
.btn-secondary { background: var(--bg-soft); color: var(--ink); border: 1px solid var(--hair); }
.btn-secondary:hover { background: var(--hair); }
.btn-ghost    { background: transparent; color: var(--ink-3); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn-danger   { background: var(--accent-soft); color: var(--accent); }
.btn-danger:hover { background: var(--accent-mid); }
.btn-green    { background: var(--green-soft); color: var(--green); }
.btn-green:hover { background: var(--green-mid); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: var(--radius); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; transform: none !important; }

/* ─── Card base ─── */
.card {
  background: var(--card); border-radius: var(--radius);
  border: .5px solid var(--hair); box-shadow: var(--shadow-card);
}
.card-pad  { padding: 18px; }
.card-pad-lg { padding: 22px 24px; }

/* ─── Stat cards (KPI) ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card  { padding: 16px 18px; }
.stat-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.8px; line-height: 1; margin-bottom: 4px; }
.stat-meta  { font-size: 12px; color: var(--muted); }
.stat-up    { color: var(--green); }
.stat-down  { color: var(--accent); }

/* ─── Tabla ─── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: .5px solid var(--hair); box-shadow: var(--shadow-card); }
table { width: 100%; border-collapse: collapse; background: white; }
thead th {
  padding: 11px 14px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--bg-soft); border-bottom: 1px solid var(--hair);
  white-space: nowrap;
}
tbody td { padding: 13px 14px; border-bottom: .5px solid var(--hair-2); font-size: 13.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-soft); }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.badge-green  { background: var(--green-soft);  color: var(--green); }
.badge-red    { background: var(--accent-soft);  color: var(--accent); }
.badge-orange { background: var(--orange-soft);  color: var(--orange); }
.badge-blue   { background: var(--blue-soft);    color: var(--blue); }
.badge-purple { background: var(--purple-soft);  color: var(--purple); }
.badge-gold   { background: var(--gold-soft);    color: var(--gold); }
.badge-gray   { background: var(--bg-soft);      color: var(--muted); }

/* ─── Progress bar ─── */
.progress-bar { height: 6px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.progress-fill.green  { background: var(--green); }
.progress-fill.red    { background: var(--accent); }
.progress-fill.orange { background: var(--orange); }
.progress-fill.blue   { background: var(--blue); }

/* ─── Avatar ─── */
.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0; background: var(--accent-soft); color: var(--accent);
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; border-radius: 9px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; border-radius: 11px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; border-radius: 14px; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 100; display: none; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px); padding: 0;
}
.modal-overlay.show { display: flex; }
.modal {
  background: white; border-radius: 24px 24px 0 0;
  width: 100%; max-width: 560px; max-height: 90dvh;
  overflow-y: auto; padding: 20px 24px 40px;
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .modal { border-radius: 20px; max-height: 85dvh; }
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-handle { width: 36px; height: 4px; background: var(--hair); border-radius: 99px; margin: 0 auto 20px; }
.modal-title { font-size: 19px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 18px; }
.modal-footer { display: flex; gap: 10px; margin-top: 20px; }
.modal-footer .btn { flex: 1; }

/* ─── Checklist item ─── */
.check-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: .5px solid var(--hair); background: white; margin-bottom: 6px;
  cursor: pointer; transition: all .15s;
}
.check-item:hover { background: var(--bg-soft); }
.check-item.checked { background: var(--green-soft); border-color: rgba(26,127,55,.2); }
.check-circle {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--hair);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  margin-top: 1px; transition: all .15s;
}
.check-item.checked .check-circle {
  background: var(--green); border-color: var(--green);
}
.check-circle svg { width: 10px; height: 10px; fill: none; stroke: white; stroke-width: 2.5; opacity: 0; }
.check-item.checked .check-circle svg { opacity: 1; }
.check-text { flex: 1; font-size: 13.5px; font-weight: 500; line-height: 1.4; }
.check-sub  { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ─── Rating stars ─── */
.rating { display: flex; gap: 4px; }
.rating-star {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--hair);
  background: var(--bg-soft); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all .1s;
}
.rating-star.on { background: var(--gold-soft); border-color: var(--gold); }
.rating-star:hover { transform: scale(1.1); }

/* ─── Empty state ─── */
.empty {
  text-align: center; padding: 60px 24px;
  color: var(--muted);
}
.empty-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.empty-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.empty h3 { font-size: 16px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.empty p  { font-size: 13px; max-width: 260px; margin: 0 auto 16px; }

/* ─── Divider ─── */
.divider { height: 1px; background: var(--hair); margin: 16px 0; }

/* ─── Pill tabs ─── */
.pill-tabs { display: flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 11px; margin-bottom: 18px; }
.pill-tab {
  flex: 1; padding: 8px 12px; border-radius: 8px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s;
}
.pill-tab.active { background: white; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ─── Score gauge ─── */
.score-circle {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: conic-gradient(var(--green) 0%, var(--bg-soft) 0%);
  position: relative; flex-shrink: 0;
}
.score-inner {
  width: 52px; height: 52px; border-radius: 50%; background: white;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; position: absolute;
}
.score-num  { font-size: 16px; font-weight: 800; letter-spacing: -.5px; }
.score-max  { font-size: 9px; color: var(--muted); font-weight: 600; }

/* ─── Nota / comentario card ─── */
.nota-card {
  padding: 13px 15px; background: white;
  border-radius: var(--radius-sm); border: .5px solid var(--hair);
  box-shadow: var(--shadow-card); margin-bottom: 8px;
}
.nota-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.nota-date { font-size: 11px; color: var(--muted); margin-left: auto; }
.nota-text { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.nota-tag  { font-size: 10.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 99px; }
