/* ---------- login ---------- */
.login {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(201, 162, 79, 0.16), transparent 60%), var(--bg);
}
.login-card { width: min(100%, 400px); display: grid; gap: 1rem; padding: 2rem 1.75rem; border-radius: 24px; text-align: center; background: var(--card); border: 1px solid var(--line-strong); animation: rise 600ms var(--ease-out) backwards; }
.login-card img { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto; object-fit: cover; border: 1px solid var(--line-strong); }
.login-card h1 { font: 400 2.8rem/1.1 var(--script); padding-right: 0.1em; }
.login-bf { width: 56px; margin: 0 auto; }
.label { font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase; }
.login .field { text-align: left; }
.err { color: var(--bad); font-size: 0.9rem; min-height: 1.3em; }
.fine { font-size: 0.82rem; color: var(--faint); }
a.fine { text-decoration: none; }

/* ---------- estrutura ---------- */
.app { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; overflow: auto; display: flex; flex-direction: column; gap: 1rem;
  padding: 22px 16px calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--bg-2); border-right: 1px solid var(--line);
}
.who { display: grid; justify-items: center; gap: 0.35rem; text-align: center; padding-bottom: 0.4rem; }
.who img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); }
.who b { font: 400 1.9rem/1.15 var(--script); padding-right: 0.1em; }
.who small { font-size: 0.8rem; overflow-wrap: anywhere; }
.btn-wide { width: 100%; justify-content: flex-start; }
.nav-main { display: grid; gap: 2px; }
.nav-main a {
  display: flex; align-items: center; gap: 0.9rem; min-height: 46px; padding: 0 0.9rem; border-radius: 12px;
  color: var(--muted); text-decoration: none; transition: background-color 160ms ease, color 160ms ease;
}
.nav-main a[aria-current="page"] { background: rgba(201, 162, 79, 0.15); color: var(--gold-hi); }
@media (hover: hover) and (pointer: fine) { .nav-main a:not([aria-current]):hover { background: rgba(255, 255, 255, 0.05); color: var(--text); } }
.push { margin-top: auto; display: grid; gap: 0.6rem; }
.push .row { flex-wrap: nowrap; }
.grow { flex: 1; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--gold-hi); text-decoration: underline; cursor: pointer; font-size: inherit; }
.top, .scrim { display: none; }
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent;
  display: grid; place-items: center; cursor: pointer; transition: border-color 180ms ease, transform 140ms var(--ease-out);
}
.icon-btn:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { border-color: var(--gold); } }
.btn.icon { padding: 0; width: 44px; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .top {
    display: flex; align-items: center; gap: 0.75rem; position: sticky; top: 0; z-index: 30;
    height: calc(58px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 12px 0;
    background: rgba(26, 36, 29, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .top-name { font: 400 1.8rem/1 var(--script); padding-right: 0.1em; }
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(86vw, 304px); height: 100dvh;
    transform: translateX(-102%); transition: transform 280ms var(--ease-drawer); border-right: 1px solid var(--line-strong);
  }
  .side.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 250ms ease; }
  .scrim.show { opacity: 1; pointer-events: auto; }
}

.main { padding: 28px clamp(16px, 3vw, 44px) 72px; min-width: 0; outline: none; }
.main > * { animation: fade 160ms ease backwards; }
@keyframes fade { from { opacity: 0; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font: 500 clamp(1.8rem, 3.5vw, 2.5rem)/1.1 var(--serif); }
.page-head p { color: var(--muted); margin-top: 0.25rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* ---------- peças ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.25rem; margin-bottom: 1rem; }
.card > h2, .card > header h2 { font: 500 1.3rem var(--serif); margin-bottom: 0.9rem; }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 1rem; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.25rem; }
.stat small { display: block; color: var(--muted); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }
.stat b { display: block; font: 500 1.9rem/1.2 var(--serif); margin-top: 0.2rem; }
.stat span { font-size: 0.85rem; color: var(--muted); }
.empty { padding: 1.75rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 16px; }
.pill { display: inline-flex; align-items: center; padding: 0.15rem 0.7rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid; white-space: nowrap; }
.pill.warn { color: var(--warn); border-color: rgba(227, 176, 75, 0.45); background: rgba(227, 176, 75, 0.1); }
.pill.ok { color: var(--ok); border-color: rgba(95, 192, 143, 0.45); background: rgba(95, 192, 143, 0.1); }
.pill.gold { color: var(--gold-hi); border-color: var(--line-strong); background: rgba(201, 162, 79, 0.12); }
.pill.bad { color: var(--bad); border-color: rgba(224, 118, 107, 0.45); background: rgba(224, 118, 107, 0.1); }
.av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; border: 1px solid var(--line-strong); background: var(--card-2); flex: none; }

