/*
  La Sal Weddings — interfaz interna
  Paleta y tipografia segun LA_SAL_WEDDINGS_BRAND_REFERENCE_FOR_CLAUDE.md.
  Hueco documentado: "Gilgan Regular" (navegacion/CTA en la guia de marca) no
  esta disponible como activo tecnico (no es un Google Font publico y no se
  aporto el fichero). Se usa Inter como sustituto neutral y elegante para toda
  la interfaz de datos/navegacion, tal y como permite la propia guia para
  "contenido tecnico, tablas, formularios y datos". Cormorant Garamond se
  respeta para titulos y momentos narrativos.
  Excepcion funcional documentada: se añade un tono "danger" (terracota, fuera
  de los 6 tokens oficiales) solo para vencimientos/bloqueos, priorizando la
  legibilidad segun exige la propia guia ("accesibilidad y legibilidad por
  encima de un uso ornamental de la marca").
*/

:root {
  --salt: #F4F1EA;
  --ink: #242321;
  --clay: #8C624B;
  --sage: #B7BCA5;
  --sand: #D7C18B;
  --tide: #7E9294;
  --danger: #A8503A;
  --danger-bg: #F3E3DE;

  --paper: #FFFFFF;
  --border: rgba(36, 35, 33, 0.12);
  --border-strong: rgba(36, 35, 33, 0.24);
  --ink-soft: rgba(36, 35, 33, 0.64);
  --ink-faint: rgba(36, 35, 33, 0.4);

  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;

  --radius: 6px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--salt);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
}

#app { min-height: 100vh; display: flex; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  margin: 0 0 var(--space-2) 0;
  letter-spacing: 0.01em;
}
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

p { margin: 0 0 var(--space-2) 0; }

button {
  font-family: var(--font-sans);
  cursor: pointer;
}

/* ---------- Layout ---------- */

.sidebar {
  width: 232px;
  flex: none;
  background: var(--ink);
  color: var(--salt);
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 4px var(--space-1) 0;
}
.brand-mark {
  /* El wordmark original es tinta oscura sobre transparente; se invierte
     para leerse en claro sobre el fondo Ink de la barra lateral, tal y como
     pide la guia ("preferir Salt sobre Ink"). */
  display: block;
  height: 30px;
  width: auto;
  filter: invert(1) brightness(1.35);
  opacity: 0.96;
}
.brand small {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(244, 241, 234, 0.5);
  text-transform: uppercase;
  margin-top: 8px;
}

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(244, 241, 234, 0.45);
  padding: 0 var(--space-1);
  margin: var(--space-2) 0 4px 0;
}
.nav-link {
  padding: 9px var(--space-1);
  border-radius: var(--radius);
  color: rgba(244, 241, 234, 0.82);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.nav-link:hover { background: rgba(244, 241, 234, 0.08); color: var(--salt); }
.nav-link.active { background: var(--clay); color: var(--salt); }
.nav-badge {
  font-size: 10.5px;
  background: rgba(244, 241, 234, 0.16);
  border-radius: 20px;
  padding: 1px 7px;
}
.nav-link.active .nav-badge { background: rgba(255,255,255,0.25); }

.owner-switch {
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid rgba(244, 241, 234, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.owner-switch-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(244,241,234,0.45); }
.owner-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border: 1px solid rgba(244,241,234,0.3);
  background: transparent;
  color: rgba(244,241,234,0.85);
  border-radius: 20px;
  padding: 4px 11px;
  font-size: 12px;
}
.pill.active { background: var(--salt); color: var(--ink); border-color: var(--salt); }

.main {
  flex: 1;
  min-width: 0;
  padding: var(--space-4) var(--space-5);
}
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-3);
  gap: var(--space-3);
  flex-wrap: wrap;
}
.main-header .subtitle { color: var(--ink-soft); font-size: 13.5px; margin: 0; }

.search-box {
  border: 1px solid var(--border-strong);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 8px 12px;
  min-width: 260px;
  font-size: 13px;
}
.search-box:focus { outline: none; border-color: var(--clay); }

/* ---------- Cards / grid ---------- */

.grid { display: grid; gap: var(--space-3); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: var(--space-2);
}
.card-title .count { color: var(--ink); font-weight: 600; }

