/* ═══════════════════════════════════════════════════════════════
   BODA APP — Tema: Papelería artesanal de boda
   Paleta: Marfil profundo · Tinta oscura · Dorado antiguo · Coral · Salvia
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ivory:    #F5EFE0;
  --ivory-dk: #EDE4CE;
  --ink:      #1C1810;
  --ink-soft: #3D3527;
  --gold:     #C9943A;
  --gold-lt:  #E8C47A;
  --coral:    #E8856A;
  --sage:     #6B7C62;
  --sage-lt:  #A3B898;
  --white:    #FDFAF4;
  --muted:    #9A8F7E;

  --radius:   12px;
  --radius-sm: 8px;
  --shadow:   0 2px 12px rgba(28,24,16,.10);
  --shadow-lg: 0 8px 32px rgba(28,24,16,.16);
  --transition: 200ms cubic-bezier(.4,0,.2,1);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--ivory);
  color: var(--ink);
  min-height: 100vh;
  /* Subtle paper texture via CSS */
  background-image:
    radial-gradient(circle at 20% 50%, rgba(201,148,58,.06) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(107,124,98,.05) 0%, transparent 50%);
}

/* ═══ HEADER ══════════════════════════════════════════════════════ */
.site-header {
  background: var(--ink);
  color: var(--ivory);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(28,24,16,.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(201,148,58,.5));
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ivory);
  letter-spacing: .01em;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: .72rem;
  color: var(--gold-lt);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Countdown widget — signature element */
.countdown-widget {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: rgba(201,148,58,.15);
  border: 1px solid rgba(201,148,58,.3);
  border-radius: 40px;
  padding: 6px 16px;
}

.countdown-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold-lt);
  line-height: 1;
}

.countdown-label {
  font-size: .7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.btn-icon {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--ivory);
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: rgba(255,255,255,.18); }

/* ═══ STATS BAR ════════════════════════════════════════════════════ */
.stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--ivory-dk);
}

.stats-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 24px;
  flex-shrink: 0;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}

.stat-label {
  font-size: .68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--ivory-dk);
  flex-shrink: 0;
}

/* Progress ring */
.progress-card { flex-direction: row; gap: 8px; align-items: center; }
.progress-ring-wrap { position: relative; width: 44px; height: 44px; }
.progress-ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.ring-bg  { fill: none; stroke: var(--ivory-dk); stroke-width: 4; }
.ring-fill { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 600; color: var(--ink-soft);
}

/* ═══ TOOLBAR ══════════════════════════════════════════════════════ */
.toolbar {
  background: var(--ivory);
  border-bottom: 1px solid var(--ivory-dk);
  position: sticky;
  top: 69px;
  z-index: 90;
}

.toolbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
  pointer-events: none;
}

.input-search {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--white);
  border: 1.5px solid var(--ivory-dk);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .875rem;
  color: var(--ink);
  transition: var(--transition);
  outline: none;
}
.input-search:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,148,58,.15); }

.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }

.select-filter {
  padding: 8px 12px;
  background: var(--white);
  border: 1.5px solid var(--ivory-dk);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .82rem;
  color: var(--ink-soft);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}
.select-filter:focus { border-color: var(--gold); }

/* ═══ BUTTONS ══════════════════════════════════════════════════════ */
.btn-primary {
  background: var(--ink);
  color: var(--ivory);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { background: var(--ink-soft); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { transform: none; }

.btn-secondary {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--ivory-dk);
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-family: var(--font-body);
  font-size: .875rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { background: var(--ivory-dk); }

/* ═══ MAIN CONTENT ═════════════════════════════════════════════════ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ═══ ITEM CARD ════════════════════════════════════════════════════ */
.item-card {
  background: var(--white);
  border: 1.5px solid var(--ivory-dk);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  animation: cardIn .25s ease both;
}

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

.item-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--gold);
  transition: var(--transition);
}

.item-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.item-card.estado-completado::before { background: var(--sage); }
.item-card.estado-en_proceso::before { background: var(--coral); }
.item-card.estado-cancelado::before  { background: var(--muted); opacity: .4; }
.item-card.estado-cancelado          { opacity: .55; }

.item-card.prioridad-alta .item-card-header::after {
  content: '🔴';
  font-size: .75rem;
  margin-left: 4px;
}

.item-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.item-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  flex: 1;
}

.item-categoria {
  font-size: .72rem;
  background: var(--ivory);
  color: var(--ink-soft);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid var(--ivory-dk);
  flex-shrink: 0;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.item-meta-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  color: var(--muted);
}

.item-descripcion {
  font-size: .82rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--ivory-dk);
}

