/* Componentes do painel e do app da cliente */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-ui); font-size: 16px; line-height: 1.5; color: var(--foreground); background: var(--background); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.ic { width: 20px; height: 20px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

.wordmark { font-family: var(--font-script); color: var(--primary); font-weight: 400; line-height: 1; letter-spacing: .01em; white-space: nowrap; }
.wordmark .amp { color: var(--accent); }
.wordmark small { display: block; font-family: var(--font-display); font-style: italic; font-size: .32em; color: var(--muted-foreground); letter-spacing: .08em; margin-top: .15em; text-align: center; }

/* botões */
.btn { --bg: var(--card); --fg: var(--foreground); --bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-pill);
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-smooth-out), transform var(--duration-quick) var(--ease-out), box-shadow var(--duration-fast) var(--ease-smooth-out), border-color var(--duration-fast); }
.btn:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.97); }
.btn-primary { --bg: var(--primary); --fg: var(--on-primary); --bd: var(--primary); }
.btn-primary:hover { --bg: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { --bg: transparent; --bd: transparent; }
.btn-ghost:hover { --bg: var(--muted); border-color: transparent; box-shadow: none; }
.btn-danger { --fg: var(--destructive); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: var(--muted-foreground); position: relative; transition: background var(--duration-quick); }
.icon-btn:hover { background: var(--muted); color: var(--foreground); }

/* campos */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 14px; font-weight: 600; color: var(--foreground); }
.field small { color: var(--muted-foreground); font-size: 13px; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); font-size: 16px; transition: border-color var(--duration-quick), box-shadow var(--duration-quick); }
.field textarea { min-height: 88px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-soft); }
[aria-invalid="true"] { border-color: var(--destructive) !important; }
.field-err { color: var(--destructive); font-size: 13px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* erro (12-error-state-shake) */
.shake { animation: shake 320ms var(--ease-in-out); }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(calc(-1 * var(--distance-base))); } 40% { transform: translateX(var(--distance-base)); } 60% { transform: translateX(calc(-1 * var(--distance-small))); } 80% { transform: translateX(var(--distance-small)); } }

