/* Buddha Spa: cores tiradas do logo (vermelho e dourado) sobre um fundo creme. */
:root {
  --bg: #faf6ef;
  --card: #ffffff;
  --text: #2b2420;
  --muted: #8a7f75;
  --line: #eee5d8;
  --accent: #9b2321;
  --accent-dark: #7d1a18;
  --accent-soft: #fbf0e6;
  --gold: #e3a13f;
  --gold-soft: #fbf1df;
  --ok: #2f7a4f;
  --danger: #b0413e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 35, 20, .04), 0 4px 16px rgba(60, 35, 20, .06);
  --shadow-lg: 0 12px 40px rgba(60, 35, 20, .16);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
main { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }
body.has-user main { padding-bottom: 96px; }

h1, h2 { font-weight: 700; letter-spacing: -.01em; }
h1 { font-family: var(--serif); font-size: 2rem; line-height: 1.15; margin: 0 0 .4rem; color: var(--accent); }
h2 { font-size: 1rem; margin: 0 0 .75rem; }
p { margin: .4rem 0; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-dark); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.block-line { display: block; }
.icon { flex: none; display: inline-block; vertical-align: middle; }

/* ---- Topo ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); font-family: var(--serif); font-weight: 700; font-size: 1.45rem; letter-spacing: .02em; white-space: nowrap; }
.brand img { display: block; height: 30px; width: auto; }
.nav-top { display: flex; gap: 4px; flex: 1; }
.nav-top a { color: var(--muted); font-weight: 500; padding: 8px 14px; border-radius: 999px; transition: background .15s, color .15s; }
.nav-top a:hover { color: var(--text); background: var(--accent-soft); }
.nav-top a.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.menu { position: relative; margin-left: auto; }
.menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px; border-radius: 999px; color: var(--text); font-weight: 500; transition: background .15s;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { background: var(--accent-soft); }
.menu summary .icon { color: var(--muted); transition: transform .2s; }
.menu[open] summary .icon { transform: rotate(180deg); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), #c97a2a); color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .03em;
}
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-head { padding: 8px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head strong { display: block; }
.menu-head small { color: var(--muted); }
.menu-panel a, .menu-panel .menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text); font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left;
}
.menu-panel a .icon, .menu-panel .menu-item .icon { color: var(--muted); }
.menu-panel a:hover, .menu-panel .menu-item:hover { background: var(--accent-soft); color: var(--accent); }
.menu-panel a:hover .icon, .menu-panel .menu-item:hover .icon { color: var(--accent); }
.menu-panel form { margin: 0; }
.menu-panel .menu-item, .menu-panel form button.menu-item { justify-content: flex-start; margin: 0; width: 100%; box-shadow: none; }

/* Barra inferior (celular) */
.nav-bottom { display: none; }

/* ---- Cartões e formulários ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 16px 0; box-shadow: var(--shadow);
}
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.login { margin-top: 8vh; padding: 32px 28px; text-align: center; }
.login form { text-align: left; margin-top: 20px; }
.login h1 { font-size: 1.8rem; }
.logo { margin: 0 0 8px; }
.logo img { display: block; margin: 0 auto; max-width: 64%; height: auto; }

form label { display: block; margin: 0 0 14px; font-size: .85rem; font-weight: 500; color: var(--muted); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; font: inherit; font-size: 1rem; color: var(--text);
  background: #fff; border: 1px solid #e3d9cb; border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 38px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a7f75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(227, 161, 63, .18); }
input[type=checkbox] {
  width: 20px; height: 20px; padding: 0; margin: 0; border-radius: 6px; flex: none; cursor: pointer;
  display: inline-grid; place-items: center;
}
input[type=checkbox]:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat;
  border-color: var(--accent);
}

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; padding: 11px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid #e3d9cb; background: #fff; color: var(--text); text-align: center;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
button:hover, .button:hover { border-color: var(--gold); color: var(--text); }
button:active, .button:active { transform: translateY(1px); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(155, 35, 33, .25); }
.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.danger { color: var(--danger); border-color: #efcfcd; background: #fff; }
.danger:hover { background: #fbeceb; border-color: var(--danger); color: var(--danger); }
button.link { border: 0; background: none; padding: 4px 0; color: var(--accent); box-shadow: none; font-weight: 500; }
button.link:hover { color: var(--accent-dark); }
.block { display: flex; width: 100%; margin: 16px 0; }
form button { margin: 4px 6px 4px 0; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; margin: 8px 0; }
.back:hover { color: var(--accent); }

.row { display: flex; gap: 12px; }
.row > label { flex: 1; }
.row.wrap { flex-wrap: wrap; align-items: flex-end; }
.row.between { justify-content: space-between; align-items: center; }
.row .grow { flex: 2 1 200px; }
.row.wrap > input:not(.grow) { width: 104px; }
.check { display: flex !important; align-items: center; gap: 10px; margin: 0; color: var(--text) !important; font-weight: 500; cursor: pointer; }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.inline input { width: 170px; margin: 0; }

fieldset.client { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px 2px; margin: 0 0 14px; background: #fffdf9; }
fieldset.client legend { color: var(--muted); font-size: .85rem; font-weight: 500; padding: 0 6px; }
fieldset.client .check { margin-bottom: 14px; }

.alert { border-radius: var(--radius-sm); padding: 10px 14px; margin: 14px 0; background: var(--gold-soft); border: 1px solid #f3dfbd; }
.alert p { margin: 3px 0; }
.alert.error { background: #fbeceb; border-color: #f2d3d1; color: var(--danger); }
.alert.ok { background: #e9f5ee; border-color: #cfe7d9; color: var(--ok); }

/* ---- Cabeçalho de mês e abas ---- */
.month-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.month-head h1 { margin: 0; text-align: center; }
.arrow {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: var(--accent); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 0;
}
.arrow:hover { background: var(--accent-soft); }
.tabs { display: flex; gap: 4px; margin: 8px 0 16px; padding: 4px; background: #f3ece1; border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; }
.tabs a { padding: 7px 16px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--card); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }

/* ---- Números ---- */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.totals div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.totals div:first-child { background: linear-gradient(135deg, var(--accent), #b8392c); border-color: transparent; color: #fff; }
.totals div:first-child .muted { color: rgba(255, 255, 255, .8); }
.totals span { display: block; font-size: .78rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.totals strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }

/* ---- Listas de atendimentos ---- */
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 14px 0; overflow: hidden; box-shadow: var(--shadow); }
.day header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--gold-soft); }
.day h2 { margin: 0; font-size: .92rem; }
.day header span { font-weight: 600; font-variant-numeric: tabular-nums; }
.day ul, .list { list-style: none; margin: 0; padding: 0; }
.day li a { display: flex; gap: 14px; align-items: center; padding: 12px 16px; color: inherit; border-top: 1px solid var(--line); transition: background .12s; }
.day li:first-child a { border-top: 0; }
.day li a:hover { background: #fffaf3; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; width: 46px; }
.what { flex: 1; min-width: 0; }
.what strong { font-weight: 600; }
.what small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.value { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cancelled { opacity: .5; }
.empty { text-align: center; padding: 40px 0; }
.star { color: var(--gold); }

.list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list details { width: 100%; }
.list details summary { cursor: pointer; color: var(--accent); font-weight: 500; list-style: none; }
.list details summary::-webkit-details-marker { display: none; }
.list details[open] { padding: 10px 0 4px; }
.service-row { padding: 10px 0; border-top: 1px solid var(--line); }
.service-row:first-of-type { border-top: 0; }
.service-row input { margin: 0; }

/* ---- Resumo ---- */
.highlights { background: linear-gradient(135deg, var(--gold-soft), #fff); }
.highlights p { margin: 4px 0; }
.bar { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; margin: 8px 0; }
.label { color: var(--muted); font-weight: 500; font-size: .9rem; }
.track { height: 10px; background: #f3ece1; border-radius: 999px; overflow: hidden; }
.track span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #d4832e); border-radius: 999px; }
.num { font-variant-numeric: tabular-nums; font-size: .88rem; white-space: nowrap; }
.num small { color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 4px; }
td { text-align: left; padding: 10px 4px; border-top: 1px solid var(--line); }
.r { text-align: right; }

/* ---- Indicações ---- */
.code-box { display: grid; gap: 10px; padding: 14px 16px; margin: 12px 0; border: 1px dashed var(--gold); border-radius: var(--radius); background: var(--gold-soft); }
.code-box.new { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.code { font-size: 1.4rem; letter-spacing: .06em; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--accent); }
.code-sm { letter-spacing: .08em; }
.code-box button, .code-box .button { margin: 0; }

/* ---- Celular ---- */
@media (max-width: 640px) {
  h1 { font-size: 1.7rem; }
  .nav-top, .menu-name { display: none; }
  .topbar-inner { padding: 8px 14px; }
  .brand span { font-size: 1.3rem; }
  .menu summary .icon { display: none; }
  .menu summary { padding: 2px; }
  .nav-bottom {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .nav-bottom a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0;
    color: var(--muted); font-size: .72rem; font-weight: 500; border-radius: var(--radius-sm);
  }
  .nav-bottom a.on { color: var(--accent); font-weight: 600; }
  .nav-bottom a.on .icon { fill: var(--accent-soft); }
  .card { padding: 16px; }
  .login { margin-top: 4vh; }
  .totals { grid-template-columns: 1fr 1fr; gap: 10px; }
  .totals strong { font-size: 1.25rem; }
  form button { width: 100%; margin: 6px 0; }
  .inline button, .code-box button, .code-box .button { width: auto; }
  .row:not(.wrap) { gap: 10px; }
}