.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.14); transition: background-color 180ms ease; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 200ms var(--ease-out), background-color 180ms ease; }
.switch input:checked + i { background: var(--gold); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--gold-ink); }
.switch input:focus-visible + i { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; min-width: 480px; }
.tbl th { text-align: left; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0 0.75rem 0.6rem; }
.tbl td { padding: 0.7rem 0.75rem; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl td.num, .tbl th.num { text-align: right; font: inherit; background: none; color: inherit; -webkit-text-fill-color: currentColor; font-variant-numeric: tabular-nums; }
.tbl td small { color: var(--muted); display: block; }

/* ---------- agenda ---------- */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 1.25rem; align-items: start; }
.col > header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.col h2 { font: 500 1.2rem var(--serif); }
.col small { color: var(--muted); }
.appt { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 0.5rem 0.9rem; align-items: start; padding: 0.9rem; margin-bottom: 0.6rem; border-radius: 14px; border: 1px solid var(--line); border-left: 3px solid var(--faint); background: var(--card); }
.appt[data-status="pending"] { border-left-color: var(--warn); }
.appt[data-status="confirmed"] { border-left-color: var(--ok); }
.appt[data-status="done"] { border-left-color: var(--gold); }
.appt[data-status="canceled"] { opacity: 0.6; }
.appt .time b { display: block; font: 500 1.25rem/1.1 var(--serif); }
.appt .time small { color: var(--muted); font-size: 0.75rem; }
.appt .info { display: grid; min-width: 0; }
.appt .info span { color: var(--muted); font-size: 0.9rem; }
.appt .info a { color: var(--gold-hi); font-size: 0.88rem; text-decoration: none; width: fit-content; }
.appt .acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.date-in { width: auto; min-width: 150px; }

/* ---------- gráfico simples ---------- */
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.6rem; }
.bar { display: grid; justify-items: center; gap: 0.2rem; text-align: center; }
.bar-fill { height: 120px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar-fill i { display: block; width: 100%; max-width: 44px; min-height: 3px; border-radius: 8px 8px 2px 2px; background: var(--metal); transform-origin: bottom; transform: scaleY(0); transition: transform 600ms var(--ease-out); transition-delay: calc(var(--k, 0) * 50ms); }
.bars.in .bar-fill i { transform: scaleY(1); }
.bar small { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; }
.bar b { font-size: 0.78rem; font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .bar-fill i { transform: none; transition: none; } }

.list-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.75rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list-row:first-of-type { border-top: 0; }
.list-row .when { width: 84px; flex: none; }
.list-row .when b { display: block; font: 500 1.1rem var(--serif); }
.list-row .when small { color: var(--muted); }
.list-row .what { flex: 1; min-width: 160px; display: grid; }
.list-row .what span { color: var(--muted); font-size: 0.88rem; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.member { display: grid; gap: 0.75rem; justify-items: center; text-align: center; padding: 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.member img { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; border: 1px solid var(--line-strong); }
.member h3 { font: 500 1.25rem var(--serif); }
.member p { color: var(--muted); font-size: 0.9rem; }

.hrow { display: grid; grid-template-columns: 1fr 44px 120px 120px; gap: 0.6rem; align-items: center; }
.hrow .input { min-height: 40px; padding: 0.4rem 0.6rem; }
@media (max-width: 520px) { .hrow { grid-template-columns: 1fr 44px; } .hrow .input { grid-column: auto; } }
.form-grid { display: grid; gap: 1rem; max-width: 640px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.photo-pick { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.photo-pick img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: var(--card-2); border: 1px solid var(--line-strong); }
.photo-pick input[type="file"] { max-width: 100%; font-size: 0.85rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 0.7rem; cursor: pointer; }
.copy-box { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.copy-box .input { flex: 1; min-width: 220px; }
.link-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 0.6rem; margin-bottom: 0.6rem; }
@media (max-width: 620px) { .link-row { grid-template-columns: 1fr auto; } .link-row .input:nth-child(2) { grid-column: 1; } }

/* ---------- janela ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); width: min(560px, calc(100vw - 24px)); max-width: none; opacity: 0; transform: translateY(8px) scale(0.97);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete; }
dialog[open] { opacity: 1; transform: none; }
@starting-style { dialog[open] { opacity: 0; transform: translateY(8px) scale(0.97); } }
dialog::backdrop { background: rgba(10, 16, 12, 0.7); backdrop-filter: blur(4px); opacity: 0; transition: opacity 200ms ease, overlay 200ms allow-discrete, display 200ms allow-discrete; }
dialog[open]::backdrop { opacity: 1; }
@starting-style { dialog[open]::backdrop { opacity: 0; } }
.dlg-card { display: grid; gap: 1.1rem; padding: 1.4rem; max-height: calc(100dvh - 24px); overflow: auto; background: var(--card-2); border: 1px solid var(--line-strong); border-radius: 22px; }
.dlg-card > header { display: flex; justify-content: space-between; align-items: center; }
.dlg-card h3 { font: 500 1.4rem var(--serif); }
.dlg-body { display: grid; gap: 1rem; }
.dlg-card > footer { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { dialog { transform: none; } @starting-style { dialog[open] { transform: none; } } }