/* cartões */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h2, .card-h h3 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted-foreground); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.b-ok { background: var(--success-soft); color: var(--success); }
.b-warn { background: var(--warning-soft); color: var(--warning); }
.b-danger { background: var(--destructive-soft); color: var(--destructive); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-accent { background: var(--accent-soft); color: var(--primary); }
.b-muted { background: var(--muted); color: var(--muted-foreground); }
.b-sage { background: var(--sage-soft); color: #4C6447; }

/* tabela */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #FDFBFA; white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--duration-quick); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: #FCF7F6; }
.t-right { text-align: right; }

/* estado vazio */
.empty { text-align: center; padding: 36px 16px; color: var(--muted-foreground); }
.empty .ic { width: 36px; height: 36px; color: var(--accent); margin: 0 auto 10px; }
.empty b { display: block; color: var(--foreground); margin-bottom: 4px; }

/* skeleton (14-skeleton-reveal) */
.skel { background: linear-gradient(90deg, var(--muted) 25%, #f9f3f1 50%, var(--muted) 75%); background-size: 200% 100%; animation: skel 1.2s linear infinite; border-radius: 8px; min-height: 16px; }
@keyframes skel { to { background-position: -200% 0; } }
.reveal { animation: reveal var(--duration-slow) var(--ease-in-out) both; }
@keyframes reveal { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }

/* modal (06-modal) */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(42, 29, 33, .42); opacity: 0; transition: opacity var(--duration-fast) var(--ease-smooth-out); }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); opacity: 0; transform: scale(var(--scale-large)); transition: opacity var(--duration-fast) var(--ease-smooth-out), transform var(--duration-fast) var(--ease-smooth-out); }
.modal-wide { width: min(820px, 100%); }
.modal-wrap.open .modal-backdrop { opacity: 1; }
.modal-wrap.open .modal { opacity: 1; transform: none; }
.modal-wrap.closing .modal-backdrop, .modal-wrap.closing .modal { transition-duration: var(--duration-quick); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 22px; border-bottom: 1px solid var(--border); }
.modal-h h2 { flex: 1; font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.modal-b { padding: 18px 22px; overflow-y: auto; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 620px) { .modal-wrap { place-items: end center; padding: 0; } .modal { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92dvh; } .modal-f .btn { flex: 1; } }

/* toast (22-toast) */
#toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--foreground); color: #fff; box-shadow: var(--shadow-lg); font-size: 15px; font-weight: 600; opacity: 0; transform: translateY(var(--distance-base)) scale(.98); transition: opacity var(--duration-fast) var(--ease-smooth-out), transform var(--duration-fast) var(--ease-smooth-out); }
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateY(4px); transition-duration: var(--duration-quick); }
.toast-ok .ic { color: #9FD8B3; }
.toast-erro { background: var(--destructive); }

/* abas (16-tabs-sliding) */
.tabs { position: relative; display: inline-flex; gap: 2px; padding: 4px; background: var(--muted); border-radius: var(--radius-pill); flex-wrap: wrap; }
.tabs button { position: relative; z-index: 1; min-height: 36px; padding: 0 14px; border: 0; background: transparent; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; color: var(--muted-foreground); cursor: pointer; transition: color var(--duration-fast); }
.tabs button[aria-selected="true"] { color: var(--foreground); background: var(--card); box-shadow: var(--shadow-sm); }

/* calendário */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-hd { background: #FDFBFA; padding: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted-foreground); text-align: center; }
.cal-d { min-width: 0; background: var(--card); min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; border: 0; text-align: left; transition: background var(--duration-quick); }
.cal-d:hover { background: #FCF7F6; }
.cal-d.out { background: #FBF8F7; color: #B9A9AE; }
.cal-d.sel { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-d .n { font-size: 13px; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-d.today .n { background: var(--primary); color: #fff; }
.ev { font-size: 11.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-prova { background: var(--accent-soft); color: var(--primary); }
.ev-ret { background: var(--info-soft); color: var(--info); }
.ev-dev { background: var(--sage-soft); color: #4C6447; }
.ev-evento { background: #F6EBD9; color: #7A5524; }
.ev-more { font-size: 11px; color: var(--muted-foreground); padding-left: 4px; }
@media (max-width: 760px) { .cal-d { min-height: 64px; } .ev { font-size: 0; height: 6px; padding: 0; border-radius: 3px; } .ev-more { display: none; } }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted-foreground); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* slots de horário */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); font-weight: 700; cursor: pointer; transition: all var(--duration-quick); }
.slot:hover:not(:disabled) { border-color: var(--primary); }
.slot[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.slot:disabled { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.day { flex: none; width: 64px; min-height: 72px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: all var(--duration-quick); }
.day b { font-size: 20px; }
.day span { font-size: 12px; text-transform: uppercase; color: var(--muted-foreground); font-weight: 700; }
.day[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.day[aria-pressed="true"] span { color: #F4E3E5; }
.day:disabled { opacity: .4; cursor: not-allowed; }

/* sucesso (10-success-check) */
.success { text-align: center; padding: 18px 6px; }
.success .disc { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; animation: pop var(--duration-very-slow) var(--ease-bounce) both; }
.success .disc .ic { width: 36px; height: 36px; stroke-width: 2.4; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw var(--duration-very-slow) var(--ease-smooth-out) 120ms forwards; }
@keyframes pop { from { transform: scale(.6); opacity: 0; filter: blur(8px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success h3 { font-family: var(--font-display); font-size: 26px; margin-bottom: 6px; }

.demo-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--warning); background: var(--warning-soft); padding: 4px 10px; border-radius: var(--radius-pill); }
.thumb { width: 44px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--primary); font-weight: 800; font-size: 14px; flex: none; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14.5px; }
.dl dt { color: var(--muted-foreground); }
.dl dd { margin: 0; font-weight: 600; }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }
.ic.inline { width: 14px; height: 14px; vertical-align: -2px; color: var(--gold); fill: currentColor; }
