:root {
  --bg: #07140e;
  --bg-2: #10261b;
  --card: #12291d;
  --gold: #e4c36a;
  --gold-2: #b8893e;
  --cream: #f7f1e4;
  --muted: #b7c3b4;
  --line: rgba(228, 195, 106, 0.38);
  --danger: #ffb4b4;
  --ok: #b7e4c7;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--cream);
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(228, 195, 106, 0.16), transparent 55%),
    linear-gradient(180deg, #0c2218 0%, var(--bg) 42%, #06110c 100%);
}
img { max-width: 100%; }
a { color: var(--gold); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }

.wrap {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(7, 20, 14, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.brand-name {
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1;
}
.brand-name small {
  display: block;
  margin-top: 3px;
  font-family: var(--font);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--gold);
}
.top-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.top-links a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 6px 8px;
}

.hero { text-align: center; padding: 8px 0 18px; }
.logo-frame {
  width: min(100%, 520px);
  margin: 0 auto 16px;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #0d2218;
  box-shadow: var(--shadow);
}
.logo-frame img { display: block; width: 100%; border-radius: 14px; }
.tagline {
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-top: 8px;
}
.hero h1 { font-size: clamp(2.4rem, 8vw, 4rem); line-height: 0.95; }
.call-row, .row { display: flex; flex-wrap: wrap; gap: 10px; }
.call-row { justify-content: center; margin-top: 16px; }

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f0d48a, var(--gold-2));
  color: #1a1408;
  font-weight: 700;
}
.btn.ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--line);
}
.btn.danger { background: transparent; color: var(--danger); border: 1px solid rgba(255, 180, 180, 0.4); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 0.92rem; }
.btn:active { transform: translateY(1px); }

.section { margin-top: 28px; }
.section h2 { font-size: 2.1rem; margin-bottom: 6px; }
.lede { color: var(--muted); margin-bottom: 14px; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%), var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card, .stack > * + * { margin-top: 12px; }

.service {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: start;
}
.service p { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }
.price { color: var(--gold); font-weight: 700; white-space: nowrap; }

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gallery figure {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0c1c14;
}
.gallery img { display: block; width: 100%; height: 180px; object-fit: cover; }
.gallery figcaption { padding: 8px 10px; color: var(--muted); font-size: 0.85rem; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 22px 12px;
}

label { display: block; font-size: 0.82rem; color: var(--gold); margin-bottom: 6px; }
input, textarea, select {
  width: 100%;
  background: #0b1c14;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
textarea { min-height: 90px; resize: vertical; }
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(228, 195, 106, 0.2);
  margin-bottom: 8px;
}
.check input { width: auto; margin: 3px 0 0; }
.check b { display: block; }
.check span { color: var(--muted); font-size: 0.88rem; }
.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.3rem;
  margin: 8px 0 14px;
}
.total strong { font-family: var(--display); font-size: 2rem; color: var(--gold); }

.contact-list { display: grid; gap: 10px; }
.contact-list a {
  display: block;
  text-decoration: none;
  color: var(--cream);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}
.contact-list small { display: block; color: var(--gold); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; }

