:root {
  --bg: #160f0b; --bg-2: #1f1611; --panel: #241a14; --panel-2: #2c2018;
  --gold: #c9a96a; --gold-2: #e6cf97; --gold-deep: #a8854c;
  --cream: #f3e9da; --soft: #c9b9a6; --muted: #a6937e; --line: rgba(201,169,106,.22);
  --ok: #8fc79a; --warn: #e6b36a; --bad: #f08c7c;
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'Jost', system-ui, sans-serif;
  --radius: 14px; --tap: 44px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans); font-weight: 400; color: var(--cream); background: var(--bg);
  line-height: 1.5; font-size: 16px; overflow-x: hidden; -webkit-text-size-adjust: 100%;
}
a { color: var(--gold-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.boot { padding: 24px; color: var(--soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(ellipse at top, #2c2018 0%, var(--bg) 70%); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 24px; text-align: center; }
.login-card img { width: 84px; height: 84px; }
.login-card h1 { font-family: var(--serif); font-weight: 600; font-size: 1.9rem; margin: 12px 0 4px; color: var(--gold-2); }
.login-card p.sub { color: var(--soft); margin: 0 0 24px; font-size: .95rem; }
.login-card form { text-align: left; display: grid; gap: 14px; }

/* Auth: split screen (login and invitation). Stacks on a phone. */
.auth { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.auth-art { position: relative; overflow: hidden; display: grid; place-items: center; padding: 40px 16px 32px; text-align: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(230,207,151,.18) 0%, transparent 45%),
    radial-gradient(circle at 75% 85%, rgba(168,133,76,.22) 0%, transparent 50%),
    linear-gradient(160deg, #241a14 0%, #160f0b 60%, #0f0a07 100%);
  border-bottom: 1px solid var(--line); }
.auth-art::after { content: ''; position: absolute; inset: 14px; border: 1px solid rgba(201,169,106,.16); border-radius: 22px; pointer-events: none; }
.auth-art-inner { position: relative; z-index: 1; max-width: 420px; }
.auth-art img { width: 72px; height: 72px; }
.auth-brand { font-family: var(--serif); font-weight: 500; font-size: 2.6rem; letter-spacing: .14em; color: var(--gold-2); margin: 8px 0 0; line-height: 1.1; }
.auth-tag { font-size: .78rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); margin: 6px 0 0; }
.auth-line { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--soft); margin: 18px auto 0; max-width: 30ch; }
.auth-side { display: grid; align-content: center; justify-items: center; gap: 16px; padding: 24px 16px 40px; position: relative; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-family: var(--serif); font-weight: 600; font-size: 1.9rem; margin: 0 0 4px; color: var(--gold-2); }
.auth-card p.sub { color: var(--soft); margin: 0 0 20px; font-size: .95rem; }
.auth-card form { display: grid; gap: 14px; }
.lang-switch { justify-self: end; display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch button { min-height: 36px; min-width: 44px; padding: 4px 12px; background: transparent; border: 0; color: var(--soft); cursor: pointer; font-size: .85rem; }
.lang-switch button[aria-pressed=true] { background: var(--gold); color: #1b130e; }
.social { display: grid; gap: 10px; }
.btn-social { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--tap); padding: 10px 16px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--cream); text-decoration: none;
  font-weight: 500; cursor: pointer; width: 100%; }
.btn-social:hover { border-color: var(--gold); }
.btn-social svg { width: 20px; height: 20px; flex: none; }
.btn-social.google svg { color: var(--cream); }
.btn-social.passkey { border-color: rgba(201,169,106,.5); color: var(--gold-2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.hint { color: var(--muted); font-size: .82rem; margin: -6px 0 0; }

.pw { position: relative; display: block; }
.pw input { padding-right: 48px; }
.pw .eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; border: 0; color: var(--soft); cursor: pointer; border-radius: 8px; }
.pw .eye svg { width: 20px; height: 20px; }
.pw .eye[aria-pressed=true] { color: var(--gold-2); }

/* Account menu */
details.account { position: relative; }
details.account > summary { min-height: 36px; }
.account-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; width: min(280px, calc(100vw - 32px)); display: grid; gap: 10px;
  padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.account-email { margin: 0; color: var(--soft); font-size: .88rem; overflow-wrap: anywhere; }

@media (min-width: 900px) {
  .auth { grid-template-rows: none; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .auth-art { border-bottom: 0; border-right: 1px solid var(--line); padding: 48px; }
  .auth-art img { width: 96px; height: 96px; }
  .auth-brand { font-size: 3.6rem; }
  .auth-line { font-size: 1.5rem; }
  .auth-side { padding: 48px; }
  .lang-switch { position: absolute; top: 24px; right: 24px; }
}

/* Forms */
label { display: grid; gap: 6px; font-size: .9rem; color: var(--soft); }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px; color: var(--cream); min-width: 0;
}
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--gold); }
.check { display: flex; gap: 10px; align-items: center; color: var(--cream); }
.btn { min-height: var(--tap); padding: 10px 18px; border-radius: 999px; border: 1px solid var(--gold);
  background: var(--gold); color: #1b130e; font-weight: 500; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--gold-2); }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.error { color: var(--bad); margin: 0; }
.notice { color: var(--soft); font-size: .9rem; margin: 8px 0; }
.ok { color: var(--ok); }

/* Shell */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.top img { width: 34px; height: 34px; }
.top .salon { font-family: var(--serif); font-size: 1.25rem; color: var(--gold-2); flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top nav.desk { display: none; }
main { padding: 16px 16px 96px; max-width: 1100px; margin: 0 auto; }
h1.page { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; margin: 4px 0 12px; color: var(--gold-2); }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; margin: 20px 0 8px; color: var(--gold-2); }
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--bg-2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs a, nav.desk a { display: grid; place-items: center; min-height: 56px; text-decoration: none; color: var(--soft);
  font-size: .78rem; padding: 4px 2px; text-align: center; }
nav.tabs a[aria-current=page], nav.desk a[aria-current=page] { color: var(--gold-2); font-weight: 500; }
nav.tabs svg { width: 22px; height: 22px; display: block; margin: 0 auto 2px; }

/* Cards and lists */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; text-decoration: none; color: inherit; min-width: 0; }
a.row:hover { background: var(--panel-2); }
.row .time { font-variant-numeric: tabular-nums; color: var(--gold-2); min-width: 54px; font-weight: 500; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 500; overflow-wrap: anywhere; }
.row .meta { color: var(--soft); font-size: .88rem; overflow-wrap: anywhere; }
.pill { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--soft); white-space: nowrap; }
.pill.confirmed { color: var(--ok); border-color: rgba(143,199,154,.5); }
.pill.pending { color: var(--warn); border-color: rgba(230,179,106,.5); }
.pill.cancelled, .pill.error { color: var(--bad); border-color: rgba(240,140,124,.5); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { min-height: 40px; padding: 6px 14px; background: transparent; border: 0; color: var(--soft); cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--gold); color: #1b130e; }

/* KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.kpi { display: grid; gap: 2px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.kpi-value { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--gold-2); line-height: 1.1; overflow-wrap: anywhere; }
.kpi-label { font-size: .9rem; color: var(--cream); }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.daylabel { font-weight: 500; color: var(--cream); }
.grid-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-filters .full { grid-column: 1 / -1; }
dl.kv { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 8px 12px; margin: 0; }
dl.kv dt { color: var(--soft); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 14px; background: var(--panel-2); overflow-wrap: anywhere; }
.bubble.user, .bubble.caller { align-self: flex-start; border-top-left-radius: 4px; }
.bubble.assistant, .bubble.agent { align-self: flex-end; background: #3a2a1d; border-top-right-radius: 4px; }
.bubble .when { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; }
button.bubble { border: 1px solid transparent; text-align: left; cursor: pointer; color: var(--cream); }
button.bubble.active { border-color: var(--gold); }

/* Player */
.player audio { width: 100%; margin: 8px 0; }
.wave { display: flex; align-items: center; gap: 1px; height: 56px; cursor: pointer; touch-action: none; }
.wave span { flex: 1; background: var(--muted); border-radius: 1px; min-height: 2px; }
.wave span.played { background: var(--gold); }

/* Team */
.svc-grid { display: grid; gap: 8px; }
details > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; gap: 8px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.tramo { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.weekday { margin: 8px 0; }

@media (min-width: 900px) {
  nav.tabs { display: none; }
  .top nav.desk { display: flex; gap: 4px; }
  .top nav.desk a { min-height: 40px; padding: 0 12px; font-size: .95rem; }
  main { padding-bottom: 32px; }
  .grid-filters { grid-template-columns: repeat(5, 1fr) auto; align-items: end; }
  .grid-filters .full { grid-column: auto; }
  .agenda-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
}
