:root {
  --bg: #f7f5f0;
  --panel: #fffcf7;
  --ink: #111;
  --muted: #6b6560;
  --gold: #b5995e;
  --gold-deep: #8f7340;
  --line: rgba(17, 17, 17, 0.12);
  --danger: #b42318;
  --ok: #16a34a;
  --font-serif: "Cormorant Garamond", "Times New Roman", Times, serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(181,153,94,.14), transparent 55%),
    linear-gradient(180deg, #faf8f4, #efebe3);
}
.wrap { max-width: 1220px; margin: 0 auto; padding: 28px 20px 60px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 18px 48px rgba(17,17,17,.07);
  margin-bottom: 14px;
}
h1,h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-weight: 600;
}
.muted { color: var(--muted); }
label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: .9rem; }
input, textarea, select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; border: 0;
  background: #111; color: #faf8f4; font-weight: 600; cursor: pointer; font: inherit;
  text-decoration: none;
}
.btn.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--gold);
}
.btn.sm { padding: 7px 12px; font-size: .85rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.err { color: var(--danger); min-height: 1.2em; margin: 8px 0; }
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.bot-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
  font-size: 0.95rem;
  cursor: pointer;
}
.bot-check input {
  width: 18px;
  height: 18px;
}
.turnstile-slot {
  min-height: 65px;
  margin: 8px 0 4px;
}
.okmsg { color: var(--ok); min-height: 1.2em; margin: 8px 0; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--gold); font-size: .8rem; color: var(--gold-deep);
}
.badge.ok { border-color: var(--ok); color: var(--ok); }
.portal-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--gold);
}
.portal-avatar.ini {
  display: grid; place-items: center;
  background: #efe3cc; font-size: .72rem; font-weight: 700;
  letter-spacing: .04em;
}

.status-track {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}
.status-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
  text-transform: capitalize;
}
.status-step .dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff;
}
.status-step.is-on .dot,
.status-step.is-active .dot {
  border-color: var(--gold-deep);
  background: var(--gold);
}
.status-step.is-active .lab { color: var(--ink); font-weight: 600; }
.status-line {
  width: 28px; height: 2px; background: var(--line); margin: 0 6px;
}
.status-step.is-on + .status-line,
.status-step.is-active + .status-line { background: rgba(181,153,94,.55); }
.top {
  display: flex; justify-content: space-between; gap: 12px;
  align-items: center; margin-bottom: 18px; flex-wrap: wrap;
}
.top-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
a { color: var(--gold-deep); }
.list { margin: 0; padding-left: 1.1em; color: var(--muted); }
.list li { margin-bottom: 8px; }
.auth-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.or {
  display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem;
}
.or::before, .or::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.google-btn {
  background: #fff !important;
  color: #1f1f1f !important;
  border: 1px solid #dadce0 !important;
  font-weight: 600;
}
.google-btn:disabled { opacity: .55; cursor: not-allowed; }
.wa-card { border-color: rgba(34, 197, 94, .35); }
.wa-btn {
  background: #16a34a !important;
  color: #fff !important;
  margin-top: 6px;
}
.linkish {
  background: none; border: 0; color: var(--gold-deep); cursor: pointer;
  font: inherit; padding: 0; text-decoration: underline;
}
.switch { margin-top: 14px; font-size: .9rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,252,247,.85);
}
.back-link:hover { border-color: var(--gold); color: var(--gold-deep); }
.back-link svg { width: 16px; height: 16px; }

.brand-mark {
  height: 56px;
  width: 56px;
  flex: 0 0 auto;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(17,17,17,.12);
  background: #fffcf7;
}
.brand-mark.lg {
  height: 72px;
  width: 72px;
  object-fit: cover;
}
.brand-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-block .title { font-family: var(--font-serif); font-size: 1.45rem; margin: 0; }
.brand-block .sub { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); }

.auth-hero {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  margin-bottom: 8px;
}
.auth-hero .brand-mark.lg { height: 88px; width: 88px; }

.tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px;
}
.tab {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.tab.active {
  background: #111;
  color: #faf8f4;
  border-color: #111;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.stat .n {
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1;
}
.stat .l { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.req-item {
  display: flex; justify-content: space-between; gap: 12px;
  align-items: flex-start; padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.req-item:last-child { border-bottom: 0; }
.small { font-size: .82rem; }
.cita-form {
  display: grid;
  gap: 0 14px;
}
.cita-form .span2 { grid-column: 1 / -1; }
.row-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  color: var(--ink);
}
.row-check input { width: auto; }
.cal-admin { margin-top: 14px; }
.cal-admin .cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cal-admin .cal-head strong { text-transform: capitalize; }
.cal-dow, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .75rem;
  text-align: center;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.cal-admin .cal-day {
  background: #f4eee4;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 0;
  min-height: 40px;
  font-weight: 600;
}
.cal-admin .cal-day.is-out {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}
.cal-admin .cal-day.is-muted {
  background: #d8d4ce;
  color: #7a756e;
}
.cal-admin .cal-day.is-booked {
  background: #e8d7b4;
  border-color: var(--gold);
}
.cal-admin .cal-day.is-today { box-shadow: inset 0 0 0 2px #111; }
@media (min-width: 700px) {
  .cita-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr; }
  .brand-mark.lg { height: 64px; width: 64px; }
  .auth-hero .brand-mark.lg { height: 76px; width: 76px; }
}

.client-row {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: var(--panel);
}
.client-row:hover {
  border-color: var(--gold);
}
.client-row:disabled {
  opacity: .7;
  cursor: default;
}
.ficha-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ficha-head h2 { margin-bottom: 4px; }
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.check-row .chk,
label.chk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
}
.check-row input {
  width: auto;
}
.muted.small { font-size: .85rem; }
.check-track {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.check-track li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .85rem;
}
.check-track .dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff;
}
.check-track li.is-on { color: var(--ok); }
.check-track li.is-on .dot {
  border-color: var(--ok);
  background: var(--ok);
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.asset-card {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.asset-card img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #eee;
}
.asset-card figcaption {
  padding: 6px 8px;
  font-size: .75rem;
  color: var(--muted);
}
.upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}
.upload-form input[type="file"] { flex: 1; min-width: 160px; }
.client-texts {
  white-space: pre-wrap;
  font: inherit;
  font-size: .9rem;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 8px;
  margin: 8px 0 0;
}
.digest { margin: 8px 0 0; padding-left: 18px; }
.appbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  background: #fffcf7;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.appbar a, .appbar button {
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  cursor: pointer;
}
.appbar .primary { background: var(--gold); border-color: var(--gold-deep); color: #111; }
.appbar .status { margin-left: auto; color: var(--muted); font-size: .85rem; }
.appbar .status.warn { color: var(--gold-deep); font-weight: 700; }
textarea { width: 100%; min-height: 120px; }
