:root {
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e7e0d4;
  --paper: #f4f0e8;
  --card: #fffdf8;
  --sidebar: #16201c;
  --sidebar-2: #1e2b26;
  --gold: #c9a227;
  --gold-ink: #3f2f05;
  --accent: #0f766e;
  --danger: #b42318;
  --ok: #157a3a;
  --shadow: 0 10px 30px rgba(28, 25, 23, 0.08);
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font: 15px/1.5 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--accent); }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; }
h1 { font-size: 1.45rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 240px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #f5efe3; display: flex; flex-direction: column; padding: 1.25rem 1rem;
}
.brand { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1.5rem; color: inherit; text-decoration: none; }
.brand.center { justify-content: center; }
.brand strong { display: block; font-size: 1.05rem; }
.brand em { display: block; font-style: normal; color: var(--gold); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gold); color: var(--gold-ink);
  display: grid; place-items: center; font-weight: 800; letter-spacing: -0.04em;
}
.sidebar nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.nav-item {
  color: #e8e0d4; text-decoration: none; padding: 0.55rem 0.75rem; border-radius: 8px;
}
.nav-item:hover, .nav-item.is-active { background: rgba(201, 162, 39, 0.16); color: #fff; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1rem; font-size: 0.9rem; }
.sidebar-foot .who span { display: block; color: #c4bdb0; }
.text-link { color: var(--gold); }
.stage { margin-left: 240px; min-height: 100vh; }
.topbar { padding: 1.25rem 1.75rem 0.5rem; }
main { padding: 0.5rem 1.75rem 3rem; max-width: 1180px; }
.flash { padding: 0.7rem 0.9rem; border-radius: 8px; margin: 0 0 1rem; }
.flash-error, .flash-danger { background: #fde8e6; color: var(--danger); }
.flash-ok, .flash-success { background: #e8f6ec; color: var(--ok); }
.flash-info, .flash-warn { background: #f8efd3; color: #6b4f00; }
.grid { display: grid; gap: 1rem; }
.counts { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.count { text-decoration: none; color: inherit; }
.count .num { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.04em; display: block; }
.count .lbl { color: var(--muted); font-size: 0.85rem; }
.pill {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 0.1rem 0.55rem; font-size: 0.75rem; font-weight: 650;
  background: #eee; color: #333;
}
.stg-new { background: #e7e5e4; color: #44403c; }
.stg-contacted { background: #dbeafe; color: #1e40af; }
.stg-inspection_booked { background: #ede9fe; color: #5b21b6; }
.stg-inspected { background: #ccfbf1; color: #0f766e; }
.stg-offer_made { background: #fef3c7; color: #92400e; }
.stg-bought { background: #dcfce7; color: #166534; }
.stg-lost { background: #fee2e2; color: #991b1b; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 650; }
.table a { color: var(--ink); font-weight: 650; text-decoration: none; }
.table a:hover { color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; align-items: center; }
.button, button.button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: var(--ink); color: #fff; border: 0; border-radius: 9px;
  padding: 0.55rem 0.9rem; font-weight: 650; text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.08); }
.button-secondary, a.button-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.button-whatsapp, a.button-whatsapp { background: #128c7e; color: #fff; }
.button-whatsapp[aria-disabled="true"], .button[disabled] { opacity: 0.45; pointer-events: none; }
.button-danger { background: var(--danger); }
.filters a { text-decoration: none; padding: 0.3rem 0.6rem; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); background: #fff; }
.filters a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
form label, .field { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.75rem; }
input, select, textarea {
  font: inherit; font-weight: 400; padding: 0.5rem 0.65rem; border: 1px solid #d6d3d1;
  border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.span-2 { grid-column: span 2; }
.muted, .hint { color: var(--muted); font-weight: 400; font-size: 0.88rem; }
.split { display: grid; grid-template-columns: 1.4fr 0.9fr; gap: 1rem; align-items: start; }
@media (max-width: 980px) {
  .sidebar { position: static; width: auto; }
  .stage { margin-left: 0; }
  .split, .span-2 { grid-template-columns: 1fr; grid-column: auto; }
}
.banner-sample { background: #fff4cc; border: 1px dashed #c9a227; color: #6b4f00; padding: 0.6rem 0.8rem; border-radius: 8px; margin-bottom: 1rem; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.photos figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.photos img { width: 100%; height: 110px; object-fit: cover; display: block; background: #eee; }
.photos figcaption { padding: 0.35rem 0.5rem; font-size: 0.78rem; color: var(--muted); }
.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.login-body { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(circle at top, #2a3a34, #121916); }
.login-card { width: min(420px, calc(100% - 2rem)); background: var(--card); padding: 1.6rem; border-radius: 16px; box-shadow: var(--shadow); }
.lede { color: var(--muted); }
.warn-box { background: #fde8e6; color: #7a1c16; padding: 0.75rem; border-radius: 8px; }
.ok-box { background: #e8f6ec; color: #14532d; padding: 0.75rem; border-radius: 8px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0 1rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