.stat { font-family: var(--font-serif); font-size: 34px; line-height: 1; }
.stat-label { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

.empty-state {
  color: var(--ink-faint);
  font-size: 13px;
  padding: var(--space-2) 0;
  font-style: italic;
}

/* ---------- Lists / rows ---------- */

.list { display: flex; flex-direction: column; gap: 1px; }
.row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.row:last-child { border-bottom: none; }
.row:hover { background: rgba(140, 98, 75, 0.05); cursor: pointer; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { color: var(--ink-soft); font-size: 12.5px; margin-top: 2px; }
.row-meta { display: flex; gap: var(--space-2); align-items: center; flex-shrink: 0; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }

.badge-tide { background: rgba(126,146,148,0.18); color: #4f6668; }
.badge-tide .badge-dot { background: var(--tide); }
.badge-sand { background: rgba(215,193,139,0.28); color: #7a6222; }
.badge-sand .badge-dot { background: var(--sand); }
.badge-clay { background: rgba(140,98,75,0.16); color: var(--clay); }
.badge-clay .badge-dot { background: var(--clay); }
.badge-sage { background: rgba(183,188,165,0.32); color: #5c6650; }
.badge-sage .badge-dot { background: var(--sage); }
.badge-ink { background: rgba(36,35,33,0.08); color: var(--ink-soft); }
.badge-ink .badge-dot { background: var(--ink-faint); }
.badge-danger { background: var(--danger-bg); color: var(--danger); animation: badge-pulse 2.6s ease-in-out infinite; }
.badge-danger .badge-dot { background: var(--danger); }

/* Respiracion lenta y suave para llamar la atencion sin resultar molesta */
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 80, 58, 0.28); }
  50% { box-shadow: 0 0 0 5px rgba(168, 80, 58, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .badge-danger { animation: none; }
}

/* Tachado "a mano" al completar una tarea: una linea que crece de
   izquierda a derecha con una ligera inclinacion, como si se hubiera
   tachado con boli sobre papel, en vez de un cambio de estado instantaneo. */
.task-title-wrap {
  position: relative;
  display: inline-block;
}
.task-title-wrap::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 52%;
  height: 2px;
  background: var(--clay);
  border-radius: 2px;
  transform: scaleX(0) rotate(-1deg);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.task-title-wrap.task-done {
  color: var(--ink-faint);
  transition: color 0.45s ease 0.15s;
}
.task-title-wrap.task-done::after {
  transform: scaleX(1) rotate(-1deg);
}

.owner-tag {
  font-size: 11px;
  color: var(--ink-soft);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 2px 8px;
}

/* ---------- Buttons ---------- */

.btn {
  border: 1px solid var(--border-strong);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--clay); border-color: var(--clay); color: var(--salt); }
.btn-primary:hover { background: #7a5340; border-color: #7a5340; }
.btn-danger { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.btn-ghost { border-color: transparent; background: transparent; padding: 8px 10px; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-row { display: flex; gap: var(--space-1); flex-wrap: wrap; align-items: center; }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: var(--space-3); flex-wrap: wrap; }
.tab {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--clay); }
.tab:hover { color: var(--ink); }
.tab, .tab-sub { cursor: pointer; }

/* Segunda fila de pestañas, mas pequeña, para las sub-secciones dentro de un
   grupo de la ficha de boda (p.ej. "Pareja y contrato" -> Pareja / Servicio /
   Contrato) -- ver public/app.js, viewWeddingDetail. */
.tabs-sub { border-bottom: none; margin-bottom: var(--space-2); gap: 6px; }
.tabs-sub:empty { margin: 0; }
.tab-sub {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(36,35,33,0.05);
  border-radius: 999px;
  border-bottom: none;
  margin-bottom: 0;
}
.tab-sub.active { color: var(--salt, #fff); background: var(--clay); }
.tab-sub:hover { color: var(--ink); }
.tab-sub.active:hover { color: var(--salt, #fff); }

/* ---------- Forms ---------- */

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2) var(--space-3); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.field-hint { font-size: 11px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  background: var(--paper);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--clay); }
.field textarea { resize: vertical; min-height: 64px; }
.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.fieldset legend {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 0 6px;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(36,35,33,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: var(--space-5) var(--space-3);
  overflow-y: auto;
  z-index: 50;
}
.modal {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  width: 100%;
  max-width: 640px;
  box-shadow: 0 20px 60px rgba(36,35,33,0.25);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }

/* ---------- Kanban (pipeline) ---------- */

.kanban-wrap { position: relative; }
.kanban-wrap::after {
  /* Pista visual de que hay mas columnas fuera de pantalla (desaparece al
     llegar al final gracias a la clase has-more-right, ver wireKanbanScrollHint). */
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: var(--space-2); width: 56px;
  background: linear-gradient(to right, rgba(244,241,234,0), var(--salt));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.kanban-wrap.has-more-right::after { opacity: 1; }
.kanban { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); scrollbar-width: thin; }
.kanban-col { flex: 0 0 240px; background: rgba(36,35,33,0.03); border-radius: var(--radius-lg); padding: var(--space-2); }
.kanban-col-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: var(--space-2); display: flex; justify-content: space-between; }
.kanban-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
}
.kanban-card:hover { border-color: var(--clay); cursor: pointer; }
.kanban-card .name { font-weight: 600; margin-bottom: 3px; }
.kanban-card .meta { color: var(--ink-soft); font-size: 11.5px; }

/* ---------- Wedding detail sections ---------- */

.section-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: var(--space-3); }
.section-block { margin-bottom: var(--space-4); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; }

.link-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); border-radius: 20px;
  padding: 4px 10px; font-size: 12px; margin: 2px 4px 2px 0;
}
.link-chip.empty { color: var(--ink-faint); border-style: dashed; }

.progress-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.progress-check .dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--border-strong); }
.progress-check.done .dot { background: var(--sage); border-color: var(--sage); }

