:root {
  --ink: #1b1916;
  --muted: #6d655c;
  --line: #eadfd2;
  --paper: #fffaf3;
  --cream: #f6efe4;
  --white: #fffdf9;
  --saffron: #e4570e;
  --saffron-dark: #c2410c;
  --teal: #0f4c5c;
  --teal-soft: #146377;
  --gold: #d4a017;
  --green: #2f7d4a;
  --red: #b42318;
  --blue: #1d4e89;
  --shadow: 0 16px 40px rgba(47, 32, 16, 0.08);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: #d8c8b4;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, .display { font-family: "Fraunces", serif; margin: 0; }

.phone-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(228, 87, 14, 0.18), transparent 28%),
    linear-gradient(180deg, #e8d7c3 0%, #c9b49a 100%);
}
.phone {
  width: min(100%, 430px);
  min-height: 100vh;
  background: var(--paper);
  position: relative;
  box-shadow: var(--shadow);
}
.phone-body {
  padding: 18px 18px 108px;
}
.phone-body.auth { padding-bottom: 32px; }

.ops-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #f4efe7;
}
.ops-side {
  background: var(--teal);
  color: #f8f3ea;
  padding: 28px 22px;
}
.ops-brand { font-size: 1.35rem; }
.ops-side p { color: #d5e4e8; line-height: 1.5; }
.ops-nav { display: grid; gap: 8px; margin-top: 28px; }
.ops-nav a {
  color: #f8f3ea;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
}
.ops-nav a.active, .ops-nav a:hover { background: rgba(255,255,255,0.12); }
.ops-main { padding: 32px 36px 48px; }
.ops-top { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 24px; }

.hero-kicker, .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--saffron-dark);
  font-weight: 700;
}
.display { font-size: 1.8rem; line-height: 1.15; }
.lede { color: var(--muted); line-height: 1.55; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.avatar, .logo-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0d9bf;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--teal);
}

.card, .panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(80, 50, 20, 0.04);
}
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--saffron); color: white; }
.btn-teal { background: var(--teal); color: white; }
.btn-ghost { background: #f3e8d8; color: var(--ink); }
.btn-danger { background: #f8d7d3; color: var(--red); }
.btn-block { width: 100%; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 0.86rem; font-weight: 700; }
.field-input, .field-textarea, .field-file, select {
  width: 100%;
  border: 1px solid #e5d6c4;
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
}
.field-textarea { resize: vertical; }
.help { color: var(--muted); font-size: 0.82rem; }
.errorlist { color: var(--red); padding-left: 16px; font-size: 0.86rem; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill-draft { background: #eee7dc; color: #6a5b4b; }
.pill-scheduled { background: #dceaf8; color: var(--blue); }
.pill-active { background: #d9f0e1; color: var(--green); }
.pill-expired { background: #f3e2c8; color: #9a5b12; }
.pill-deactivated, .pill-suspended { background: #f8d7d3; color: var(--red); }
.pill-pending { background: #efe6c8; color: #7a5b12; }

.stat-grid, .ops-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.stat b { display: block; font-size: 1.4rem; font-family: "Fraunces", serif; }
.stat span { color: var(--muted); font-size: 0.78rem; }

.tabbar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 253, 249, 0.96);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px calc(10px + var(--safe-bottom));
  backdrop-filter: blur(12px);
}
.tabbar a {
  text-decoration: none;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 2px;
}
.tabbar a.active { color: var(--saffron-dark); }

.offer-card {
  overflow: hidden;
  padding: 0;
}
.offer-card .media {
  min-height: 120px;
  background:
    linear-gradient(135deg, rgba(15,76,92,0.85), rgba(228,87,14,0.75)),
    #0f4c5c;
  color: white;
  padding: 18px;
}
.offer-card .media.saffron { background: linear-gradient(135deg, #e4570e, #d4a017); }
.offer-card .media.teal { background: linear-gradient(135deg, #0f4c5c, #1d7a6a); }
.offer-card .media.rose { background: linear-gradient(135deg, #9b2226, #e07a5f); }
.offer-card .media.indigo { background: linear-gradient(135deg, #312e81, #7c3aed); }
.offer-card .media.leaf { background: linear-gradient(135deg, #2f7d4a, #74c69d); }
.offer-card .body { padding: 14px 16px 16px; }
.offer-card h3 { font-size: 1.15rem; margin-bottom: 6px; }

.calendar-nav { display: flex; justify-content: space-between; align-items: center; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
}
.cal-dow, .cal-day {
  text-align: center;
  font-size: 0.72rem;
  padding: 6px 0;
}
.cal-dow { color: var(--muted); font-weight: 700; }
.cal-day {
  border-radius: 10px;
  min-height: 42px;
  background: #f7f0e6;
}
.cal-day.out { opacity: 0.35; }
.cal-day.today { outline: 2px solid var(--saffron); }
.cal-day.has { background: #fde6d4; font-weight: 700; }
.dots { display: flex; justify-content: center; gap: 2px; margin-top: 2px; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--saffron); }

.table-wrap { overflow: auto; background: white; border-radius: 18px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }

.messages { display: grid; gap: 8px; margin-bottom: 12px; }
.msg { padding: 10px 12px; border-radius: 12px; font-size: 0.9rem; }
.msg-success { background: #d9f0e1; }
.msg-error { background: #f8d7d3; }

.qr-frame {
  background: white;
  border-radius: 24px;
  padding: 18px;
  text-align: center;
}
.qr-frame img { margin: 0 auto; width: 220px; }

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
}

.template-grid { display: grid; gap: 12px; }
.template-card .swatch {
  height: 86px;
  border-radius: 16px 16px 0 0;
}
.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; color: var(--muted); }

@media (max-width: 860px) {
  .ops-shell { grid-template-columns: 1fr; }
  .ops-side { padding: 18px; }
  .ops-nav { grid-template-columns: 2fr 2fr; }
  .ops-main { padding: 18px; }
}
