/* ==========================================================================
   Lumina — painel da clínica (mesma paleta dark navy da landing)
   ========================================================================== */

:root {
  --navy-900: #050914;
  --navy-800: #070D1E;
  --navy-700: #0B1428;
  --navy-600: #101B36;
  --line: rgba(255, 255, 255, .09);
  --line-soft: rgba(255, 255, 255, .05);

  --white: #F4F7FF;
  --dim: rgba(244, 247, 255, .62);
  --dimmer: rgba(244, 247, 255, .38);

  --blue: #4D8DFF;
  --blue-soft: rgba(77, 141, 255, .14);
  --green: #22C7A9;
  --amber: #FFB84D;
  --red: #FF6B6B;

  --display: 'Sora', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --radius: 12px;

  --side: 236px;
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--navy-900); color: var(--white);
  font-family: var(--body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh;
}
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 1.6rem 1.1rem; border-right: 1px solid var(--line-soft);
  background: var(--navy-800);
}
.brand { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.03em; }
.brand span { color: var(--blue); }
.side-label {
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--dimmer); margin: .35rem 0 2rem;
}
#menu { display: flex; flex-direction: column; gap: .3rem; }
#menu a {
  display: flex; flex-direction: column; padding: .7rem .85rem; border-radius: 10px;
  border: 1px solid transparent; transition: background .2s ease, border-color .2s ease;
}
#menu a b { font-weight: 500; font-size: .92rem; }
#menu a span { font-size: .74rem; color: var(--dimmer); }
#menu a:hover { background: rgba(255,255,255,.04); }
#menu a.active { background: var(--blue-soft); border-color: rgba(77,141,255,.3); }
#menu a.active span { color: var(--blue); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: .6rem; font-size: .78rem; color: var(--dimmer); }
.side-foot a:hover { color: var(--blue); }
.link-btn {
  background: none; border: 0; padding: 0; text-align: left;
  color: var(--dimmer); font-size: .78rem; cursor: pointer;
}
.link-btn:hover { color: var(--blue); }

/* ---------- main ---------- */
.main { padding: 2.2rem clamp(1.2rem, 3vw, 2.6rem) 4rem; min-width: 0; }
.view { display: none; }
.view.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head {
  display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.8rem;
}
.view-head h1 { font-size: 1.7rem; }
.sub { color: var(--dim); font-size: .9rem; margin-top: .35rem; max-width: 46rem; }

.kpis { display: flex; gap: .7rem; flex-wrap: wrap; }
.kpi {
  padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--navy-700); min-width: 108px;
}
.kpi b { display: block; font-family: var(--display); font-size: 1.3rem; color: var(--blue); }
.kpi span { font-size: .72rem; color: var(--dimmer); }

/* ---------- barra de dias ---------- */
.daybar { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .8rem; margin-bottom: 1.2rem; }
.day {
  flex: 0 0 auto; padding: .55rem 1rem; border-radius: 100px; cursor: pointer;
  border: 1px solid var(--line); background: var(--navy-700);
  color: var(--dim); font-size: .82rem; white-space: nowrap;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.day:hover { color: var(--white); }
.day.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.day .n { font-size: .68rem; opacity: .75; margin-left: .35rem; }

/* ---------- agenda ---------- */
.agenda {
  display: grid; grid-template-columns: 58px repeat(var(--cols, 3), minmax(180px, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--navy-800); overflow: hidden;
}
.col-head {
  padding: .9rem 1rem; background: var(--navy-700);
  border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-soft);
}
.col-head:first-child { border-left: 0; }
.col-head b { display: block; font-size: .88rem; font-weight: 500; }
.col-head span { font-size: .72rem; color: var(--dimmer); }
.col-head .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: .45rem; }

.hours { position: relative; border-right: 1px solid var(--line-soft); }
.hour-mark {
  position: absolute; left: 0; right: 0; padding-right: .5rem; text-align: right;
  font-size: .68rem; color: var(--dimmer); transform: translateY(-.5em);
}
.col { position: relative; border-left: 1px solid var(--line-soft); }
.grid-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--line-soft); }

.slot-free {
  position: absolute; left: 4px; right: 4px; border-radius: 6px; cursor: pointer;
  border: 1px dashed transparent; transition: border-color .18s ease, background .18s ease;
}
.slot-free:hover { border-color: rgba(77,141,255,.5); background: var(--blue-soft); }

.appt {
  position: absolute; left: 4px; right: 4px; padding: .4rem .55rem;
  border-radius: 7px; border-left: 3px solid var(--blue);
  background: rgba(77, 141, 255, .16); overflow: hidden;
  font-size: .76rem; line-height: 1.3;
}
.appt b { display: block; font-weight: 500; font-size: .8rem; }
.appt span { color: var(--dim); }
.appt.pendente { border-left-style: dashed; opacity: .82; }
.appt.novo { animation: pop .7s ease; }
@keyframes pop {
  0% { transform: scale(.94); box-shadow: 0 0 0 0 rgba(77,141,255,.6); }
  60% { box-shadow: 0 0 0 10px rgba(77,141,255,0); }
  100% { transform: none; }
}
.lunch {
  position: absolute; left: 4px; right: 4px; border-radius: 6px;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 6px, transparent 6px 12px);
  border: 1px solid var(--line-soft);
  display: grid; place-items: center; font-size: .68rem; color: var(--dimmer);
}
.off {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: .75rem; color: var(--dimmer);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 8px, transparent 8px 16px);
}

