:root {
  --accent: #38bdf8;
  --accent-deep: #0ea5e9;
  --accent-soft: #7dd3fc;
  --plate: #070b12;
  --gold: #d4a017;
  --gold-deep: #b8860b;
  --bg: #070b12;
  --surface: #0f1623;
  --surface-2: #151d2e;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.14);
  --ok: #4ade80;
  --danger: #f87171;
  --font: "Avenir Next", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 480px at 8% -8%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(700px 400px at 100% 0%, rgba(212, 160, 23, 0.1), transparent 50%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent-soft); }

.banner {
  background: rgba(7, 11, 18, 0.92);
  color: #cbd5e1;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 0.45rem 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}

.shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.shell-narrow { max-width: 560px; }
.shell-wide { max-width: 1180px; }

h1, h2, h3 {
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.muted { color: var(--muted); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand strong { display: block; }
.brand small { color: var(--muted); font-size: 0.8rem; }

.mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: url("/assets/mark.svg") center / cover no-repeat;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.btn, button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--plate);
  font-weight: 700;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover, button:hover {
  background: var(--accent-deep);
  color: #fff;
}

.btn:active, button:active { transform: translateY(1px); }

.btn-ghost, button.ghost, a.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
}

.btn-ghost:hover, button.ghost:hover, a.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent-soft);
}

.btn-gold, button.btn-gold {
  background: linear-gradient(180deg, #e0b020, var(--gold));
  color: #1a1400;
}

.btn-gold:hover, button.btn-gold:hover {
  background: var(--gold-deep);
  color: #fff;
}

.btn-danger, button.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.btn-sm, button.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 9px;
}

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card, .row, .stat, .panel-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.stat b {
  display: block;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--accent-soft);
}

.stat span {
  color: var(--muted);
  font-size: 0.85rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-soft);
  white-space: nowrap;
}

.tag.done { background: rgba(74, 222, 128, 0.14); color: var(--ok); }
.tag.warn { background: rgba(212, 160, 23, 0.18); color: #fbbf24; }
.tag.danger { background: rgba(248, 113, 113, 0.14); color: var(--danger); }

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: var(--surface-2);
  color: var(--text);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

input[type="color"] { padding: 0.2rem; height: 42px; }

.form { display: grid; gap: 14px; }
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.cta-row.tight { margin: 0; }

.error { color: var(--danger); font-size: 0.9rem; }
.ok { color: var(--ok); }
.hidden { display: none !important; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.list { display: grid; gap: 10px; }

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.row strong { display: block; }
.row small { color: var(--muted); }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.slot {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 11px;
  padding: 0.7rem;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.slot small { color: var(--muted); font-weight: 500; }

.slot:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.slot.selected {
  border-color: var(--gold);
  background: rgba(212, 160, 23, 0.14);
  color: #fde68a;
}

.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 12px;
  z-index: 50;
  max-width: 320px;
  box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
th { color: var(--muted); font-weight: 600; }

.panel { animation: fadeIn 0.28s ease; }
.section-gap { margin-top: 28px; }
.stack-gap { margin-bottom: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.date-input { max-width: 180px; }
.select-auto { width: auto; }
.pro-name {
  border-left: 4px solid var(--gold);
  padding-left: 10px;
  display: block;
}

/* ——— Public hero ——— */
.page-public { overflow-x: hidden; }

.hero {
  position: relative;
  min-height: calc(100vh - 34px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 56px;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(7, 11, 18, 0.35) 0%, rgba(7, 11, 18, 0.72) 48%, rgba(7, 11, 18, 0.96) 100%),
    url("/assets/hero-barbearia.jpg") center / cover no-repeat;
}

.hero-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 16px 0;
  width: 100%;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(48px, 18vh, 140px);
}

.hero-copy {
  max-width: min(36rem, 94vw);
  animation: riseIn 0.7s ease both;
}

.hero-copy h1 {
  font-size: clamp(1.75rem, 4.2vw, 2.85rem);
  line-height: 1.15;
  margin-bottom: 12px;
  max-width: 22em;
  text-wrap: balance;
}

.hero-copy p {
  color: var(--muted);
  max-width: 36ch;
  margin: 0;
  font-size: 1.05rem;
}

.hero-copy .cta-row { animation: riseIn 0.7s ease 0.12s both; }

.public-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 16px 24px;
}

.public-section h2 {
  font-size: 1.35rem;
  margin-bottom: 16px;
}

.public-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 56px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* ——— Booking steps ——— */
.steps {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.step-pill {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.step-pill.on {
  color: #1a1400;
  background: var(--gold);
  border-color: transparent;
}

.code-xl {
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 800;
}

/* ——— Manage shell ——— */
.login-wrap {
  min-height: calc(100vh - 34px);
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.login-card .cred {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 8px 0 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 34px);
}

.sidebar {
  background: rgba(15, 22, 35, 0.95);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: calc(100vh - 34px);
  overflow-y: auto;
}

.sidebar .brand { padding: 4px 8px 16px; }

.nav-group {
  margin-top: 10px;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px 6px;
}

.nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.nav-tabs button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  justify-content: flex-start;
  border-radius: 10px;
  width: 100%;
}

.nav-tabs button:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-tabs button.active {
  background: rgba(212, 160, 23, 0.14);
  border-color: rgba(212, 160, 23, 0.35);
  color: #fbbf24;
}

.app-main {
  padding: 22px 22px 48px;
  min-width: 0;
}

.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.sidebar-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}

.sidebar-backdrop {
  display: none;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy,
  .hero-copy .cta-row,
  .panel,
  .btn, button, .slot {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 34px;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    height: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 34px 0 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 35;
  }
  .sidebar-toggle { display: inline-flex; }
  .app-main { padding: 16px 14px 48px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-top { flex-wrap: wrap; }
  .hero { min-height: calc(100svh - 34px); }
  .row {
    flex-direction: column;
    align-items: flex-start;
  }
}