.item-estado-badge {
  font-size: .72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-pendiente   { background: #FFF3CD; color: #8B6914; }
.badge-en_proceso  { background: #FFE8E3; color: #9C3E28; }
.badge-completado  { background: #E8F5E3; color: #3A6B2E; }
.badge-cancelado   { background: #F0F0EE; color: #7A7A7A; }

.item-coste {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
}

.item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
}
.item-card:hover .item-actions { opacity: 1; }

.action-btn {
  width: 28px; height: 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: .8rem;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  background: var(--ivory);
  color: var(--ink-soft);
}
.action-btn:hover { background: var(--ivory-dk); }
.action-btn.delete:hover { background: #FFEAEA; color: #C62828; }
.action-btn.complete:hover { background: #E8F5E3; color: #3A6B2E; }

/* ═══ EMPTY STATE ══════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; line-height: 1; }
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 24px;
}

/* ═══ MODAL ════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,24,16,.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(28,24,16,.3);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-sm { max-width: 420px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--ivory-dk);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
}

.modal-close {
  background: var(--ivory);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: .9rem;
  color: var(--muted);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--ivory-dk); color: var(--ink); }

.modal-body  { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--ivory-dk);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ═══ FORM ═════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: .78rem; font-weight: 500; color: var(--ink-soft); letter-spacing: .03em; text-transform: uppercase; }
.form-grow { flex: 1; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }

.input-field {
  padding: 9px 12px;
  background: var(--ivory);
  border: 1.5px solid var(--ivory-dk);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .875rem;
  color: var(--ink);
  outline: none;
  transition: var(--transition);
  width: 100%;
}
.input-field:focus { border-color: var(--gold); background: var(--white); box-shadow: 0 0 0 3px rgba(201,148,58,.12); }
.textarea { resize: vertical; min-height: 70px; }

/* ═══ AI SUGGESTIONS ═══════════════════════════════════════════════ */
.suggestions-section {
  background: linear-gradient(135deg, rgba(201,148,58,.05), rgba(107,124,98,.05));
  border: 1px solid rgba(201,148,58,.2);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.suggestions-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.suggestions-icon { font-size: 1rem; }
.suggestions-title { font-size: .82rem; font-weight: 600; color: var(--ink-soft); flex: 1; }

.btn-sugerencias {
  background: var(--gold);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-sugerencias:hover { background: #B07E28; }
.btn-sugerencias:disabled { opacity: .6; cursor: wait; }

.suggestions-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--white);
  border: 1px solid var(--ivory-dk);
  border-radius: 6px;
  font-size: .82rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  line-height: 1.4;
}
.suggestion-item:hover { border-color: var(--gold); background: rgba(201,148,58,.04); }
.suggestion-arrow { color: var(--gold); font-size: .8rem; flex-shrink: 0; margin-top: 1px; }

/* ═══ TOAST ════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--ivory);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  z-index: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 320px;
}
.toast.success { background: var(--sage); color: var(--white); }
.toast.error   { background: #C62828; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ═══ UTILITIES ════════════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ═══ RESPONSIVE ═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .header-inner { padding: 12px 16px; }
  .brand-title  { font-size: 1.1rem; }
  .countdown-num { font-size: 1.3rem; }
  .stats-inner  { padding: 10px 16px; }
  .stat-card    { padding: 6px 14px; }
  .toolbar-inner, .main-content { padding: 12px 16px; }
  .items-grid   { grid-template-columns: 1fr; }
  .toolbar-inner { gap: 8px; }
  .filter-group { width: 100%; }
  .select-filter { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════════════════════════════════════════════════════
   NUEVAS SECCIONES: TABS · TIMELINE · RESUMEN · HISTORIAL
   ═══════════════════════════════════════════════════════════════ */

/* ─── NAV TABS ─────────────────────────────────────────────────── */
.view-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--ivory-dk);
  position: sticky;
  top: 69px;
  z-index: 95;
}

.tabs-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 0;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn:hover  { color: var(--ink-soft); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--gold); }

/* toolbar ahora debajo de tabs */
.toolbar { top: 115px; }

/* ─── VIEW PANELS ──────────────────────────────────────────────── */
.view-panel { display: none !important; }
.view-panel.active { display: block !important; min-height: 300px; }

/* ─── SECTION TITLES ───────────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink);
  margin-bottom: 4px;
}
.section-sub {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 28px;
}
.timeline-header { margin-bottom: 0; }

/* ─── TIMELINE ─────────────────────────────────────────────────── */
#timeline-container {
  position: relative;
  padding-left: 32px;
}

/* línea vertical central */
#timeline-container::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), var(--sage-lt));
  border-radius: 2px;
}

.timeline-month {
  margin-bottom: 8px;
}

.timeline-month-label {
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--ivory);
  display: inline-block;
  padding: 2px 10px 2px 0;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.timeline-item {
  position: relative;
  background: var(--white);
  border: 1.5px solid var(--ivory-dk);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  animation: cardIn .2s ease both;
}
.timeline-item:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  transform: translateX(3px);
}

/* dot en la línea */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 18px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--gold);
}
.timeline-item.estado-completado::before { background: var(--sage); box-shadow: 0 0 0 2px var(--sage); }
.timeline-item.estado-en_proceso::before { background: var(--coral); box-shadow: 0 0 0 2px var(--coral); }
.timeline-item.estado-cancelado::before  { background: var(--muted); box-shadow: 0 0 0 2px var(--muted); opacity:.5; }