.foot {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.err { color: var(--danger); min-height: 1.2em; }
.ok { color: var(--ok); }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.tabs button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
}
.tabs button.is-on { background: var(--gold); color: #1a1408; border-color: var(--gold); font-weight: 700; }
.screen { display: none; }
.screen.is-on { display: block; }
.client-card h3 { font-size: 1.5rem; }
.meta { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: #0d2218; }
.stat b { display: block; font-family: var(--display); font-size: 1.8rem; color: var(--gold); }
.photo-admin { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-admin img { width: 100%; height: 120px; object-fit: cover; border-radius: 12px; }

@media (max-width: 640px) {
  .top-links { display: none; }
  .gallery img { height: 140px; }
}

.route-grid { display: grid; gap: 12px; }
.day-pills, .filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pill {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}
.pill.is-on { background: var(--gold); color: #1a1408; border-color: var(--gold); font-weight: 700; }
.inv-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-right: 6px;
  margin-top: 4px;
}
.badge.bad { color: var(--danger); border-color: rgba(255,180,180,0.45); }
.badge.ok { color: var(--ok); border-color: rgba(183,228,199,0.45); }
.stat-grid { grid-template-columns: 1fr 1fr; }
@media (min-width: 520px) {
  .stat-grid { grid-template-columns: 1fr 1fr 1fr; }
  .route-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* v3: idioma, videos, cotización */
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch button { background: transparent; color: var(--muted); border: 0; padding: 6px 10px; font: inherit; font-size: 0.8rem; cursor: pointer; }
.lang-switch button.is-on { background: var(--gold); color: #1a1408; font-weight: 700; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.video-grid:empty { display: none; }
.video-card { margin: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #0d2218; }
.video-card video { display: block; width: 100%; max-height: 70vh; aspect-ratio: 9 / 16; object-fit: cover; background: #000; }
.video-card figcaption { padding: 8px 10px; color: var(--muted); font-size: 0.85rem; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.btn.wide { width: 100%; justify-content: center; margin-top: 12px; }
.btn.wa { background: #25d366; color: #062611; border-color: #25d366; }
.field-title { margin: 14px 0 6px; font-weight: 600; }
.ok-box { margin-top: 12px; }
.progress { width: 100%; height: 10px; border-radius: 999px; background: #0d2218; border: 1px solid var(--line); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.video-admin { display: grid; grid-template-columns: 1fr; gap: 12px; }
.video-admin video { width: 100%; max-height: 50vh; border-radius: 12px; background: #000; }
.notify { font-size: 0.85rem; }
@media (max-width: 640px) {
  .top-links { display: flex; }
  .top-links a { display: none; }
}

/* v4: calendario, pausa, Corte 3, idioma admin */
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; max-width: min(92vw, 520px); background: var(--gold); color: #1a1408; padding: 12px 16px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.cal-head h3 { font-size: 1.6rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.72rem; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 0; }
.cal-day { min-height: 58px; border: 1px solid rgba(228,195,106,0.2); border-radius: 10px; background: #0b1c14; color: var(--cream); padding: 4px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit; }
.cal-day.out { opacity: 0.35; }
.cal-day.today { border-color: var(--gold); }
.cal-day.sel { background: #1b3a29; border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.cal-day b { font-size: 0.95rem; }
.cal-day i { font-style: normal; font-size: 0.7rem; border-radius: 999px; padding: 0 5px; align-self: flex-start; }
.cal-day i.a { background: var(--gold); color: #1a1408; font-weight: 700; }
.cal-day i.r { border: 1px solid var(--line); color: var(--muted); }
.badge.paused { color: #ffd59a; border-color: rgba(255,213,154,0.55); }
.client-card.is-paused { opacity: 0.7; border-style: dashed; }
.appt-card.is-done { opacity: 0.6; }
.appt-card.is-done h3 { text-decoration: line-through; }
.daily-job-row.is-done { opacity: 0.65; }
.daily-job-row.is-done h3 { text-decoration: line-through; }
.daily-job-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.daily-job-time { font-weight: 600; color: var(--gold); }
details.card summary { cursor: pointer; color: var(--gold); font-weight: 600; }
details.card[open] summary { margin-bottom: 10px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.sync-dot { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 420px) { .cal-day { min-height: 50px; } .two-col { grid-template-columns: 1fr; } }

/* ───── Print / preview ───── */
#printArea { display: none; }
#printPreview { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.55); overflow: auto; padding: 12px; }
#printPreview .pv-bar { display: flex; gap: 8px; flex-wrap: wrap; max-width: 820px; margin: 0 auto 8px; }
#printPreview .pv-page { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 24px; border-radius: 8px; }
.share-text { white-space: pre-wrap; font-size: 13px; background: #f4f4f4; padding: 10px; border-radius: 6px; color: #111; }
.ph-page { font-family: Arial, Helvetica, sans-serif; color: #111; font-size: 13px; }
.ph-head { display: flex; gap: 14px; align-items: flex-start; border-bottom: 2px solid #1f7a3a; padding-bottom: 10px; margin-bottom: 14px; }
.ph-logo { width: 70px; height: 70px; object-fit: contain; }
.ph-biz { flex: 1; line-height: 1.4; }
.ph-title { text-align: right; }
.ph-title h1 { margin: 0 0 4px; font-size: 22px; color: #1f7a3a; }
.ph-label { font-size: 11px; text-transform: uppercase; color: #555; }
.ph-to { margin-bottom: 14px; line-height: 1.4; }
.ph-table, .ph-sum, .ph-kv { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
.ph-table th, .ph-table td, .ph-kv th, .ph-kv td { border-bottom: 1px solid #ddd; padding: 6px 4px; text-align: left; vertical-align: top; }
.ph-table thead th { background: #eef5ef; }
.ph-table tfoot th { border-top: 2px solid #111; }
.ph-sum { width: 50%; margin-left: auto; }
.ph-sum td, .ph-sum th { padding: 4px; }
.num { text-align: right !important; white-space: nowrap; }
.ph-box { width: 24px; font-size: 16px; }
.ph-h2 { font-size: 16px; margin: 14px 0 4px; color: #1f7a3a; }
.ph-kv th { width: 30%; color: #555; }
.ph-sign { display: flex; gap: 40px; margin-top: 50px; }
.ph-sign div { flex: 1; border-top: 1px solid #111; padding-top: 4px; font-size: 12px; }
.ph-notes { margin-top: 10px; }
.ph-foot { margin-top: 24px; text-align: center; color: #555; }
@media print {
  body.has-print > *:not(#printArea) { display: none !important; }
  body.has-print #printArea { display: block !important; }
  body.has-print { background: #fff !important; }
  @page { margin: 14mm; }
  .ph-table tr { page-break-inside: avoid; }
}

.addr-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media print { .addr-link { color: #111; text-decoration: none; } }