.risk-normal { color: var(--ink-soft); }
.risk-atencion { color: var(--danger); font-weight: 600; }

.capacity-bar { height: 8px; border-radius: 4px; background: rgba(36,35,33,0.08); overflow: hidden; margin-top: 6px; }
.capacity-fill { height: 100%; background: var(--clay); }

.finance-chart { display: flex; flex-direction: column; gap: 14px; }
.finance-row { display: grid; grid-template-columns: 140px 1fr 90px; gap: 12px; align-items: center; }
.finance-label { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-bars { display: flex; flex-direction: column; gap: 4px; }
.finance-bar-track { position: relative; height: 16px; background: rgba(36,35,33,0.05); border-radius: 4px; overflow: hidden; }
.finance-bar { height: 100%; border-radius: 4px; }
.finance-bar.income { background: var(--sage); }
.finance-bar.expense { background: var(--sand); }
.finance-bar-value { position: absolute; left: 8px; top: 0; line-height: 16px; font-size: 10.5px; color: var(--ink); mix-blend-mode: multiply; }
.finance-profit { font-size: 13px; font-weight: 600; text-align: right; }
.finance-legend { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-2); font-size: 11.5px; color: var(--ink-soft); }
.finance-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.finance-swatch.income { background: var(--sage); }
.finance-swatch.expense { background: var(--sand); }

@media (max-width: 880px) {
  .finance-row { grid-template-columns: 1fr; gap: 4px; }
  .finance-profit { text-align: left; }
}

.moodboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.moodboard-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(36,35,33,0.04);
}
.moodboard-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.moodboard-remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(36,35,33,0.65); color: var(--salt);
  border: none; font-size: 12px; line-height: 1;
  cursor: pointer;
}
.moodboard-remove:hover { background: var(--danger); }

/* Moodboard "tipo Milanote": tablero libre de fotos y notas, arrastrable
   y redimensionable, en vez del grid fijo de antes. Fondo con textura suave
   de corcho/papel (solo gradientes CSS, sin imagenes) para que se sienta
   mas "tablero fisico" que una cuadricula digital plana. */