.timeline-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.timeline-item-title {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.timeline-date {
  font-size: .72rem;
  font-weight: 600;
  color: var(--white);
  background: var(--ink-soft);
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.timeline-date.vencida { background: #C62828; }
.timeline-date.hoy     { background: var(--coral); }
.timeline-date.pronto  { background: var(--gold); }

.timeline-item-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: .75rem;
  color: var(--muted);
  flex-wrap: wrap;
}

/* ─── RESUMEN ──────────────────────────────────────────────────── */
.resumen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.resumen-loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px;
  color: var(--muted);
  font-style: italic;
}

.resumen-card {
  background: var(--white);
  border: 1.5px solid var(--ivory-dk);
  border-radius: var(--radius);
  padding: 20px;
  animation: cardIn .25s ease both;
}

.resumen-card.full-width { grid-column: 1 / -1; }

.resumen-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hero días */
.resumen-hero {
  background: var(--ink);
  color: var(--ivory);
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
}
.resumen-hero::before {
  content: '💍';
  position: absolute;
  font-size: 8rem;
  opacity: .05;
  right: -10px; top: -10px;
}
.resumen-hero-dias {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  color: var(--gold-lt);
  line-height: 1;
}
.resumen-hero-label {
  font-size: .85rem;
  color: var(--muted);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-top: 4px;
}
.resumen-hero-nombres {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--ivory);
  margin-top: 8px;
}

/* Estado general */
.resumen-estados {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}
.resumen-estado-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.resumen-estado-label {
  font-size: .7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 3px;
}
.num-completado { color: var(--sage); }
.num-proceso    { color: var(--coral); }
.num-pendiente  { color: var(--gold); }

/* Progreso por categoría */
.cat-progress-item {
  margin-bottom: 10px;
}
.cat-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.cat-progress-bar-wrap {
  height: 6px;
  background: var(--ivory-dk);
  border-radius: 3px;
  overflow: hidden;
}
.cat-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--sage-lt));
  border-radius: 3px;
  transition: width .6s ease;
}

/* Próximas tareas */
.proxima-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ivory-dk);
}
.proxima-item:last-child { border-bottom: none; }
.proxima-fecha {
  font-size: .72rem;
  font-weight: 600;
  background: var(--ivory);
  border: 1px solid var(--ivory-dk);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.proxima-titulo {
  font-size: .85rem;
  color: var(--ink);
  line-height: 1.3;
}
.proxima-resp {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Presupuesto */
.presupuesto-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--ivory-dk);
  font-size: .85rem;
}
.presupuesto-row:last-child { border-bottom: none; }
.presupuesto-label { color: var(--ink-soft); }
.presupuesto-valor {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}
.presupuesto-valor.grande { font-size: 1.1rem; color: var(--gold); }

/* ─── HISTORIAL ────────────────────────────────────────────────── */
.historial-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-top: 4px;
}

.historial-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--ivory-dk);
  border-radius: var(--radius-sm);
}

.historial-entry {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ivory-dk);
  font-size: .78rem;
  line-height: 1.4;
}
.historial-entry:last-child { border-bottom: none; }
.historial-entry:nth-child(even) { background: var(--ivory); }

.historial-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  margin-top: 3px;
}

.historial-campo {
  font-weight: 600;
  color: var(--ink-soft);
  min-width: 80px;
}
.historial-cambio { color: var(--muted); flex: 1; }
.historial-fecha  { color: var(--muted); white-space: nowrap; font-size: .7rem; }

.historial-arrow { color: var(--coral); margin: 0 4px; }

/* Resumen — actividad reciente */
.actividad-item {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--ivory-dk);
  font-size: .8rem;
  align-items: flex-start;
}
.actividad-item:last-child { border-bottom: none; }
.actividad-dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.actividad-texto { flex: 1; color: var(--ink-soft); line-height: 1.4; }
.actividad-tarea { font-weight: 600; color: var(--ink); }
.actividad-hora  { color: var(--muted); font-size: .7rem; white-space: nowrap; }

/* ─── RESPONSIVE NUEVAS SECCIONES ─────────────────────────────── */
@media (max-width: 640px) {
  .tabs-inner { padding: 0 12px; overflow-x: auto; }
  .tab-btn    { padding: 12px 14px; font-size: .8rem; }
  .toolbar    { top: 105px; }
  #timeline-container { padding-left: 24px; }
  #timeline-container::before { left: 6px; }
  .timeline-item::before { left: -21px; }
  .resumen-grid { grid-template-columns: 1fr; }
  .resumen-hero-dias { font-size: 3.5rem; }
}
