/* ─────────────────────────────────────────────────────────────
   Painel — Dra. Monique Ramos
   Design system próprio, sem dependências externas.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --surface-3: #f1eee8;
  --border: #e6e1d8;
  --border-strong: #d6cfc3;
  --text: #1b2421;
  --text-2: #55605b;
  --text-3: #8a928e;

  --primary: #2c6a5a;
  --primary-700: #1f5143;
  --primary-800: #173d33;
  --primary-50: #ebf3f0;
  --primary-100: #d5e7e0;
  --gold: #b48e55;
  --gold-50: #f6efe3;

  --side: #102b25;
  --side-2: #163a32;
  --side-text: #c9d8d2;
  --side-text-2: #87a49a;

  --blue: #3a67c9;   --blue-50: #ecf1fc;
  --green: #2c8456;  --green-50: #e8f5ee;
  --amber: #b67a0f;  --amber-50: #fbf2df;
  --red: #c0453c;    --red-50: #fbecea;
  --slate: #56616b;  --slate-50: #eef0f2;
  --violet: #6c55b8; --violet-50: #f0ecfa;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 26, .06);
  --shadow: 0 1px 2px rgba(20, 30, 26, .05), 0 6px 20px rgba(20, 30, 26, .06);
  --shadow-lg: 0 10px 40px rgba(16, 28, 24, .18), 0 2px 6px rgba(16, 28, 24, .08);
  --ring: 0 0 0 3px rgba(44, 106, 90, .18);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --side-w: 248px;
  --top-h: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.oculto { display: none !important; }

/* ───────── Ícones ───────── */
.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }

