/* Panel de Doris · Protege a tu Familia — tokens del Panel de Doris en vivo */
:root {
  --navy: #0f2040;
  --navy-2: #16294d;
  --gold: #c5a880;
  --gold-soft: #e8d9b8;
  --tomato: #d64533;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface2: #efeae0;
  --ink: #16233b;
  --muted: #6b7280;
  --line: #e3ddd0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 32, 64, 0.10);
  --green: #1e7d46;
  --amber-bg: #fff7d6;
  --amber-border: #e8cf7a;
  --stone: #8a8a8a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Libre Franklin", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
h1, h2, h3, .serif { font-family: "Libre Franklin", Georgia, serif; font-weight: 700; }
a { color: var(--navy-2); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 48px; }

/* ── Cabecera fija ── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--navy); color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.logo-badge {
  background: #fff; border-radius: 50%; padding: 2px;
  width: 46px; height: 46px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--gold);
}
.logo-badge img { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; display: block; }
.topbar .eyebrow { color: var(--gold); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; }
.topbar h1 { font-size: 1.25rem; margin: 0; letter-spacing: 0.01em; }
.topbar .date { margin-left: auto; font-size: 0.88rem; color: #dbe2f0; }
.nav-pills { display: flex; gap: 6px; }
.nav-pills button {
  border: none; border-radius: 999px; padding: 7px 14px; font-size: 0.9rem; font-weight: 700;
  background: rgba(255, 255, 255, 0.10); color: #fff;
}
.nav-pills button.active { background: var(--gold); color: var(--navy); }

/* ── Banner ── */
.banner {
  display: block; width: 100%; border-radius: 18px; margin-top: 16px;
  border: 1px solid rgba(197, 168, 128, 0.4);
}

/* ── Franja de estado ── */
.status-strip {
  margin-top: 16px; border-radius: var(--radius);
  padding: 12px 16px; font-size: 0.95rem;
  display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap;
}
.status-strip.ok { background: #e7f6ec; border: 1px solid #bfe6c8; color: #14532a; }
.status-strip.warn { background: var(--amber-bg); border: 1px solid var(--amber-border); color: #5c4a00; }
.status-strip strong { font-weight: 700; }
.status-strip .spacer { flex: 1; }
.btn-link { background: none; border: none; color: var(--navy-2); text-decoration: underline; font-size: 0.95rem; padding: 0; }

/* ── Saludo y estadísticas ── */
.hero { margin: 22px 0 18px; }
.hero h2 { font-size: 1.9rem; margin: 0 0 4px; }
.hero p { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .num { font-size: 1.7rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.stat .sub2 { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }

/* ── Botón dorado grande ── */
.btn-gold-wide {
  width: 100%; height: 52px; border: none; border-radius: 12px;
  background: var(--gold); color: var(--navy); font-size: 1.05rem; font-weight: 800;
  margin: 4px 0 18px;
}
.btn-gold-wide:hover { background: #d3b98d; }

/* ── Tarjetas y rejilla ── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.card h3 { margin: 0 0 12px; font-size: 1.25rem; color: var(--navy); }
.card h3 .hint { font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.mt { margin-top: 16px; }

/* ── Calendario ── */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-head h3 { margin: 0; flex: 1; text-transform: capitalize; }
.cal-head .sync-note-line { font-size: 0.82rem; color: var(--muted); width: 100%; }
.cal-nav {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 7px 12px; font-size: 0.95rem; color: var(--navy);
}
.cal-nav:hover { background: #eef2f8; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.78rem; font-weight: 700; color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.cal-day {
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  min-height: 78px; padding: 5px 6px; text-align: left; vertical-align: top;
  display: flex; flex-direction: column; gap: 2px; overflow: hidden;
}
.cal-day:hover { border-color: var(--navy-2); }
.cal-day.other { opacity: 0.38; }
.cal-day.today .dnum {
  background: var(--navy); color: #fff; border-radius: 50%;
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
}
.cal-day.selected { background: #e8eefb; border-color: var(--navy-2); }
.cal-day .dnum { font-weight: 700; font-size: 0.9rem; color: var(--navy); }
.cal-ev {
  font-size: 0.72rem; line-height: 1.25; border-radius: 5px; padding: 2px 4px;
  white-space: normal; overflow-wrap: anywhere; display: block;
}
.cal-ev.mine { background: #f6ecd0; color: #6b5410; }
.cal-ev.panel { background: #e2e8f5; color: var(--navy); }
.cal-ev.occ { background: #ececec; color: #555; }
.cal-ev.more { background: none; color: var(--muted); font-weight: 700; padding: 0 4px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 0.85rem; color: var(--muted); }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .sw.gold { background: var(--gold); }
.legend .sw.navy { background: var(--navy); }
.legend .sw.stone { background: var(--stone); }

/* ── Detalle del día y próximas ── */
.day-item { border-bottom: 1px solid var(--line); padding: 9px 0; }
.day-item:last-child { border-bottom: none; }
.day-item .t { font-weight: 700; color: var(--navy); }
.day-item .o { font-size: 0.85rem; color: var(--muted); }
.day-item .tag-mine { color: #8a6d1b; font-weight: 700; }
.day-item .tag-panel { color: var(--navy); font-weight: 700; }
.mini-link { background: none; border: none; color: var(--navy-2); text-decoration: underline; font-size: 0.85rem; padding: 0; margin-top: 2px; }

/* ── Pasos de conexión ── */
.step { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.step:last-child { border-bottom: none; }
.step .n {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
}
.step.done .n { background: var(--green); }
.step .b { font-weight: 700; }
.step .d { font-size: 0.88rem; color: var(--muted); }
.badge {
  display: inline-block; font-size: 0.75rem; font-weight: 700; border-radius: 999px;
  padding: 2px 9px; margin-left: 6px; vertical-align: 1px; white-space: nowrap;
}
.badge.ok { background: #e7f6ec; color: var(--green); }
.badge.pend { background: var(--amber-bg); color: #6b5410; }
.badge.err { background: #fbe3de; color: #8f2415; }
.badge.navy { background: #e2e8f5; color: var(--navy); }

/* ── Formulario ── */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field.two { grid-column: span 2; }
.field label { font-weight: 700; font-size: 0.92rem; color: var(--navy); }
.field label .req { color: var(--tomato); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  background: #fff; color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--navy-2); outline-offset: 1px; border-color: var(--navy-2);
}
.field textarea { min-height: 74px; resize: vertical; }
.field .help { font-size: 0.82rem; color: var(--muted); }
.florida-box {
  grid-column: 1 / -1; background: #eef3fb; border: 1px solid #c8d6ee;
  border-radius: 10px; padding: 12px 14px; font-size: 0.95rem; display: none;
}
.florida-box.show { display: block; }
.florida-box strong { color: var(--navy); }
.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn {
  border: none; border-radius: 10px; padding: 11px 22px; font-size: 1rem; font-weight: 700;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--navy); }
.btn-danger { background: #fff; border: 1px solid var(--tomato); color: var(--tomato); }
.btn-small { padding: 7px 13px; font-size: 0.9rem; border-radius: 8px; }

/* ── Mis citas ── */
.appt {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
  background: #fff;
}
.appt.cancelled { opacity: 0.62; }
.appt h4 { font-size: 1.15rem; margin: 0 0 6px; color: var(--navy); }
.appt .meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 14px; font-size: 0.9rem; }
.appt .meta b { color: var(--navy); font-weight: 700; }
.appt .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.appt .actions a.btn-small { text-decoration: none; display: inline-block; }
.move-form { display: none; margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.move-form.open { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.move-form .form-actions { grid-column: 1 / -1; margin-top: 4px; }
.sync-note { font-size: 0.82rem; margin-top: 8px; }
.sync-note.ok { color: var(--green); }
.sync-note.err { color: var(--tomato); }
.empty { color: var(--muted); padding: 10px 0; }
.subhead { font-size: 1.05rem; color: var(--navy); margin: 14px 0 8px; }
.subhead:first-child { margin-top: 0; }

/* ── Toast / bloqueo ── */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); z-index: 50; display: none; max-width: 92vw;
  font-size: 0.95rem;
}
.toast.show { display: block; }
.toast.err { background: var(--tomato); }
.lock {
  position: fixed; inset: 0; background: var(--navy); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.lock.show { display: flex; }
.lock-card {
  background: #fff; border-radius: 16px; padding: 28px; max-width: 380px; width: 100%;
  text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.lock-card img { width: 84px; height: 84px; object-fit: cover; border-radius: 14px; }
.lock-card h2 { margin: 12px 0 4px; }
.lock-card p { color: var(--muted); margin: 0 0 16px; }
.lock-card input {
  width: 100%; text-align: center; font-size: 1.4rem; letter-spacing: 0.4em;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px;
}
.lock-card .btn { width: 100%; margin-top: 12px; }
.lock-card .err-msg { color: var(--tomato); font-size: 0.9rem; min-height: 1.2em; margin-top: 8px; }

footer { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 28px; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .cal-day { min-height: 64px; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .field.two { grid-column: span 1; }
  .stats { grid-template-columns: 1fr; }
  .appt .meta { grid-template-columns: 1fr; }
  .move-form.open { grid-template-columns: 1fr; }
  .cal-day { min-height: 56px; padding: 4px; }
  .cal-ev { font-size: 0.68rem; }
  .topbar h1 { font-size: 1.1rem; }
  .topbar .date { display: none; }
  .hero h2 { font-size: 1.55rem; }
}
