:root {
  --brand: #e0673a;
  --brand-ink: #fff;
  --bg: #f5f6f8;
  --card: #fff;
  --ink: #161b24;
  --ink-2: #5d6676;
  --ink-3: #8b93a1;
  --line: #e6e8ec;
  --ok: #1f9d63;
  --warn: #d98a12;
  --bad: #d64545;
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --soft: color-mix(in srgb, var(--brand) 12%, #fff);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; }
::selection { background: var(--brand); color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

/* lateral */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; }
.biz { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.biz strong { display: block; font-size: 15px; line-height: 1.2; }
.biz small { color: var(--ink-3); font-size: 12px; }
.logo { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
nav { display: grid; gap: 2px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
nav a svg { width: 19px; height: 19px; flex: none; }
nav a:hover { background: var(--bg); color: var(--ink); }
nav a.on { background: var(--soft); color: var(--brand); }
nav a .pill { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 1px 7px; }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.export { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; border-radius: 11px; border: 1px dashed color-mix(in srgb, var(--brand) 55%, #fff); background: var(--soft); color: var(--brand); font-weight: 600; cursor: pointer; transition: transform .15s var(--ease); }
.export:hover { transform: translateY(-1px); }
.export svg { width: 18px; height: 18px; }
.by { color: var(--ink-3); font-size: 11.5px; text-align: center; }
.by a { color: inherit; }

/* topo */
main { min-width: 0; }
header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
header.top h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.top-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.menu { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.menu svg { width: 22px; height: 22px; }
.view { padding: 6px 28px 40px; animation: in .35s var(--ease); }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }

/* blocos */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--brand); color: var(--brand-ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; transition: transform .15s var(--ease), filter .15s; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.sec { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn svg { width: 17px; height: 17px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card h3 svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.card h3 small { margin-left: auto; color: var(--ink-3); font-weight: 400; }
.kpi small { color: var(--ink-2); font-size: 13px; }
.kpi b { display: block; font-size: 26px; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12.5px; color: var(--ok); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
.muted { color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tag.ok { background: #e3f5ec; color: var(--ok); }
.tag.warn { background: #fdf1de; color: #a8660a; }
.tag.bad { background: #fbe5e5; color: var(--bad); }
.tag.info { background: var(--soft); color: var(--brand); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* agenda */
.days { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.days button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 12px; cursor: pointer; white-space: nowrap; color: var(--ink-2); }
.days button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sched { display: grid; grid-template-columns: 54px repeat(var(--cols), minmax(150px, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.sched .h { position: sticky; top: 0; background: #fff; padding: 12px 10px; font-weight: 600; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; z-index: 1; }
.av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--c, var(--brand)); flex: none; }
.sched .hr { font-size: 12px; color: var(--ink-3); padding: 4px 8px; border-top: 1px solid var(--line); height: 64px; }
.sched .slot { border-top: 1px solid var(--line); border-left: 1px solid var(--line); height: 64px; padding: 4px; }
.appt { height: 100%; border-radius: 9px; padding: 6px 9px; background: color-mix(in srgb, var(--c) 12%, #fff); border-left: 3px solid var(--c); font-size: 12.5px; line-height: 1.3; cursor: pointer; transition: transform .15s var(--ease); overflow: hidden; }
.appt:hover { transform: scale(1.02); }
.appt b { display: block; font-size: 13px; }
.appt .st { font-size: 11px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.appt.new { animation: pop .6s var(--ease); }
@keyframes pop { from { transform: scale(.8); opacity: 0; } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 25%, transparent); } }
.free { height: 100%; border-radius: 9px; border: 1px dashed transparent; display: grid; place-items: center; color: transparent; font-size: 12px; cursor: pointer; transition: all .15s; }
.free:hover { border-color: var(--line); color: var(--ink-3); }

/* listas */
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.click { cursor: pointer; transition: background .15s; }
.row.click:hover { background: var(--bg); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { display: block; }
.who small { color: var(--ink-2); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 14px; border-top: 1px solid var(--line); }
th { font-size: 12.5px; color: var(--ink-2); font-weight: 600; background: #fafbfc; border-top: 0; }
td.n, th.n { text-align: right; }
tfoot td { font-weight: 700; background: #fafbfc; }
.search { width: 100%; max-width: 360px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; margin-bottom: 14px; background: #fff; }

/* ficha */
.ficha { display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; }
.prog { height: 10px; border-radius: 99px; background: var(--bg); overflow: hidden; margin: 10px 0 6px; }
.prog i { display: block; height: 100%; background: var(--brand); border-radius: inherit; width: 0; transition: width 1s var(--ease); }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos div { aspect-ratio: 1; border-radius: 10px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 30%, #fff), color-mix(in srgb, var(--brand) 8%, #fff)); display: grid; place-items: end start; padding: 6px; font-size: 11px; color: var(--ink-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line); margin-left: 4px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline small { color: var(--ink-3); display: block; }

/* mensagens */
.msg { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; }
.msg .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #e3f5ec; color: var(--ok); }
.msg .ic svg { width: 18px; height: 18px; }
.bubble { background: #e9fbe5; border-radius: 4px 12px 12px 12px; padding: 8px 12px; margin-top: 6px; font-size: 13.5px; max-width: 520px; }

/* modal */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(460px, 92vw); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .4); }
dialog[open] { animation: in .3s var(--ease); }
dialog::backdrop { background: rgb(16 20 28 / .45); backdrop-filter: blur(2px); }
.mbody { padding: 22px; }
.mbody h2 { margin: 0 0 4px; font-size: 19px; }
.field { display: grid; gap: 5px; margin-top: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field select, .field input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.mfoot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.pix { display: grid; place-items: center; gap: 10px; text-align: center; padding: 8px 0; }
.qr { width: 180px; height: 180px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.paid { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; animation: pop .6s var(--ease); }
.paid svg { width: 36px; height: 36px; }

/* avisos */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 11px 14px; border-radius: 12px; box-shadow: 0 16px 40px -14px rgb(0 0 0 / .5); animation: tin .45s var(--ease); font-size: 14px; max-width: 360px; }
.toast .d { width: 8px; height: 8px; border-radius: 50%; background: #35d08a; flex: none; }
.toast.out { animation: tout .3s ease forwards; }
@keyframes tin { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes tout { to { opacity: 0; transform: translateX(20px); } }

@media (max-width: 980px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .grid2, .ficha { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 260px; transform: translateX(-105%); transition: transform .3s var(--ease); box-shadow: 0 0 60px rgb(0 0 0 / .25); }
  .side.open { transform: none; }
  .menu { display: block; }
  header.top, .view { padding-left: 16px; padding-right: 16px; }
  .top-right .btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* painel vivo */
.stagger > * { animation: rise .6s var(--ease) backwards; }
.stagger > :nth-child(2) { animation-delay: .07s; } .stagger > :nth-child(3) { animation-delay: .14s; } .stagger > :nth-child(4) { animation-delay: .21s; }
.stagger > :nth-child(5) { animation-delay: .28s; } .stagger > :nth-child(6) { animation-delay: .35s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.flash-in { animation: flash-in 1.6s var(--ease); }
@keyframes flash-in { 0% { background: color-mix(in srgb, var(--ok) 22%, #fff); transform: translateX(-6px); } 30% { transform: none; } }
.card.pulse { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 35%, transparent); transition: box-shadow .3s; }
.card { transition: box-shadow .6s; }
.dot-live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 5px; vertical-align: 1px; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* splash */
.splash { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); opacity: 0; transition: opacity .3s; }
.splash.on { opacity: 1; }
.splash::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px circle at 50% 40%, rgb(255 255 255 / .28), transparent 70%); }
.splash.out { animation: sp-out .8s var(--ease) forwards; }
@keyframes sp-out { to { clip-path: circle(0% at 50% 45%); } }
.sp-in { position: relative; display: grid; justify-items: center; gap: 14px; text-align: center; padding: 20px; }
.sp-logo { width: 104px; height: 104px; border-radius: 30px; font-size: 38px; background: rgb(255 255 255 / .18); color: inherit; box-shadow: 0 30px 60px -20px rgb(0 0 0 / .35), inset 0 0 0 1px rgb(255 255 255 / .3); animation: sp-logo 1s var(--ease) backwards; }
@keyframes sp-logo { from { transform: scale(.4) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.08); } }
.splash.on .sp-logo { animation: sp-logo 1s var(--ease) backwards, sp-pulsa 1.4s 1s ease-in-out infinite; }
@keyframes sp-pulsa { 50% { transform: scale(1.1); box-shadow: 0 40px 80px -20px rgb(0 0 0 / .4), inset 0 0 0 1px rgb(255 255 255 / .45), 0 0 0 14px rgb(255 255 255 / .12); } }
.sp-name { font-size: clamp(26px, 5vw, 40px); font-weight: 700; letter-spacing: -.02em; animation: rise .8s .25s var(--ease) backwards; }
.sp-bar { width: 220px; height: 5px; border-radius: 5px; background: rgb(255 255 255 / .25); overflow: hidden; animation: rise .6s .4s var(--ease) backwards; }
.sp-bar i { display: block; height: 100%; width: 0; background: currentColor; border-radius: inherit; transition: width 2.2s cubic-bezier(.4, 0, .2, 1); }
.splash.on .sp-bar i { width: 100%; }
.sp-step { font-size: 14px; opacity: .85; min-height: 1.4em; animation: rise .6s .5s var(--ease) backwards; }
.sp-by { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; font-size: 12px; opacity: .7; }

body:not(.pronto) .shell { visibility: hidden; }

.btn.sm { margin-left: auto; padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.sm svg { width: 15px; height: 15px; }

/* avisos fora do cantinho do Ali */
.toasts { right: 112px; }
@media (max-width: 760px) { .toasts { right: 12px; left: 84px; bottom: 12px; } .toast { max-width: none; } }