/* ───────── Layout ───────── */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.lateral {
  background: linear-gradient(180deg, var(--side) 0%, #0d241f 100%);
  color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid rgba(255,255,255,.04);
}
.marca { display: flex; align-items: center; gap: 12px; padding: 6px 8px 22px; }
.marca .monograma {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, #d9b77f, var(--gold) 60%, #93703d);
  color: #102b25; font-weight: 700; font-size: 14px; letter-spacing: .04em;
  box-shadow: 0 0 0 3px rgba(180,142,85,.18), inset 0 1px 0 rgba(255,255,255,.35);
}
.marca .nome { color: #fff; font-weight: 620; font-size: 14.5px; line-height: 1.2; }
.marca .sub { color: var(--side-text-2); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .grupo { color: var(--side-text-2); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; padding: 16px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 9px;
  color: var(--side-text); font-weight: 500; text-decoration: none;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.ativo { background: linear-gradient(90deg, rgba(180,142,85,.20), rgba(180,142,85,.06)); color: #fff; box-shadow: inset 2px 0 0 var(--gold); }
.nav a .ic { opacity: .85; }
.nav a .contador {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--gold); color: #102b25; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.lateral .rodape { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid rgba(255,255,255,.06); }
.usuario-mini { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 650; font-size: 13px;
  background: var(--primary-100); color: var(--primary-800);
}
.lateral .avatar { background: var(--side-2); color: #fff; border: 1px solid rgba(255,255,255,.1); }
.usuario-mini .nome { color: #fff; font-weight: 550; font-size: 13px; }
.usuario-mini .papel { color: var(--side-text-2); font-size: 11.5px; }
.usuario-mini button { margin-left: auto; color: var(--side-text-2); }
.usuario-mini button:hover { color: #fff; background: rgba(255,255,255,.06); }

.principal { min-width: 0; display: flex; flex-direction: column; }
.topo {
  height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding: 0 28px; position: sticky; top: 0; z-index: 20;
  background: rgba(245,243,239,.86); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topo .titulo { display: flex; flex-direction: column; }
.topo .titulo .sub { color: var(--text-3); font-size: 12px; }
.topo .acoes { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.botao-menu { display: none; }
.conteudo { padding: 24px 28px 48px; max-width: 1440px; width: 100%; }

/* ───────── Botões ───────── */
button { font: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: #c8c0b2; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primario { background: linear-gradient(180deg, #317562, var(--primary)); border-color: var(--primary-700); color: #fff; box-shadow: 0 1px 2px rgba(23,61,51,.25), inset 0 1px 0 rgba(255,255,255,.12); }
.btn.primario:hover { background: linear-gradient(180deg, #2c6a5a, var(--primary-700)); }
.btn.dourado { background: linear-gradient(180deg, #c29d63, var(--gold)); border-color: #9b7843; color: #fff; }
.btn.perigo { color: var(--red); border-color: #e7c4c0; }
.btn.perigo:hover { background: var(--red-50); }
.btn.fantasma { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.fantasma:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icone { width: 36px; padding: 0; }
.btn.icone.sm { width: 30px; }
.btn.bloco { width: 100%; }
.btn .spinner { width: 14px; height: 14px; }
.grupo-btn { display: inline-flex; gap: 8px; flex-wrap: wrap; }

.segmentado { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.segmentado button {
  border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px;
  color: var(--text-2); font-weight: 550; cursor: pointer;
}
.segmentado button.ativo { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ───────── Formulários ───────── */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > label, .rotulo { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.campo .ajuda { font-size: 12px; color: var(--text-3); }
.entrada, select.entrada, textarea.entrada {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface);
  font: inherit; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
textarea.entrada { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.entrada { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2355605b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.entrada:hover { border-color: #c4bcae; }
.entrada:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.entrada[aria-invalid="true"] { border-color: var(--red); }
.entrada-icone { position: relative; }
.entrada-icone .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.entrada-icone .entrada { padding-left: 36px; }
.linha { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.linha.c2 { grid-template-columns: 1fr 1fr; }
.linha.c3 { grid-template-columns: repeat(3, 1fr); }
.form { display: flex; flex-direction: column; gap: 16px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; color: var(--text); }
.check input { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; }
.secao-form { padding-top: 4px; }
.secao-form > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 650; margin-bottom: 12px; }
.erro-form { background: var(--red-50); color: #8f2e27; border: 1px solid #efcfcb; padding: 10px 12px; border-radius: 9px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.aviso { background: var(--amber-50); color: #7a5208; border: 1px solid #efdcb5; padding: 10px 12px; border-radius: 9px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.info { background: var(--primary-50); color: var(--primary-800); border: 1px solid var(--primary-100); padding: 10px 12px; border-radius: 9px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }

/* ───────── Cartões, tabelas, listas ───────── */
.cartao { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.cartao .cab { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cartao .cab .acoes { margin-left: auto; display: flex; gap: 8px; }
.cartao .corpo { padding: 18px; }
.cartao.sem-borda-interna .cab { border-bottom: 0; padding-bottom: 4px; }
.grade { display: grid; gap: 18px; }
.grade.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grade.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grade.lateral-dir { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.cabecalho-pagina { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.cabecalho-pagina .acoes { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.tabela { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabela th {
  text-align: left; font-size: 11.5px; font-weight: 650; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .07em;
  padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  position: sticky; top: 0;
}
.tabela th:first-child { border-top-left-radius: var(--radius); }
.tabela th:last-child { border-top-right-radius: var(--radius); }
.tabela td { font-variant-numeric: tabular-nums; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr { transition: background .12s; }
.tabela tbody tr.clicavel { cursor: pointer; }
.tabela tbody tr.clicavel:hover { background: var(--surface-2); }
.tabela .acoes { text-align: right; white-space: nowrap; }
.rolagem-x { overflow-x: auto; }

.pessoa { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pessoa .nome { font-weight: 600; }
.pessoa .det { color: var(--text-3); font-size: 12.5px; }

.lista { display: flex; flex-direction: column; }
.lista .item { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.lista .item:last-child { border-bottom: 0; }
.lista .item .fim { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ───────── Selos (badges) ───────── */
.selo {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--slate-50); color: var(--slate);
}
.selo .ponto { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.selo.agendada { background: var(--blue-50); color: var(--blue); }
.selo.confirmada { background: var(--green-50); color: var(--green); }
.selo.nao_confirmada { background: var(--amber-50); color: var(--amber); }
.selo.compareceu { background: var(--primary-50); color: var(--primary); }
.selo.faltou { background: var(--red-50); color: var(--red); }
.selo.cancelada, .selo.remarcada { background: var(--slate-50); color: var(--slate); }
.selo.ouro { background: var(--gold-50); color: #8a6a37; }
.selo.violeta { background: var(--violet-50); color: var(--violet); }
.selo.vermelho { background: var(--red-50); color: var(--red); }
.selo.verde { background: var(--green-50); color: var(--green); }
.etiqueta { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 550; }
.etiquetas { display: flex; gap: 6px; flex-wrap: wrap; }

/* ───────── Abas ───────── */
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.abas button {
  border: 0; background: none; padding: 11px 14px; cursor: pointer; color: var(--text-2); font-weight: 580;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center;
}
.abas button:hover { color: var(--text); }
.abas button.ativo { color: var(--primary-800); border-bottom-color: var(--primary); }
.abas .num { background: var(--surface-3); color: var(--text-2); border-radius: 10px; padding: 0 7px; font-size: 11.5px; }

/* ───────── Modal, gaveta, menus, toasts ───────── */
.fundo {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(14, 28, 24, .38); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
  animation: aparecer .15s ease-out;
}
.modal {
  width: min(620px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: subir .18s cubic-bezier(.2,.8,.2,1);
}
.modal.largo { width: min(860px, 100%); }
.modal.estreito { width: min(440px, 100%); }
.modal .cab { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 6px; }
.modal .cab .sub { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.modal .cab .fechar { margin-left: auto; margin-top: -4px; margin-right: -6px; }
.modal .corpo { padding: 14px 22px 8px; overflow-y: auto; }
.modal .rodape { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 22px 20px; border-top: 1px solid var(--border); margin-top: 10px; }
.modal .rodape .esq { margin-right: auto; }

.gaveta-fundo { position: fixed; inset: 0; z-index: 50; background: rgba(14,28,24,.22); animation: aparecer .15s; }
.gaveta {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; width: min(480px, 100%);
  background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: deslizar .22s cubic-bezier(.2,.8,.2,1);
}
.gaveta .cab { padding: 20px 22px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.gaveta .cab .fechar { margin-left: auto; }
.gaveta .corpo { padding: 18px 22px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.gaveta .rodape { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }

.menu-suspenso { position: relative; }
.menu-suspenso .itens {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 6px;
  animation: subir .12s ease-out;
}
.menu-suspenso .itens button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 9px 10px; border-radius: 7px; cursor: pointer; text-align: left; color: var(--text); }
.menu-suspenso .itens button:hover { background: var(--surface-2); }
.menu-suspenso .itens button.perigo { color: var(--red); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; gap: 10px; align-items: center; min-width: 260px; max-width: 420px;
  padding: 12px 14px; border-radius: 11px; background: #14302a; color: #e9f1ee; box-shadow: var(--shadow-lg);
  animation: subir .2s cubic-bezier(.2,.8,.2,1);
}
.toast.erro { background: #4a1c18; }
.toast .ic { color: var(--gold); }
.toast.erro .ic { color: #f3a49d; }

.autocompletar { position: relative; }
.autocompletar .opcoes {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70; max-height: 300px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 5px;
}
.autocompletar .opcao { padding: 9px 10px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.autocompletar .opcao:hover, .autocompletar .opcao.ativa { background: var(--primary-50); }
.autocompletar .opcao .det { color: var(--text-3); font-size: 12.5px; }
.selecionado { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--primary-100); background: var(--primary-50); border-radius: 10px; }
.selecionado .btn { margin-left: auto; }

@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes deslizar { from { transform: translateX(30px); opacity: 0; } }

/* ───────── Estados ───────── */
.vazio { text-align: center; padding: 48px 20px; color: var(--text-3); }
.vazio .ic { width: 38px; height: 38px; color: var(--border-strong); margin-bottom: 10px; }
.vazio h3 { color: var(--text-2); margin-bottom: 4px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: girar .7s linear infinite; display: inline-block; opacity: .7; }
.carregando { display: grid; place-items: center; padding: 60px; color: var(--primary); }
@keyframes girar { to { transform: rotate(360deg); } }
.esqueleto { background: linear-gradient(90deg, var(--surface-3), #f7f5f1, var(--surface-3)); background-size: 200% 100%; animation: brilho 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes brilho { to { background-position: -200% 0; } }

/* ───────── Indicadores ───────── */
.indicadores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.indicador { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow-sm); display: flex; gap: 13px; align-items: center; }
.indicador .bola { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.indicador .bola.ouro { background: var(--gold-50); color: #8a6a37; }
.indicador .bola.ambar { background: var(--amber-50); color: var(--amber); }
.indicador .bola.vermelho { background: var(--red-50); color: var(--red); }
.indicador .valor { font-variant-numeric: tabular-nums; font-size: 21px; font-weight: 680; letter-spacing: -.02em; font-family: var(--font-display); }
.indicador .rot { color: var(--text-3); font-size: 12.5px; }

/* ───────── Agenda ───────── */
.agenda-barra { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.agenda-barra .periodo { font-size: 18px; font-weight: 650; font-family: var(--font-display); margin: 0 6px; min-width: 220px; }
.agenda-barra .direita { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-2); font-size: 12.5px; margin: 0 0 12px; }
.legenda span { display: inline-flex; gap: 6px; align-items: center; }
.legenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legenda i.livre { background: var(--primary-100); border: 1px solid #b9d6cb; }
.legenda i.bloqueio { background: repeating-linear-gradient(45deg, #e8e4dc, #e8e4dc 3px, #f3f0ea 3px, #f3f0ea 6px); border: 1px solid #ddd6ca; }

.calendario { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.cal-cab { display: grid; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-cab .dia { padding: 10px 8px; text-align: center; border-left: 1px solid var(--border); cursor: pointer; }
.cal-cab .dia:first-child { border-left: 0; cursor: default; }
.cal-cab .dia .ds { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 650; }
.cal-cab .dia .num { font-size: 19px; font-weight: 640; font-family: var(--font-display); margin-top: 1px; }
.cal-cab .dia.hoje .num { color: #fff; background: var(--primary); width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 15px; }
.cal-cab .dia .feriado { font-size: 10.5px; color: var(--amber); font-weight: 600; }
.cal-cab .dia .resumo { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.cal-corpo { display: grid; position: relative; }
.cal-horas { position: relative; }
.cal-horas .h { position: absolute; right: 8px; font-size: 11px; color: var(--text-3); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.cal-coluna { position: relative; border-left: 1px solid var(--border); }
.cal-coluna.hoje { background: linear-gradient(180deg, rgba(44,106,90,.025), rgba(44,106,90,.025)); }
.cal-linha { position: absolute; left: 0; right: 0; border-top: 1px solid #efebe4; }
.cal-linha.meia { border-top: 1px dashed #f3f0ea; }
.cal-livre {
  position: absolute; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(213,231,224,.55), rgba(213,231,224,.42));
  border-left: 3px solid #9cc5b5;
  cursor: copy;
}
.cal-livre:hover { background: rgba(213,231,224,.8); }
.cal-livre .rot { position: absolute; top: 3px; right: 6px; font-size: 10.5px; color: var(--primary-700); opacity: .8; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-bloqueio {
  position: absolute; left: 0; right: 0;
  background: repeating-linear-gradient(45deg, rgba(222,216,206,.75), rgba(222,216,206,.75) 4px, rgba(240,236,229,.75) 4px, rgba(240,236,229,.75) 8px);
  border-left: 3px solid #c9c0b1; color: var(--text-2); font-size: 11px; padding: 3px 6px; overflow: hidden;
}
.cal-evento {
  position: absolute; left: 4px; right: 4px; z-index: 2;
  border-radius: 8px; padding: 3px 8px; overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--blue);
  box-shadow: 0 1px 2px rgba(20,30,26,.08);
  transition: box-shadow .15s, transform .1s;
  font-size: 12px; line-height: 1.25;
}
.cal-evento:hover { box-shadow: var(--shadow); transform: translateY(-1px); z-index: 3; }
.cal-evento .hora { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 11px; }
.cal-evento .pac { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-evento .tipo { color: var(--text-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-evento.agendada { border-left-color: var(--blue); background: #f8faff; }
.cal-evento.confirmada { border-left-color: var(--green); background: #f5fbf7; }
.cal-evento.nao_confirmada { border-left-color: var(--amber); background: #fffaf0; }
.cal-evento.compareceu { border-left-color: var(--primary); background: #f3f8f6; }
.cal-evento.faltou { border-left-color: var(--red); background: #fdf5f4; }
.cal-evento.cancelada, .cal-evento.remarcada { border-left-color: #b3b9bf; background: #f6f6f5; opacity: .7; }
.cal-evento.cancelada .pac, .cal-evento.remarcada .pac { text-decoration: line-through; }
.cal-evento.pacote { box-shadow: inset 0 0 0 1px rgba(180,142,85,.35); }
.cal-evento .ana { color: var(--violet); }
.cal-agora { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 4; }
.cal-agora::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* ───────── Ficha / histórico ───────── */
.ficha-topo { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.ficha-topo .avatar { width: 58px; height: 58px; font-size: 20px; background: linear-gradient(135deg, var(--primary-100), var(--gold-50)); color: var(--primary-800); }
.ficha-topo .det { display: flex; gap: 14px; color: var(--text-2); flex-wrap: wrap; margin-top: 4px; }
.ficha-topo .det span { display: inline-flex; gap: 6px; align-items: center; }
.ficha-topo .acoes { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.dados-lista { display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; font-size: 13.5px; }
.dados-lista dt { color: var(--text-3); }
.dados-lista dd { margin: 0; word-break: break-word; }

.linha-tempo { position: relative; padding-left: 26px; }
.linha-tempo::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.evento-tempo { position: relative; padding-bottom: 18px; }
.evento-tempo:last-child { padding-bottom: 0; }
.evento-tempo .marca-t { position: absolute; left: -26px; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--primary-100); color: var(--primary); }
.evento-tempo .marca-t .ic { width: 11px; height: 11px; }
.evento-tempo.ana .marca-t { border-color: #ddd3f5; color: var(--violet); }
.evento-tempo.contato .marca-t { border-color: #f0e2c6; color: var(--gold); }
.evento-tempo .meta { display: flex; gap: 8px; align-items: center; color: var(--text-3); font-size: 12.5px; flex-wrap: wrap; }
.evento-tempo .meta .autor { color: var(--text-2); font-weight: 600; }
.evento-tempo .texto { margin-top: 6px; white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; line-height: 1.55; }
.evento-tempo .acoes-t { display: none; margin-left: auto; gap: 2px; }
.evento-tempo:hover .acoes-t { display: inline-flex; }
.escrever { border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.escrever:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.escrever textarea { border: 0; width: 100%; min-height: 84px; padding: 12px 14px; font: inherit; resize: vertical; outline: none; line-height: 1.5; }
.escrever .barra { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--surface-2); border-top: 1px solid var(--border); }
.escrever .barra .btn:last-child { margin-left: auto; }

.horarios-sugeridos { display: flex; flex-wrap: wrap; gap: 8px; }
.horarios-sugeridos button {
  border: 1px solid var(--primary-100); background: var(--primary-50); color: var(--primary-800);
  border-radius: 9px; padding: 7px 11px; cursor: pointer; font-weight: 580; font-size: 13px;
}
.horarios-sugeridos button:hover { background: var(--primary-100); }
.horarios-sugeridos button.ativo { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ───────── Login ───────── */
.tela-login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-arte {
  position: relative; overflow: hidden; color: #e6efeb; padding: 48px;
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(180,142,85,.25), transparent 60%),
    radial-gradient(900px 500px at 120% 120%, rgba(44,106,90,.55), transparent 60%),
    linear-gradient(160deg, #0f2a24, #12352d 55%, #0c221d);
  display: flex; flex-direction: column;
}
.login-arte .marca .nome { font-size: 16px; }
.login-arte .frase { margin-top: auto; max-width: 440px; }
.login-arte .frase h2 { font-size: 30px; line-height: 1.15; color: #fff; font-weight: 600; letter-spacing: -.02em; }
.login-arte .frase p { margin-top: 14px; color: #a8c1b8; font-size: 15px; line-height: 1.6; }
.login-arte .circulo { position: absolute; border: 1px solid rgba(180,142,85,.22); border-radius: 50%; }
.login-form { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.login-form .caixa { width: min(380px, 100%); }
.login-form h1 { font-size: 26px; margin-bottom: 6px; }
.login-form .sub { color: var(--text-2); margin-bottom: 28px; }
.login-form .btn.primario { height: 42px; font-size: 15px; }
.login-form .rodape-login { margin-top: 28px; color: var(--text-3); font-size: 12px; display: flex; gap: 6px; align-items: center; }

/* ───────── Responsivo ───────── */
@media (max-width: 1100px) {
  .indicadores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade.lateral-dir { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; z-index: 80; left: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .app.menu-aberto .lateral { transform: none; box-shadow: var(--shadow-lg); }
  .botao-menu { display: inline-flex; }
  .topo { padding: 0 16px; }
  .conteudo { padding: 18px 16px 40px; }
  .grade.c2, .grade.c3, .linha.c2, .linha.c3 { grid-template-columns: 1fr; }
  .tela-login { grid-template-columns: 1fr; }
  .login-arte { display: none; }
  .ocultar-mobile { display: none !important; }
  .topo .titulo .sub, .legenda { display: none; }
  .topo .acoes .btn .txt { display: none; }
  .topo .acoes .btn { width: 38px; padding: 0; }
  .agenda-barra .periodo { min-width: 0; font-size: 16px; }
  .indicadores { grid-template-columns: 1fr 1fr; }
}
