/* ===========================================================
   Cliniclic — Live product UI mockups (recreated in HTML)
   Mirrors the real app: dark navy sidebar, weekly agenda,
   status-colored cards, prontuário com IA, financeiro.
   =========================================================== */

.app {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  font-size: 13px;
  color: var(--ink);
  width: 100%;
}
.app--tilt { transform: perspective(2200px) rotateY(-8deg) rotateX(2deg); transform-origin: left center; }

/* Topbar */
.app__top { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.app__clinic { font-weight: 700; font-size: 14px; color: var(--ink); }
.app__search {
  margin-left: 14px; flex: 1; max-width: 340px; display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px;
  color: var(--muted); font-size: 12.5px;
}
.app__search svg { width: 15px; height: 15px; }
.app__user { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.app__avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--cyan-soft); color: var(--teal); display: grid; place-items: center; font-weight: 700; font-size: 11px; }

/* Body = sidebar + content */
.app__body { display: flex; min-height: 0; }
.app__rail { width: 56px; flex: none; background: var(--navy-900); padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.app__rail .logo { width: 30px; height: 28px; margin-bottom: 10px; }
.rail-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: hsl(210 30% 72%); }
.rail-ic svg { width: 19px; height: 19px; }
.rail-ic.active { background: var(--navy); color: #fff; }
.rail-ic:not(.active):hover { background: hsl(222 40% 18%); color: #fff; }

.app__main { flex: 1; min-width: 0; display: flex; }

/* Left planner column (mini cal + filters) */
.planner { width: 196px; flex: none; border-right: 1px solid var(--line-soft); padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.planner__toolbar { display: flex; align-items: center; gap: 7px; }
.chip { font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); background: #fff; }
.chip--solid { background: var(--navy); color: #fff; border-color: var(--navy); }

.minical { }
.minical__head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 12.5px; margin-bottom: 8px; }
.minical__head .nav-arrow { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.minical__head .nav-arrow:hover { background: var(--bg-2); }
.minical__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.minical__grid .dow { font-size: 9.5px; color: var(--muted); font-weight: 700; padding: 3px 0; }
.minical__grid .day { font-size: 10.5px; color: var(--ink-2); padding: 4px 0; border-radius: 6px; }
.minical__grid .day.muted { color: hsl(214 20% 78%); }
.minical__grid .day.today { background: var(--navy); color: #fff; font-weight: 700; }

.filters { border-top: 1px solid var(--line-soft); padding-top: 12px; display: grid; gap: 10px; }
.filters__title { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.filters__title svg { width: 13px; height: 13px; }
.field label { font-size: 11px; color: var(--muted); font-weight: 600; display: block; margin-bottom: 4px; }
.field .sel { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 11.5px; color: var(--ink-2); font-weight: 500; }
.field .sel svg { width: 13px; height: 13px; color: var(--muted); }
.filters__clear { font-size: 11.5px; color: var(--navy); font-weight: 600; }

/* Calendar grid */
.cal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal__head { display: grid; grid-template-columns: 44px repeat(5, 1fr); border-bottom: 1px solid var(--line-soft); }
.cal__corner { border-right: 1px solid var(--line-soft); }
.cal__dcol { padding: 9px 6px; text-align: center; border-right: 1px solid var(--line-soft); }
.cal__dcol .dow { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.cal__dcol .dnum { font-size: 16px; font-weight: 800; color: var(--ink); margin-top: 2px; }
.cal__dcol.is-today { background: hsl(224 64% 97%); }
.cal__dcol.is-today .dnum { color: #fff; background: var(--navy); width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; margin: 2px auto 0; }
.cal__dcol.is-today .dow { color: var(--navy); }

.cal__body { position: relative; display: grid; grid-template-columns: 44px repeat(5, 1fr); }
.cal__times { border-right: 1px solid var(--line-soft); }
.cal__time { height: 46px; font-size: 10px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; position: relative; }
.cal__col { border-right: 1px solid var(--line-soft); position: relative; }
.cal__col .slot { height: 46px; border-bottom: 1px solid var(--line-soft); }

/* appointment event */
.evt {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 4px;
  padding: 5px 7px 5px 8px;
  font-size: 11px;
  overflow: hidden;
  background: #fff;
  border: 1px solid hsl(214 32% 91%);
  border-left: 4px solid var(--c, var(--navy));
  box-shadow: 0 1px 3px rgb(15 23 42 / .07), 0 1px 2px rgb(15 23 42 / .04);
}
.evt__head { display: flex; align-items: center; gap: 5px; min-width: 0; }
.evt__ic { flex: none; display: grid; place-items: center; color: var(--c, var(--navy)); line-height: 0; }
.evt__ic svg { width: 13px; height: 13px; }
.evt__name {
  font-weight: 700;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evt__type { margin-top: 2px; font-size: 10px; color: var(--muted); font-weight: 500; line-height: 1.25; }
.evt__time { font-size: 10px; color: var(--ink-2); font-weight: 600; line-height: 1.25; }
.evt--blue   { --c: hsl(224 64% 48%); }
.evt--teal   { --c: hsl(173 58% 39%); }
.evt--green  { --c: hsl(142 64% 40%); }
.evt--amber  { --c: hsl(38 92% 48%); }
.evt--purple { --c: hsl(255 58% 58%); }
.evt--red    { --c: hsl(0 78% 55%); }

.nowline { position: absolute; left: 44px; right: 0; height: 2px; background: var(--danger); z-index: 4; }
.nowline::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* Agenda section — demo animado (criar + reorganizar) */
.agenda-demo-wrap {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  max-width: 100%;
}
.agenda-demo-desktop { display: block; }
.agenda-demo-mobile { display: none; }
@media (max-width: 980px) {
  .agenda-demo-desktop { display: none; }
  .agenda-demo-mobile { display: block; }
}
.agenda-demo__stage {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.ag-demo-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
}
.ag-demo-dim {
  position: absolute;
  inset: 0;
  background: hsl(222 47% 8% / .72);
  opacity: 0;
  transition: opacity .35s ease;
}
.ag-demo-dim.is-on { opacity: 1; }
.ag-demo-cursor {
  position: absolute;
  left: 0; top: 0;
  width: 16px; height: 21px;
  z-index: 120;
  opacity: 0;
  transform: none;
  transform-origin: 0 0;
  transition: left .42s cubic-bezier(.4, 0, .2, 1), top .42s cubic-bezier(.4, 0, .2, 1), opacity .2s ease, transform .12s ease;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 21' width='16' height='21'%3E%3Cpath d='M0 0v16l4-4 3 8 2-1-3-7h6z' fill='%23000'/%3E%3Cpath d='M1 1v13.5l3-3 2.4 6.4 1.2-.6-2.4-6.4h4.8z' fill='%23fff'/%3E%3C/svg%3E") no-repeat 0 0 / contain;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / .25));
}
.ag-demo-cursor.is-on { opacity: 1; }
.ag-demo-cursor.is-click { transform: scale(.88); }
.ag-demo-cursor::before { content: none; }
.ag-demo-time-pill {
  position: absolute;
  z-index: 25;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity .2s ease;
  white-space: nowrap;
}
.ag-demo-time-pill.is-on { opacity: 1; }
.ag-demo-slot-preview {
  position: absolute;
  z-index: 8;
  border: 2px dashed hsl(224 64% 48%);
  border-radius: 6px;
  background: hsl(224 64% 97% / .92);
  padding: 8px 10px;
  opacity: 0;
  transform: scale(.96);
  transition: opacity .25s ease, transform .25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.ag-demo-slot-preview.is-on { opacity: 1; transform: scale(1); }
.ag-demo-slot-preview__time { font-size: 10.5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.ag-demo-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.ag-demo-overlay.is-on { opacity: 1; visibility: visible; }
.ag-demo-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(290px, calc(100% - 24px));
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -46%) scale(.97);
  transition: opacity .28s ease, transform .28s ease, visibility .28s ease;
  pointer-events: none;
}
.ag-demo-modal.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.ag-demo-modal--stack { z-index: 2; }
.ag-demo-modal .modal__head .sub { line-height: 1.45; }
.ag-demo-block-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; margin-top: 2px;
  padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.ag-demo-block-btn svg { width: 14px; height: 14px; color: var(--muted); }
.ag-demo-drop {
  position: absolute;
  left: 0;
  top: 0;
  width: min(260px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-float);
  padding: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .22s ease, transform .22s ease;
  z-index: 3;
}
.ag-demo-drop.is-on { opacity: 1; transform: none; }
.ag-demo-drop__add {
  padding: 9px 11px;
  border: 1.5px dashed hsl(224 64% 48%);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.ag-demo-drop__item {
  padding: 9px 11px;
  border-radius: 8px;
  cursor: default;
}
.ag-demo-drop__item strong { display: block; font-size: 12.5px; color: var(--ink); }
.ag-demo-drop__item small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ag-demo-radio {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-2); font-weight: 600;
}
.ag-demo-radio label {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line);
}
.ag-demo-radio label.on { border-color: var(--navy); color: var(--navy); background: hsl(224 64% 97%); }
.ag-demo-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-2); font-weight: 600;
}
.ag-demo-hit,
.ag-demo-hit.inp,
[data-ag-field].ag-demo-hit .inp {
  outline: 2px solid hsl(224 64% 48%);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px hsl(224 64% 48% / .18);
}
.ag-demo-drop__add.ag-demo-hit,
.ag-demo-drop__item.ag-demo-hit {
  background: hsl(224 64% 97%);
}
.btn.ag-demo-hit {
  box-shadow: 0 0 0 4px hsl(224 64% 48% / .22);
  outline: 2px solid hsl(224 64% 48%);
  outline-offset: 2px;
}
.ag-demo-evt {
  position: absolute;
  z-index: 15;
  opacity: 0;
  visibility: hidden;
  transition: left .55s cubic-bezier(.4, 0, .2, 1), top .55s cubic-bezier(.4, 0, .2, 1),
    width .55s ease, height .45s ease, opacity .3s ease;
  cursor: default;
}
.ag-demo-evt.is-on { opacity: 1; visibility: visible; }
.ag-demo-evt.is-editing {
  border: 2px dashed hsl(224 64% 48%);
  border-left: 4px solid var(--c, var(--navy));
  box-shadow: 0 8px 22px -8px rgb(15 23 42 / .28);
}
.ag-demo-evt__handle {
  position: absolute;
  left: 50%; bottom: -1px;
  transform: translateX(-50%);
  width: 28px; height: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 7px;
  color: var(--ink);
  letter-spacing: -1px;
}
.ag-demo-evt.is-editing .ag-demo-evt__handle { display: flex; }
.ag-demo-resize-tip {
  position: absolute;
  z-index: 18;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transition: opacity .15s ease;
  white-space: nowrap;
  pointer-events: none;
}
.ag-demo-resize-tip.is-on { opacity: 1; }
@media (max-width: 980px) {
  .ag-demo-modal { width: min(272px, calc(100% - 16px)); }
  .ag-demo-drop { width: min(248px, calc(100% - 20px)); }
  .ag-demo-slot-preview { padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .ag-demo-cursor, .ag-demo-evt, .ag-demo-modal, .ag-demo-drop, .ag-demo-slot-preview, .ag-demo-dim { transition: none; }
}

/* Legacy spotlight (unused) */
.agenda-spotlight {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  max-width: 100%;
}
.agenda-spotlight__app { position: relative; z-index: 1; }
.agenda-spotlight__dim {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: var(--r-lg);
  background: hsl(222 47% 8% / .72);
  pointer-events: none;
  transition: opacity .35s ease;
}
.agenda-spotlight__modal {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  animation: modalSpotlight 2.8s ease-in-out infinite;
}
.agenda-spotlight__modal .modal {
  box-shadow:
    0 30px 70px -18px rgb(15 23 42 / .55),
    0 12px 28px -10px rgb(15 23 42 / .25);
}
@keyframes modalSpotlight {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .agenda-spotlight__modal { animation: none; }
}

/* Floating "Novo agendamento" modal */
.modal {
  width: 290px; background: #fff; border-radius: var(--r); border: none;
  box-shadow: var(--shadow-float); overflow: hidden;
}
.modal__head { padding: 16px 18px 10px; }
.modal__head .title { font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; }
.modal__head .title .x { color: var(--muted); }
.modal__head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal__body { padding: 4px 18px 14px; display: grid; gap: 11px; }
.mfield label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 5px; }
.mfield label .req { color: var(--danger); }
.mfield .inp { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: 12.5px; color: var(--ink); background: #fff; }
.mfield .inp.placeholder { color: var(--muted); }
.mfield .inp svg { width: 14px; height: 14px; color: var(--muted); }
.mfield-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal__foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 10px; }

/* Prontuário com IA */
.pront { display: grid; grid-template-columns: 1fr 1fr; }
.pront__head { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.pront__back { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pront__pt { font-weight: 800; font-size: 15px; }
.pront__pt small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.rec-timer { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.rec-wave { display: flex; align-items: center; gap: 8px; background: var(--cyan-soft); color: var(--teal); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: recpulse 1.4s ease-in-out infinite; }
@keyframes recpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.pront__col { padding: 18px; }
.pront__col + .pront__col { border-left: 1px solid var(--line-soft); }
.pront__label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--teal); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.pront__label .upd { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; letter-spacing: 0; text-transform: none; color: var(--muted); font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.pront__label .upd svg { width: 11px; height: 11px; }

.transcript { display: grid; gap: 14px; }
.t-turn { display: grid; grid-template-columns: 38px 1fr; gap: 8px; }
.t-time { font-size: 10.5px; color: var(--teal); font-weight: 700; padding-top: 2px; }
.t-who { font-weight: 700; font-size: 12px; }
.t-text { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin-top: 2px; }
.t-live { margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--teal); font-weight: 600; background: var(--cyan-soft); border-radius: 999px; padding: 7px 13px; }

.chart h6 { font-size: 12.5px; font-weight: 800; color: var(--ink); margin: 0 0 4px; }
.chart .blk { margin-bottom: 14px; }
.chart p { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.chart ul { margin: 4px 0 0; padding-left: 16px; }
.chart li { font-size: 12px; color: var(--ink-2); line-height: 1.55; }

/* waveform */
.wave { display: flex; align-items: center; gap: 2px; height: 22px; }
.wave i { width: 2.5px; border-radius: 2px; background: var(--teal); opacity: .7; animation: waveb 1.1s ease-in-out infinite; }
@keyframes waveb { 0%,100% { height: 5px; } 50% { height: 20px; } }

/* Financeiro mini panel */
.fin { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-float); padding: 20px; width: 300px; }
.fin__head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.fin__ic { width: 38px; height: 38px; border-radius: 11px; background: var(--navy-900); color: #fff; display: grid; place-items: center; }
.fin__ic svg { width: 19px; height: 19px; }
.fin__head h6 { font-size: 15px; font-weight: 800; margin: 0; }
.fin__head small { color: var(--muted); font-size: 11.5px; }
.fin__row { border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; }
.fin__row .lab { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.fin__row .lab .tag { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.fin__row .lab .tag svg { width: 14px; height: 14px; }
.fin__row .val { font-size: 21px; font-weight: 800; margin-top: 5px; letter-spacing: -.02em; }
.fin__row .note { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fin__row .note.up { color: var(--success); font-weight: 600; }

/* Settings / personalização mockup */
.settings { background: #fff; }
.settings__head { padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.settings__head h6 { font-size: 17px; font-weight: 800; margin: 0; }
.settings__head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.settings__body { padding: 18px 22px; display: grid; gap: 16px; }
.set-step { font-size: 12px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 9px; }
.set-step .n { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 11px; }
.dayrow { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.dayrow .dname { width: 74px; font-weight: 700; font-size: 13px; }
.toggle { width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: left .2s; }
.toggle.on { background: var(--navy); }
.toggle.on::after { left: 18px; }
.dayrow .state { font-size: 12.5px; font-weight: 600; color: var(--ink-2); width: 56px; }
.dayrow .state.off { color: var(--muted); }
.timepill { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.timepill svg { width: 13px; height: 13px; color: var(--muted); }
.dayrow .sep { color: var(--muted); font-size: 12px; }

/* Mobile hero agenda — visão de um dia */
.app--mobile-agenda .app__main--mobile {
  flex-direction: column;
  width: 100%;
}
.app--mobile-agenda .cal--mobile {
  flex: 1;
  width: 100%;
  min-width: 0;
}
.cal__head--mobile { grid-template-columns: 44px 1fr; }
.cal__body--mobile {
  grid-template-columns: 44px 1fr;
  overflow: hidden;
}
.cal--mobile .evt { padding: 4px 6px 4px 7px; }
.cal--mobile .evt__name { font-size: 10.5px; }
.cal--mobile .evt__type,
.cal--mobile .evt__time { font-size: 9.5px; }
.cal--mobile .evt__ic svg { width: 12px; height: 12px; }

@media (max-width: 640px) {
  .app--tilt { transform: none; }
  .planner { display: none; }
  .pront { grid-template-columns: 1fr; }
  .pront__col + .pront__col { border-left: 0; border-top: 1px solid var(--line-soft); }
  .app--mobile-agenda .app__search { display: none; }
  .app--mobile-agenda .app__clinic { font-size: 13px; }
}

/* ---------- Página de paciente ---------- */
.patient { padding: 20px 22px; }
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pp-id { display: flex; align-items: center; gap: 13px; }
.pp-avatar { width: 48px; height: 48px; border-radius: 14px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.pp-name { font-size: 17px; font-weight: 800; }
.pp-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pp-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--success); background: var(--success-bg); padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.pp-status svg { width: 14px; height: 14px; }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pp-info { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pp-info svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.pp-tags { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pp-tag { font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }
.pp-next { display: flex; align-items: center; gap: 13px; margin-top: 16px; background: hsl(224 64% 97%); border: 1px solid hsl(224 50% 90%); border-radius: 12px; padding: 13px 15px; }
.pp-next-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; flex: none; }
.pp-next-ic svg { width: 18px; height: 18px; }
.pp-next-lab { font-size: 11px; color: var(--navy); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pp-next-val { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.pp-next-tag { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--success); background: #fff; border: 1px solid var(--success-bg); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.pp-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--muted); margin: 20px 0 12px; }
.pp-timeline { display: grid; gap: 2px; }
.pp-hist { display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding: 9px 0; position: relative; }
.pp-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2.5px solid var(--teal); margin-top: 4px; position: relative; z-index: 1; }
.pp-hist:not(:last-child) .pp-dot::after { content: ""; position: absolute; left: 50%; top: 12px; width: 2px; height: 30px; background: var(--line); transform: translateX(-50%); }
.pp-hist-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pp-hist-top b { font-size: 13px; font-weight: 700; }
.pp-hist-top span { font-size: 11.5px; color: var(--muted); }
.pp-hist-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ---------- Status de agendamento ---------- */
.status-app { padding-bottom: 8px; }
.st-list { padding: 6px 12px 12px; display: grid; gap: 4px; }
.st-row { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 10px; }
.st-row:hover { background: var(--bg); }
.st-time { font-size: 12.5px; font-weight: 700; color: var(--ink-2); width: 42px; flex: none; font-variant-numeric: tabular-nums; }
.st-bar { width: 4px; height: 34px; border-radius: 4px; flex: none; }
.st-bar--green { background: var(--success); } .st-bar--blue { background: hsl(224 64% 55%); }
.st-bar--amber { background: var(--warning); } .st-bar--red { background: var(--danger); }
.st-bar--purple { background: var(--purple); }
.st-main { flex: 1; min-width: 0; }
.st-name { font-size: 13.5px; font-weight: 700; }
.st-proc { font-size: 12px; color: var(--muted); }
.st-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px; white-space: nowrap; flex: none; }
.st-badge svg { width: 14px; height: 14px; }
.st-badge--green { color: var(--success); background: var(--success-bg); }
.st-badge--blue { color: hsl(224 64% 45%); background: hsl(224 70% 96%); }
.st-badge--amber { color: hsl(38 80% 42%); background: var(--warning-bg); }
.st-badge--red { color: var(--danger); background: var(--danger-bg); }
.st-badge--purple { color: var(--purple); background: var(--purple-bg); }

/* ---------- Pagamentos ---------- */
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); }
.pay-kpi { padding: 18px 20px; border-right: 1px solid var(--line-soft); }
.pay-kpi:last-child { border-right: 0; }
.pay-kpi-lab { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pay-kpi-val { font-size: 22px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.pay-kpi-note { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pay-kpi-note.up { color: var(--success); font-weight: 700; }
.pay-list { padding: 6px 14px 14px; display: grid; gap: 4px; }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line-soft); }
.pay-row:last-child { border-bottom: 0; }
.pay-name { font-size: 13.5px; font-weight: 700; }
.pay-proc { font-size: 12px; color: var(--muted); margin-top: 1px; }
.pay-right { display: flex; align-items: center; gap: 12px; }
.pay-val { font-size: 14px; font-weight: 800; }
.pay-badge { font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.pay-badge--green { color: var(--success); background: var(--success-bg); }
.pay-badge--amber { color: hsl(38 80% 42%); background: var(--warning-bg); }
.pay-badge--blue { color: hsl(224 64% 45%); background: hsl(224 70% 96%); }
.pay-badge--red { color: hsl(0 72% 48%); background: var(--danger-bg); }

@media (max-width: 480px) {
  .pp-grid { grid-template-columns: 1fr; }
  .pay-summary { grid-template-columns: 1fr; }
  .pay-kpi { border-right: 0; border-bottom: 1px solid var(--line-soft); }
}

/* ---------- Logo img in dark rail ---------- */
.app__rail .logo { width: 30px; height: 28px; object-fit: contain; margin-bottom: 10px; }
.chip svg { width: 13px; height: 13px; }
.chip { display: inline-flex; align-items: center; gap: 5px; }
.wk-nav { gap: 4px; }

/* ---------- Página do paciente (pt2) ---------- */
.pt2 { padding: 16px 20px 22px; max-width: 560px; margin: 0 auto; }
.app__top--slim .tb-burger { display: grid; place-items: center; color: var(--ink-2); margin-right: 2px; }
.app__top--slim .tb-burger svg { width: 18px; height: 18px; }
.app__top--slim .app__search { max-width: none; flex: 1; }
.pt2-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pt2-back { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--ink); }
.pt2-back svg { width: 18px; height: 18px; }
.pt2-head h6 { font-size: 22px; font-weight: 800; margin: 0; }

/* Compact patient card (condensado) */
.pt2--compact { max-width: 520px; }
.ptc-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-card); }
.ptc-avatar { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; color: hsl(215 18% 60%); flex: none; }
.ptc-avatar svg { width: 22px; height: 22px; }
.ptc-id { flex: 1; min-width: 0; }
.ptc-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.ptc-meta { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptc-meta svg { width: 13px; height: 13px; flex: none; }
.ptc-actions { display: flex; gap: 7px; flex: none; }
.ptc-iconbtn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-2); }
.ptc-iconbtn svg { width: 16px; height: 16px; }
.pt2-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 5px; }
.pt2-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; font-weight: 650; color: var(--muted); padding: 11px 8px; border-radius: 9px; min-width: 0; }
.pt2-tab svg { width: 16px; height: 16px; flex: none; }
.pt2-tab__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt2-tab.on { background: #fff; color: var(--navy); border: 1px solid hsl(224 50% 86%); box-shadow: var(--shadow-card); }
.pt2--compact .pt2-tabs { margin-top: 12px; }
.pt2--compact .pt2-tab { padding: 9px 6px; font-size: 13px; }
.ptc-list { margin-top: 14px; }
.ptc-sec { font-size: 14px; font-weight: 800; margin-bottom: 10px; }
.ptc-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-card); margin-bottom: 7px;
}
.ptc-node { width: 24px; height: 24px; border-radius: 50%; background: hsl(224 64% 96%); color: var(--navy); display: grid; place-items: center; border: 1.5px solid hsl(224 50% 86%); flex: none; margin-top: 1px; }
.ptc-node svg { width: 12px; height: 12px; }
.ptc-row__body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ptc-row__line1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.ptc-row__line2 { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ptc-datetime { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ptc-date { font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.ptc-time { font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.2; }
.ptc-val { font-size: 13px; font-weight: 800; color: var(--ink); white-space: nowrap; flex: none; }
.pt2-st { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pt2-st--purple { color: var(--purple); background: var(--purple-bg); }
.pt2-st--green { color: var(--success); background: var(--success-bg); }
.pt2-st--amber { color: hsl(38 80% 40%); background: var(--warning-bg); }
.pt2-pay { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pt2-pay--green { color: var(--success); background: var(--success-bg); }
.pt2-pay--amber { color: var(--danger); background: var(--danger-bg); }

/* Painéis por aba — altura fixa, crossfade suave */
.ptc-panels {
  margin-top: 14px; position: relative; overflow: hidden;
  transition: height .5s cubic-bezier(.4, 0, .2, 1);
}
.ptc-panel {
  position: absolute; inset: 0; overflow: hidden;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .55s cubic-bezier(.4, 0, .2, 1), visibility .55s cubic-bezier(.4, 0, .2, 1);
  z-index: 0;
}
.ptc-panel.on { opacity: 1; visibility: visible; pointer-events: auto; z-index: 2; }
.ptc-panel.is-leaving { opacity: 0; z-index: 1; pointer-events: none; }
.ptc-list { margin-top: 0; }
.pt2-tab { transition: background .4s cubic-bezier(.4, 0, .2, 1), color .4s ease, border-color .4s ease, box-shadow .4s ease; }

/* Itens aparecem um a um dentro da aba */
.ptc-item {
  opacity: 0; transform: translateY(7px);
  transition: opacity .45s cubic-bezier(.4, 0, .2, 1), transform .45s cubic-bezier(.4, 0, .2, 1);
}
.ptc-item.is-visible { opacity: 1; transform: none; }

/* Prontuários */
.ptc-pront-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ptc-pront-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ptc-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  white-space: nowrap;
}
.ptc-btn svg { width: 14px; height: 14px; flex: none; }
.ptc-btn--primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.ptc-pront-list { display: grid; gap: 10px; }
.ptc-pront { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-card); background: #fff; }
.ptc-pront__head { display: flex; align-items: center; gap: 8px; }
.ptc-pront__chev { color: var(--muted); line-height: 0; flex: none; }
.ptc-pront__chev svg { width: 14px; height: 14px; }
.ptc-pront__meta { flex: 1; min-width: 0; font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ptc-pront__meta b { font-weight: 700; }
.ptc-pront__meta i { color: var(--muted); font-style: normal; }
.ptc-pront__meta span { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.ptc-pront__acts { display: flex; align-items: center; gap: 8px; color: var(--muted); flex: none; }
.ptc-pront__acts i { display: grid; place-items: center; line-height: 0; }
.ptc-pront__acts svg { width: 15px; height: 15px; }
.ptc-pront__body { margin-top: 8px; display: grid; gap: 4px; overflow: hidden; }
.ptc-pront__line {
  display: flex; gap: 6px; align-items: baseline; font-size: 11.5px; line-height: 1.4;
  color: var(--ink-2); min-width: 0;
}
.ptc-pront__line em {
  font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); flex: none; min-width: 22px;
}
.ptc-pront__line span {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; min-width: 0;
}
.ptc-pront__line:last-child span { -webkit-line-clamp: 1; }

/* Pagamentos — tabela desktop */
.ptc-pay-head { margin-bottom: 10px; }
.ptc-pay-head .ptc-sec b { color: var(--muted); font-weight: 700; }
.ptc-pay-table { border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: #fff; }
.ptc-paythr, .ptc-paytr {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.85fr 0.75fr 1fr 0.8fr 0.45fr;
  align-items: center; gap: 6px; padding: 9px 12px;
}
.ptc-paythr { background: var(--bg); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--muted); }
.ptc-paytr { border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--ink-2); }
.ptc-paytd--val { font-weight: 800; color: var(--ink); }
.ptc-paytd--meth { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.ptc-methdot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.ptc-methdot--green { background: var(--success); }
.ptc-methdot--navy { background: var(--navy); }
.ptc-pay-foot { margin-top: 8px; font-size: 11px; color: var(--muted); }
.ptc-pay-cards { display: none; gap: 7px; }
.ptc-paycard {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  box-shadow: var(--shadow-card); background: #fff;
}
.ptc-paycard__line1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ptc-paycard__date { font-size: 12px; font-weight: 700; color: var(--ink); }
.ptc-paycard__val { font-size: 12.5px; font-weight: 800; color: var(--ink); }
.ptc-paycard__line2 { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.ptc-paycard__meth { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-2); font-weight: 600; }
.ptc-paycard__sub { margin-top: 4px; font-size: 10px; color: var(--muted); font-weight: 600; }
.pay-badge { font-size: 10.5px; padding: 3px 8px; }

/* Página do paciente — visão mobile (mockup em coluna estreita) */
#mod-patient .app__top--slim .app__search { display: none; }
#mod-patient .pt2 { padding: 12px 12px 16px; max-width: none; }
#mod-patient .pt2-head { gap: 8px; margin-bottom: 12px; }
#mod-patient .pt2-head h6 { font-size: 17px; }
#mod-patient .pt2-back { width: 28px; height: 28px; }
#mod-patient .ptc-card { padding: 10px 11px; gap: 10px; border-radius: 12px; }
#mod-patient .ptc-avatar { width: 36px; height: 36px; }
#mod-patient .ptc-avatar svg { width: 18px; height: 18px; }
#mod-patient .ptc-name { font-size: 15px; }
#mod-patient .ptc-meta { font-size: 11px; white-space: normal; line-height: 1.35; }
#mod-patient .ptc-iconbtn { width: 30px; height: 30px; }
#mod-patient .ptc-sec { font-size: 12.5px; margin-bottom: 8px; }
#mod-patient .ptc-row { padding: 8px 9px; gap: 7px; margin-bottom: 6px; }
#mod-patient .ptc-node { width: 22px; height: 22px; }
#mod-patient .ptc-node svg { width: 11px; height: 11px; }
#mod-patient .ptc-date { font-size: 11.5px; }
#mod-patient .ptc-time { font-size: 10px; }
#mod-patient .ptc-val { font-size: 12px; }
#mod-patient .pt2-st, #mod-patient .pt2-pay { font-size: 10px; padding: 2px 7px; }

@media (min-width: 521px) {
  .pt2--compact .ptc-pay-table { display: block; }
  .pt2--compact .ptc-pay-cards { display: none; }
}

@media (max-width: 520px) {
  .pt2--compact .pt2-tab__label { display: none; }
  .pt2--compact .pt2-tab { padding: 10px 6px; gap: 0; }
  .pt2--compact .pt2-tab svg { width: 18px; height: 18px; }
  .pt2--compact .ptc-pay-table { display: none; }
  .pt2--compact .ptc-pay-cards { display: grid; }
  .pt2--compact .ptc-pront-btns .ptc-btn span { display: none; }
  .pt2--compact .ptc-pront-btns .ptc-btn { padding: 8px 10px; }
  .pt2--compact .ptc-btn--primary::after { content: "+"; font-size: 17px; font-weight: 700; line-height: 1; }
  .pt2--compact .ptc-pront__meta { font-size: 11.5px; }
  .pt2--compact .ptc-pront__line { font-size: 10.5px; gap: 5px; }
  .pt2--compact .ptc-pront__line em { font-size: 9px; min-width: 20px; }
  .pt2--compact .ptc-pront__acts svg { width: 13px; height: 13px; }
}

@media (max-width: 640px) {
  .pt2--compact .app__top--slim .app__search { display: none; }
  .pt2--compact { padding: 12px 12px 16px; max-width: none; }
  .pt2--compact .pt2-head h6 { font-size: 17px; }
  .pt2--compact .ptc-card { padding: 10px 11px; }
  .pt2--compact .ptc-name { font-size: 15px; }
  .pt2--compact .ptc-meta { font-size: 11px; white-space: normal; line-height: 1.35; }
}

/* ---------- Financeiro (fin2) ---------- */
.fin2 { padding: 18px 22px 22px; }
.fin2-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.fin2-head h6 { font-size: 22px; font-weight: 800; margin: 0; }
.fin2-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.fin2-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; flex: none; }
.fin2-seg span { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 7px; }
.fin2-seg span.on { background: var(--navy); color: #fff; }
.fin2-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.fin2-kpi { border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; box-shadow: var(--shadow-card); }
.fin2-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.fin2-kpi-lab { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.fin2-kpi-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.fin2-kpi-ic svg { width: 15px; height: 15px; }
.fin2-kpi-ic--navy { background: hsl(224 64% 95%); color: var(--navy); }
.fin2-kpi-ic--green { background: var(--success-bg); color: var(--success); }
.fin2-kpi-ic--amber { background: var(--warning-bg); color: var(--warning); }
.fin2-kpi-ic--blue { background: hsl(224 70% 95%); color: hsl(224 64% 50%); }
.fin2-kpi-val { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-top: 10px; white-space: nowrap; }
.fin2-kpi-note { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.fin2-kpi-note.up { color: var(--success); font-weight: 700; }
.fin2-tablehead { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.fin2-tcount { font-size: 14px; font-weight: 700; }
.fin2-chips { display: flex; gap: 6px; }
.fin2-chip { font-size: 11.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.fin2-chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.fin2-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fin2-thr, .fin2-tr { display: grid; grid-template-columns: 1.3fr 1fr 0.9fr 0.8fr 0.9fr 0.8fr; align-items: center; gap: 8px; padding: 11px 16px; }
.fin2-thr { background: var(--bg); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--muted); }
.fin2-tr { border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--ink-2); }
.fin2-pt { font-weight: 700; color: var(--ink); }
.fin2-val { font-weight: 800; color: var(--ink); }

@media (max-width: 560px) {
  .fin2-kpis { grid-template-columns: 1fr 1fr; }
  .fin2-thr, .fin2-tr { grid-template-columns: 1.4fr 1fr 0.9fr 0.9fr; }
  .fin2-hide { display: none; }
  .pt2-body { grid-template-columns: 1fr; }
  .pt2-actions { flex-direction: row; }
}

/* ---------- Financeiro dashboard (fin3) ---------- */
.fin3 { padding: 14px 16px 16px; }
.fin3--compact { font-size: 12px; }
.fin3-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.fin3-head h6 { font-size: 17px; font-weight: 800; margin: 0; }
.fin3-head p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fin3-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; flex: none; }
.fin3-seg span { font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 5px 9px; border-radius: 6px; white-space: nowrap; }
.fin3-seg span.on { background: var(--navy); color: #fff; }
.fin3-chip { font-size: 10.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: #fff; }
.fin3-chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.fin3-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.fin3-sel { font-size: 10.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: #fff; white-space: nowrap; }
.fin3-sel.on { background: hsl(224 64% 97%); color: var(--navy); border-color: hsl(224 50% 86%); }
.fin3-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.fin3-kpi { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: #fff; box-shadow: var(--shadow-card); }
.fin3-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fin3-kpi-lab { font-size: 10px; color: var(--muted); font-weight: 600; }
.fin3-kpi-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.fin3-kpi-ic svg { width: 12px; height: 12px; }
.fin3-kpi-ic--navy { background: hsl(224 64% 95%); color: var(--navy); }
.fin3-kpi-ic--green { background: var(--success-bg); color: var(--success); }
.fin3-kpi-ic--amber { background: var(--warning-bg); color: var(--warning); }
.fin3-kpi-ic--blue { background: hsl(224 70% 95%); color: hsl(224 64% 50%); }
.fin3-kpi-val {
  font-size: 15px; font-weight: 800; letter-spacing: -.02em; margin-top: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .3s ease;
}
.fin3-kpi-val.is-ticking { color: var(--teal); }
.fin3-kpi-note { font-size: 9.5px; color: var(--muted); margin-top: 1px; line-height: 1.3; }
.fin3-kpi-note.up { color: var(--success); font-weight: 700; }
.fin3-charts { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; margin-bottom: 10px; }
.fin3-chartbox { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; box-shadow: var(--shadow-card); }
.fin3-charthead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fin3-charthead h6 { font-size: 11.5px; font-weight: 800; margin: 0; }
.fin3-chartleg { display: flex; gap: 8px; font-size: 9.5px; color: var(--muted); font-weight: 600; }
.fin3-chartleg span { display: inline-flex; align-items: center; gap: 4px; }
.fin3-sq { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.fin3-sq--recv { background: var(--navy); }
.fin3-sq--pend { background: hsl(214 20% 82%); }
.fin3-bars { display: flex; align-items: flex-end; gap: 8px; height: 72px; }
.fin3-bargrp { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.fin3-barstack { display: flex; align-items: flex-end; gap: 2px; height: 100%; justify-content: center; }
.fin3-bar { display: block; width: 11px; border-radius: 3px 3px 0 0; min-height: 6px; transition: height 3s cubic-bezier(.4, 0, .2, 1); }
.fin3-bar--recv { background: var(--navy); }
.fin3-bar--pend { background: hsl(214 24% 86%); }
.fin3-barlbl { font-size: 9px; color: var(--muted); font-weight: 600; }
.fin3-donutrow { display: flex; align-items: center; gap: 10px; }
.fin3-donutwrap { position: relative; width: 72px; height: 72px; flex: none; }
.fin3-donut {
  position: relative;
  width: 100%; height: 100%; border-radius: 50%;
  background: conic-gradient(
    hsl(142 64% 42%) 0 42%,
    var(--navy) 42% 74%,
    hsl(38 92% 50%) 74% 100%
  );
  transition: background 3s ease;
}
.fin3-donut::after {
  content: ""; position: absolute; inset: 24%; border-radius: 50%; background: #fff;
}
.fin3-donutcenter { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 1; }
.fin3-donutcenter span { font-size: 8px; color: var(--muted); font-weight: 600; }
.fin3-donutcenter b { font-size: 9.5px; font-weight: 800; color: var(--ink); }
.fin3-legs { display: grid; gap: 4px; flex: 1; min-width: 0; }
.fin3-leg { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--ink-2); }
.fin3-leg b { margin-left: auto; font-weight: 700; color: var(--ink); font-size: 9.5px; }
.fin3-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.fin3-dot--green { background: var(--success); }
.fin3-dot--navy { background: var(--navy); }
.fin3-dot--amber { background: var(--warning); }
.fin3-tablehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.fin3-tcount { font-size: 12px; font-weight: 700; }
.fin3-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.fin3-table { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; background: #fff; max-width: 100%; }
.fin3-thr, .fin3-tr {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.75fr 0.7fr;
  align-items: center; gap: 6px; padding: 7px 10px;
}
.fin3-thr { background: var(--bg); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--muted); }
.fin3-tr {
  border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--ink-2);
  transition: opacity .4s ease, transform .4s ease, background .4s ease;
}
.fin3-tr.fin3-tr--swap { opacity: 0; transform: translateY(6px); }
.fin3-tr.fin3-tr--highlight { background: hsl(186 64% 97%); }
.fin3-leg b, .fin3-donutcenter b { transition: color .3s ease; }
.fin3-leg b.is-ticking, .fin3-donutcenter b.is-ticking { color: var(--teal); }
.fin3-pt { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin3-val { font-weight: 800; color: var(--ink); white-space: nowrap; font-size: 10.5px; }
.fin3-foot { margin-top: 6px; font-size: 10px; color: var(--muted); text-align: right; }
.fin3--compact .pay-badge { font-size: 10px; padding: 3px 8px; }

.app--content-only { overflow: hidden; }
.app--agenda-only.app--content-only > .app__main { display: flex; width: 100%; min-width: 0; }

@media (max-width: 900px) {
  .fin3-kpis { grid-template-columns: repeat(2, 1fr); }
  .fin3-charts { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .fin3-seg span { padding: 5px 7px; font-size: 10px; }
  .fin3-thr, .fin3-tr { grid-template-columns: 1fr 0.85fr 0.7fr 0.65fr; padding: 6px 8px; }
}

/* ---------- Editar agendamento (aedit) ---------- */
.aedit-app {
  width: 100%;
  max-width: 100%;
}
.aedit { display: flex; flex-direction: column; background: var(--bg); min-height: 0; }
.aedit--compact { font-size: 12px; }
.aedit__head { background: #fff; border-bottom: 1px solid var(--line-soft); padding: 12px 14px 10px; }
.aedit__headtop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.aedit__eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.aedit__close { color: var(--muted); line-height: 0; }
.aedit__close svg { width: 16px; height: 16px; }
.aedit__hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.aedit__patient { display: flex; align-items: center; gap: 10px; min-width: 0; }
.aedit__avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg); color: hsl(215 18% 60%); display: grid; place-items: center; flex: none;
}
.aedit__avatar svg { width: 20px; height: 20px; }
.aedit__name { font-size: 15px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aedit__pact { display: inline-flex; gap: 4px; color: var(--muted); }
.aedit__pact svg { width: 13px; height: 13px; }
.aedit__meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.aedit__quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.aedit__atn, .aedit__status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fff; color: var(--ink-2);
  max-width: 100%; min-width: 0;
}
.aedit__atn svg, .aedit__status svg { width: 14px; height: 14px; flex: none; }
.aedit__status { border-color: hsl(224 50% 86%); color: var(--navy); background: hsl(224 64% 98%); }
.aedit__body { display: flex; min-height: 0; flex: 1; }
.aedit__nav {
  width: clamp(108px, 26%, 148px); flex: none; background: #fff; border-right: 1px solid var(--line-soft);
  padding: 10px 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.aedit__navgrp {
  font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 8px 8px 4px;
}
.aedit__navitem {
  display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  padding: 8px 10px; border-radius: 8px; position: relative;
}
.aedit__navitem svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.aedit__navitem.on { background: var(--navy); color: #fff; }
.aedit__navitem.on svg { color: #fff; }
.aedit__badge {
  margin-left: auto; font-size: 10px; font-weight: 700; font-style: normal;
  background: hsl(224 64% 94%); color: var(--navy); padding: 1px 6px; border-radius: 999px;
}
.aedit__navitem.on .aedit__badge { background: hsl(224 64% 28%); color: #fff; }
.aedit__dot {
  position: absolute; top: 8px; left: 22px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--warning); border: 1.5px solid #fff;
}
.aedit__main { flex: 1; min-width: 0; padding: 10px; display: grid; gap: 8px; align-content: start; }
.aedit__card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  box-shadow: var(--shadow-card);
}
.aedit__card h6 {
  display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; margin: 0 0 10px; color: var(--ink);
}
.aedit__card h6 svg { width: 15px; height: 15px; color: var(--navy); flex: none; }
.aedit__fields { display: grid; gap: 8px; }
.aedit__fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.aedit__fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.aedit__field label { font-size: 10.5px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 4px; }
.aedit__field label .req { color: var(--danger); }
.aedit__inp {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 11.5px;
  color: var(--ink); background: #fff; min-width: 0; overflow: hidden;
}
.aedit__inp svg { width: 13px; height: 13px; color: var(--muted); flex: none; }
.aedit__navitem span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aedit__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: #fff; border-top: 1px solid var(--line-soft);
}
.aedit__del {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--danger);
}
.aedit__del svg { width: 15px; height: 15px; }

@media (max-width: 480px) {
  .aedit--compact { font-size: 11px; }
  .aedit__head { padding: 10px 12px 8px; }
  .aedit__main { padding: 8px; }
  .aedit__nav { width: clamp(96px, 24%, 120px); padding: 8px 6px; }
  .aedit__navitem { font-size: 10.5px; padding: 7px 8px; gap: 6px; }
  .aedit__card { padding: 10px; }
  .aedit__foot { padding: 8px 12px; flex-wrap: wrap; }
}

/* ================= Live animations ================= */
/* Hero agenda: a "live" appointment gliding across columns + growing */
.evt-live {
  z-index: 7; cursor: default;
  border-left-width: 4px;
  box-shadow: 0 4px 14px -6px rgb(15 23 42 / .22), 0 2px 6px -2px rgb(15 23 42 / .1);
  animation: evtLiveBreathe 2.4s ease-in-out infinite;
}
.evt-live .el-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); margin-right: 5px; flex: none;
  box-shadow: 0 0 0 0 hsl(173 58% 39% / .5); animation: dotPulse 1.6s ease-out infinite;
}
@keyframes dotPulse {
  0% { box-shadow: 0 0 0 0 hsl(173 58% 39% / .5); }
  70% { box-shadow: 0 0 0 7px hsl(173 58% 39% / 0); }
  100% { box-shadow: 0 0 0 0 hsl(173 58% 39% / 0); }
}
@keyframes evtLiveBreathe {
  0%, 100% { box-shadow: 0 10px 22px -8px rgb(15 23 42 / .35); }
  50% { box-shadow: 0 14px 28px -8px hsl(173 58% 39% / .45); }
}
@media (prefers-reduced-motion: reduce) {
  .evt-live, .evt-live .el-dot { animation: none; }
}

/* Prontuário ao vivo: linhas e blocos surgindo em sequência */
.pront-live .t-turn { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.pront-live .t-turn.show { opacity: 1; transform: none; }
.pront-live .chart .blk { opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
.pront-live .chart .blk.show { opacity: 1; transform: none; }
.pront-live .t-turn.typing .t-text::after,
.pront-live .typing-el::after {
  content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 2px;
  background: var(--teal); vertical-align: -2px; animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .pront-live .t-turn, .pront-live .chart .blk { opacity: 1 !important; transform: none !important; }
  .pront-live .t-turn.typing .t-text::after { display: none; }
}