.moodboard-board {
  position: relative;
  margin-top: 10px;
  border: 1px solid rgba(140,98,75,0.25);
  border-radius: var(--radius);
  background-color: #ddc8a8;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.35) 1px, transparent 1.4px),
    radial-gradient(circle, rgba(36,35,33,0.12) 1px, transparent 1.4px),
    linear-gradient(135deg, rgba(140,98,75,0.10) 0%, transparent 40%, rgba(140,98,75,0.08) 100%);
  background-position: 0 0, 11px 13px, 0 0;
  background-size: 22px 22px, 26px 26px, 100% 100%;
  box-shadow: inset 0 0 40px rgba(36,35,33,0.12);
  overflow: auto;
}
.board-item {
  position: absolute;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 3px 10px rgba(0,0,0,0.16);
  background: var(--salt, #fff);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.board-item.board-image { transform: rotate(-0.6deg); }
/* Washi tape: 4 tonos suaves que rotan por nota (fijo segun su id, ver
   washiIndex en app.js/portal.html) en vez del amarillo unico de antes. */
.board-item.board-note { background: #fff4c2; box-shadow: 0 3px 10px rgba(0,0,0,0.14), inset 0 0 0 1px rgba(36,35,33,0.05); }
.board-item.board-note.washi-0 { background: #fff4c2; }
.board-item.board-note.washi-1 { background: #ffd9c2; }
.board-item.board-note.washi-2 { background: #d8e8d6; }
.board-item.board-note.washi-3 { background: #dce4f0; }
.board-item-drag {
  height: 16px;
  flex: none;
  cursor: move;
  background: rgba(36,35,33,0.06);
}
.board-note .board-item-drag { background: rgba(36,35,33,0.08); }
/* Trocito de "cinta" pegado arriba, como si la nota estuviera fijada a mano */
.board-note::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 46px;
  height: 16px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.7);
  z-index: 3;
  pointer-events: none;
}
.board-item-remove {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(36,35,33,0.65); color: var(--salt, #fff);
  border: none; font-size: 11px; line-height: 1;
  cursor: pointer; z-index: 2;
}
.board-item-remove:hover { background: var(--danger); }
.board-image img { width: 100%; flex: 1 1 auto; object-fit: cover; display: block; min-height: 0; }
.board-caption {
  flex: none; width: 100%; border: none; border-top: 1px solid var(--border);
  padding: 4px 6px; font-size: 12px; background: transparent;
}
.board-note-text {
  flex: 1 1 auto; width: 100%; border: none; resize: none;
  background: transparent; padding: 6px 8px; font-size: 13px; font-family: inherit;
}
.board-item-resize {
  position: absolute; right: 0; bottom: 0;
  width: 16px; height: 16px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(36,35,33,0.35) 50%);
}

/* Modo presentacion del moodboard: el card ocupa toda la pantalla
   (Fullscreen API nativa) para ensenarselo a la pareja sin distracciones. */
#moodboard-card:fullscreen {
  background: var(--salt);
  padding: 24px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
#moodboard-card:fullscreen .moodboard-board {
  flex: 1 1 auto;
  min-height: 0 !important;
}
#moodboard-card:fullscreen #moodboard-fullscreen-btn::after { content: " (Esc para salir)"; }

/* Vista "carrete": bodas de un año en fila horizontal, con portada tipo
   negativo de foto -- alternativa mas visual al listado/kanban. */
.filmstrip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  margin-top: 8px;
  scroll-snap-type: x proximity;
}
.film-frame {
  flex: none;
  width: 150px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--ink);
  box-shadow: 0 3px 10px rgba(0,0,0,0.14);
  transition: transform 0.18s ease;
}
.film-frame:hover { transform: translateY(-3px); }
.film-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--ink);
  overflow: hidden;
}
.film-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.film-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--salt);
}
.film-cover-0 { background: var(--clay); }
.film-cover-1 { background: #8a6b46; }
.film-cover-2 { background: #5c6650; }
.film-cover-3 { background: #4f6668; }
.film-caption { padding: 8px 10px 10px; background: var(--ink); }
.film-name { font-size: 12.5px; font-weight: 600; color: var(--salt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.film-date { font-size: 11px; color: rgba(244,241,234,0.6); margin-top: 2px; }

/* "Año en fotos": tarjeta pensada para hacer captura de pantalla y
   compartir, no solo para lectura interna -- por eso mas grande y con
   mas presencia de marca que un card normal. */
.recap-poster {
  background: linear-gradient(160deg, var(--ink) 0%, #33302c 100%);
  color: var(--salt);
  border-radius: var(--radius);
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.recap-year { font-size: 52px; font-weight: 700; letter-spacing: 0.02em; line-height: 1; }
.recap-tagline { font-size: 13px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--sand); margin-top: 6px; }
.recap-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 28px;
  margin: 28px 0 18px;
}
.recap-stat { min-width: 90px; }
.recap-num { font-size: 30px; font-weight: 700; color: var(--sand); }
.recap-label { font-size: 12px; color: rgba(244,241,234,0.7); margin-top: 2px; }
.recap-services { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.recap-countries { font-size: 13px; color: rgba(244,241,234,0.75); margin-bottom: 6px; }
.recap-quote {
  max-width: 480px; margin: 18px auto 0; font-size: 14px; font-style: italic;
  color: rgba(244,241,234,0.9); line-height: 1.5;
}
.recap-quote-from { font-size: 11.5px; font-style: normal; color: rgba(244,241,234,0.55); margin-top: 6px; }
@media (max-width: 640px) {
  .recap-poster { padding: 24px 18px; }
  .recap-year { font-size: 40px; }
  .recap-stats { gap: 18px; }
}

/* Checklist de fases de produccion: linea vertical tipo "carrete de
   pelicula" conectando cada fase, con un punto que se puede pulsar para
   avanzar el estado (pendiente -> en curso -> hecho). */
.phase-timeline {
  position: relative;
  margin-top: 12px;
  padding-left: 6px;
}
.phase-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 0 0 22px 0;
}
.phase-item:last-child { padding-bottom: 0; }
.phase-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: -4px;
  width: 2px;
  background: var(--border);
}
.phase-item:last-child::before { display: none; }
.phase-dot {
  flex: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  margin-top: 2px;
  border: 2px solid var(--ink-faint);
  background: var(--salt);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  z-index: 1;
}
.phase-dot:hover { transform: scale(1.15); }
.phase-item.phase-en_curso .phase-dot { border-color: var(--clay); background: var(--clay); }
.phase-item.phase-hecho .phase-dot { border-color: var(--sage); background: var(--sage); }
.phase-item.phase-hecho .phase-label { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--sage); }
.phase-body { flex: 1 1 auto; }
.phase-label { font-size: 14px; font-weight: 600; }
.phase-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.phase-date { border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; font-size: 12.5px; font-family: inherit; background: transparent; }
.phase-extra { font-size: 12px; color: var(--ink-faint); }

.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--ink); color: var(--salt);
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 100;
}
.toast.error { background: var(--danger); }

/* ---------- Calendario: vista de rejilla mensual ---------- */

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-grid-header {
  margin-bottom: 4px;
}
.cal-weekday {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-faint); text-align: center; padding: 4px 0;
}
.cal-day {
  min-height: 76px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--paper); padding: 6px; overflow: hidden;
}
.cal-day-empty { background: transparent; border-color: transparent; }
.cal-day-today { border-color: var(--clay); border-width: 2px; }
.cal-day-num { font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }
.cal-ev {
  font-size: 11px; padding: 2px 5px; border-radius: 4px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cal-ev-boda { background: var(--clay); color: var(--salt); }
.cal-ev-reunion { background: var(--tide); color: var(--salt); }
.cal-ev-aniv { background: var(--sand); color: var(--ink); }
.cal-ev-more { font-size: 10px; color: var(--ink-faint); }

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .cal-day { min-height: 56px; }
  .cal-ev { font-size: 10px; }
  #app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { flex: 0 0 100%; margin-bottom: 6px; }
  .brand-mark { height: 24px; }
  .nav-group { flex-direction: row; flex-wrap: wrap; }
  .nav-label { flex-basis: 100%; margin: 6px 0 2px; }
  .owner-switch { flex: 0 0 100%; margin-top: 6px; border-top: 1px solid rgba(244, 241, 234, 0.14); padding-top: var(--space-2); }
  .main { padding: var(--space-3); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 130px 1fr; }
  .main-header { flex-direction: column; align-items: stretch; }
  .search-box { min-width: 0; width: 100%; }
  .modal-overlay { padding: var(--space-2); align-items: flex-start; }
  .modal { padding: var(--space-3); max-height: calc(100vh - 32px); overflow-y: auto; }
}