/* ---------- fila de interesses ---------- */
.queue { display: grid; gap: .9rem; }
.req {
  display: grid; grid-template-columns: 1fr auto; gap: 1.4rem; align-items: center;
  padding: 1.2rem 1.4rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--navy-700);
}
.req.urgent { border-color: rgba(255, 107, 107, .45); background: linear-gradient(90deg, rgba(255,107,107,.09), var(--navy-700) 40%); }
.req h3 { font-size: 1.05rem; }
.req-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 .5rem; }
.req-note { color: var(--dim); font-size: .85rem; font-style: italic; }
.req-when { font-size: .74rem; color: var(--dimmer); margin-top: .45rem; }

.tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .22rem .6rem; border-radius: 100px; font-size: .74rem;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--dim);
}
.tag.blue { background: var(--blue-soft); border-color: rgba(77,141,255,.35); color: var(--blue); }
.tag.red { background: rgba(255,107,107,.14); border-color: rgba(255,107,107,.4); color: var(--red); }
.tag.green { background: rgba(34,199,169,.14); border-color: rgba(34,199,169,.4); color: var(--green); }
.tag.amber { background: rgba(255,184,77,.14); border-color: rgba(255,184,77,.4); color: var(--amber); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .65rem 1.15rem; border-radius: 100px; border: 1px solid transparent;
  font-size: .85rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-ghost { border-color: var(--line); background: transparent; color: var(--white); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm { padding: .4rem .8rem; font-size: .78rem; }
.btn-wa { background: rgba(34,199,169,.16); border-color: rgba(34,199,169,.4); color: var(--green); }

/* ---------- lembretes ---------- */
.reminders { display: grid; gap: .9rem; }
.rem {
  display: grid; grid-template-columns: 220px 1fr auto; gap: 1.4rem; align-items: center;
  padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--navy-700);
}
.rem-who b { display: block; font-weight: 500; }
.rem-who span { font-size: .76rem; color: var(--dimmer); }
.rem-msg {
  white-space: pre-wrap; font-size: .82rem; color: var(--dim);
  background: var(--navy-900); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: .8rem 1rem; max-height: 8.5rem; overflow: auto;
}

/* ---------- equipe ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.dcard {
  padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--navy-700);
}
.dcard h3 { font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.dcard h3 .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dcard .role { font-size: .8rem; color: var(--dim); margin-bottom: 1rem; }
.dcard dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; font-size: .82rem; }
.dcard dt { color: var(--dimmer); }
.dcard dd { margin: 0; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(3, 6, 14, .78); backdrop-filter: blur(6px); padding: 1.2rem;
}
.modal[hidden] { display: none; }
.modal-box {
  position: relative; width: min(640px, 100%); max-height: 88vh; overflow: auto;
  padding: 2rem; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--navy-600), var(--navy-800));
}
.modal-x {
  position: absolute; top: 1rem; right: 1.1rem; background: none; border: 0;
  color: var(--dimmer); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.modal-x:hover { color: var(--white); }
.modal-box h2 { font-size: 1.3rem; }
.modal-sub { color: var(--dim); font-size: .87rem; margin: .4rem 0 1.5rem; }

.opt {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center;
  padding: 1rem 1.1rem; margin-bottom: .7rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: rgba(5,9,20,.5);
  transition: border-color .2s ease;
}
.opt:hover { border-color: rgba(77,141,255,.4); }
.opt.best { border-color: rgba(77,141,255,.5); background: var(--blue-soft); }
.opt-when { font-family: var(--display); font-size: 1.05rem; }
.opt-who { font-size: .82rem; color: var(--dim); margin-top: .2rem; }
.opt-why { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.opt-why span {
  font-size: .7rem; padding: .18rem .55rem; border-radius: 100px;
  background: rgba(255,255,255,.05); color: var(--dimmer); border: 1px solid var(--line-soft);
}
.msg-preview {
  white-space: pre-wrap; font-size: .84rem; color: var(--dim); line-height: 1.6;
  background: var(--navy-900); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 1rem; margin: 1rem 0;
}
.empty { padding: 3rem 1rem; text-align: center; color: var(--dimmer); font-size: .9rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  z-index: 200; padding: .8rem 1.3rem; border-radius: 100px;
  background: var(--blue); color: #fff; font-size: .85rem;
  box-shadow: 0 16px 40px -16px rgba(77, 141, 255, .8);
}
.toast[hidden] { display: none; }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 1rem; }
  .side-label { display: none; }
  #menu { flex-direction: row; flex-wrap: wrap; }
  #menu a span { display: none; }
  .side-foot { margin: 0; flex-direction: row; gap: 1rem; }
  .req, .rem { grid-template-columns: 1fr; }
  .agenda { overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .view.active, .appt.novo { animation: none; }
  .btn:hover { transform: none; }
}
