:root{
  --bg:#0F172A;
  --card:#1E293B;
  --muted:#CBD5E1;
  --text:#F8FAFC;
  --line:#334155;
  --brand:#38BDF8;
  --brand2:#7DD3FC;
  --danger:#EF4444;
  --warn:#F59E0B;
  --ok:#22C55E;
  --info:#0EA5E9;
  --title:#7DD3FC;
  --surface:#1E293B;
  --shadow:0 16px 36px rgba(2,6,23,.28);
  --radius:8px;
  --radius2:6px;
  --max:1100px;
  --font:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans";
}

/* ── Tema Claro ─────────────────────────────────────────────────────────────── */
body.light {
  --bg:#FFFFFF;
  --card:#ffffff;
  --muted:#6B7280;
  --text:#1F2937;
  --line:#D1E5F0;
  --brand:#0EA5E9;
  --brand2:#0369A1;
  --danger:#EF4444;
  --warn:#F59E0B;
  --ok:#22C55E;
  --info:#0EA5E9;
  --title:#0369A1;
  --surface:#F0F9FF;
  --shadow:0 10px 28px rgba(3,105,161,.08);
}

body.light {
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(37,99,235,.07), transparent 55%),
    radial-gradient(900px 600px at 95% 0%,   rgba(13,148,136,.05), transparent 50%),
    radial-gradient(700px 500px at 30% 110%, rgba(37,99,235,.05),  transparent 55%),
    var(--bg);
}

/* Topbar claro */
body.light .topbar {
  background: rgba(255,255,255,.85);
  border-bottom: 1px solid rgba(200,210,230,.8);
}
body.light .nav a {
  background: rgba(240,242,247,.8);
  border-color: rgba(200,210,230,.7);
  color: var(--muted);
}
body.light .nav a.active {
  color: var(--brand);
  border-color: rgba(37,99,235,.4);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

/* Cards claros */
body.light .card {
  background: #ffffff;
  border-color: rgba(200,210,230,.7);
}
body.light .card h2 { color: #7a8aaa; }

/* Botões claros */
body.light .btn {
  background: #ffffff;
  border-color: rgba(200,210,230,.9);
  color: var(--text);
}
body.light .btn.primary {
  background: linear-gradient(135deg, #2563eb, #0d9488);
  color: #fff;
  border-color: transparent;
}
body.light .btn.active {
  background: rgba(37,99,235,.1);
  border-color: rgba(37,99,235,.4);
  color: var(--brand);
}
body.light .btn.selected {
  background: rgba(13,148,136,.1);
  border-color: rgba(13,148,136,.4);
  color: var(--brand2);
}
body.light .btn.danger { border-color: rgba(220,38,38,.4); color: #dc2626; }

/* Inputs claros */
body.light .input,
body.light select,
body.light textarea {
  background: #f8faff;
  border-color: rgba(200,210,230,.9);
  color: var(--text);
}
body.light .input:focus,
body.light select:focus,
body.light textarea:focus {
  border-color: rgba(37,99,235,.5);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

/* Tabela clara */
body.light .tr { background: rgba(240,242,247,.5); border-color: rgba(200,210,230,.5); }

/* Modal claro */
body.light .modal { background: rgba(0,0,0,.3); }
body.light .modal .panel {
  background: #ffffff;
  border-color: rgba(200,210,230,.8);
}

/* Toast claro */
body.light .toast .msg {
  background: #ffffff;
  border-color: rgba(200,210,230,.8);
  border-left-color: var(--brand);
}

/* Avatar claro */
body.light .avatar-iniciais,
body.light .avatar-iniciais-lg,
body.light .welcome-avatar-iniciais {
  background: linear-gradient(135deg, rgba(37,99,235,.8), rgba(13,148,136,.7));
}

/* Topbar brand claro */
body.light .brand h1 { color: var(--text); }

/* Date picker claro */
body.light .dp-trigger {
  background: #f8faff;
  border-color: rgba(200,210,230,.9);
  color: var(--text);
}
body.light .dp-popup {
  background: #ffffff;
  border-color: rgba(200,210,230,.8);
  box-shadow: 0 8px 32px rgba(30,50,100,.12);
}
body.light .dp-nav { border-color: rgba(200,210,230,.7); color: var(--muted); }
body.light .dp-nav:hover { background: rgba(37,99,235,.08); color: var(--brand); }
body.light .dp-header-btn {
  background: rgba(37,99,235,.07);
  border-color: rgba(37,99,235,.15);
  color: var(--text);
}
body.light .dp-cell { color: var(--text); }
body.light .dp-cell:hover:not(.dp-disabled):not(.dp-selected) { background: rgba(37,99,235,.08); }
body.light .dp-cell.dp-today { border-color: rgba(37,99,235,.5); color: var(--brand); }
body.light .dp-month-cell,
body.light .dp-year-cell {
  background: #f8faff;
  border-color: rgba(200,210,230,.7);
  color: var(--text);
}
body.light .dp-month-cell:hover,
body.light .dp-year-cell:hover { background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.3); }

/* Dropdown claro */
body.light .dropdown-menu {
  background: #ffffff;
  border-color: rgba(200,210,230,.8);
  box-shadow: 0 8px 24px rgba(30,50,100,.12);
}
body.light .dropdown-item { color: var(--text); }
body.light .dropdown-item:hover { background: rgba(37,99,235,.06); }
body.light .dropdown-item + .dropdown-item { border-color: rgba(200,210,230,.5); }

/* Agenda toolbar claro */
body.light .agenda-toolbar {
  background: rgba(255,255,255,.8);
  border-color: rgba(200,210,230,.7);
}
body.light .slots-bar {
  background: rgba(37,99,235,.04);
  border-color: rgba(37,99,235,.12);
}

/* Patient list claro */
body.light .patient-row {
  background: rgba(240,242,247,.5);
  border-color: rgba(200,210,230,.6);
}
body.light .patient-row:hover {
  background: rgba(37,99,235,.05);
  border-color: rgba(37,99,235,.2);
}

/* Search claro */
body.light .search-result {
  background: #f8faff;
  border-color: rgba(200,210,230,.6);
  color: var(--text);
}
body.light .search-result:hover {
  background: rgba(37,99,235,.06);
  border-color: rgba(37,99,235,.25);
}

/* Login claro */
body.light .login-card {
  background: rgba(255,255,255,.92);
  border-color: rgba(37,99,235,.15);
  box-shadow: 0 8px 40px rgba(30,50,100,.12);
}
body.light .login-title {
  background: linear-gradient(135deg, #1a2540 30%, #0d9488);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Welcome claro */
body.light .welcome-bg {
  background:
    radial-gradient(ellipse 1000px 700px at 50% 30%, rgba(37,99,235,.12), transparent 60%),
    radial-gradient(ellipse 600px 500px at 80% 80%, rgba(13,148,136,.08), transparent 55%),
    var(--bg);
}
body.light .welcome-nome {
  background: linear-gradient(135deg, #1a2540 20%, #0d9488 80%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* KPI claro */
body.light .kpi { color: var(--text); }

/* Badge claro */
body.light .badge { border-color: rgba(200,210,230,.7); color: var(--muted); }
body.light .badge.agendada  { border-color: rgba(37,99,235,.4);  color: #2563eb; }
body.light .badge.confirmada{ border-color: rgba(13,148,136,.4); color: #0d9488; }
body.light .badge.concluida { border-color: rgba(22,163,74,.4);  color: #16a34a; }
body.light .badge.cancelada { border-color: rgba(220,38,38,.4);  color: #dc2626; }
body.light .badge.faltou    { border-color: rgba(217,119,6,.4);  color: #d97706; }

/* Import status claro */
body.light .import-ok   { background: rgba(22,163,74,.08);  border-color: rgba(22,163,74,.3);  }
body.light .import-erro { background: rgba(220,38,38,.08);  border-color: rgba(220,38,38,.3);  }
body.light .import-loading { background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.3); }

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(110,168,255,.25), transparent 55%),
    radial-gradient(900px 600px at 95% 0%, rgba(120,240,215,.14), transparent 50%),
    radial-gradient(700px 500px at 30% 110%, rgba(110,168,255,.12), transparent 55%),
    var(--bg);
}
a{color:inherit}
.container{max-width:var(--max); margin:0 auto; padding:16px}
.topbar{
  position:sticky; top:0; z-index:20;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.55);
  border-bottom:1px solid rgba(32,50,85,.65);
}
.topbar .row{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px}
.brand{display:flex; align-items:center; gap:10px}
.brand img{width:34px; height:34px; border-radius:10px; box-shadow:var(--shadow)}
.brand h1{font-size:14px; margin:0; letter-spacing:.3px}
.brand small{display:block; color:var(--muted); font-size:12px; margin-top:2px}
.nav{display:flex; gap:8px; flex-wrap:wrap}
.nav a{
  text-decoration:none;
  padding:9px 10px;
  border-radius:10px;
  border:1px solid rgba(32,50,85,.7);
  background:rgba(15,27,51,.6);
  color:var(--muted);
}
.nav a.active{
  color:var(--text);
  border-color:rgba(110,168,255,.6);
  box-shadow:0 0 0 3px rgba(110,168,255,.12);
}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:12px; border:1px solid rgba(32,50,85,.9);
  background:rgba(15,27,51,.85);
  color:var(--text);
  padding:10px 12px;
  cursor:pointer;
  gap:8px;
}
.btn.primary{
  background:linear-gradient(135deg, rgba(110,168,255,.95), rgba(120,240,215,.75));
  border-color:rgba(255,255,255,.12);
  color:#06101f;
  font-weight:700;
}
.btn.danger{border-color:rgba(255,107,107,.55); color:#ffd7d7}
.btn.whatsapp{border-color:rgba(37,211,102,.45); color:#25d366}
.btn.whatsapp:hover{background:rgba(37,211,102,.12)}
.btn.active{background:rgba(110,168,255,.18); border-color:rgba(110,168,255,.6); color:var(--brand); font-weight:700}
.btn.selected{background:rgba(120,240,215,.15); border-color:rgba(120,240,215,.6); color:var(--brand2); font-weight:700}

/* Avatar */
.avatar-img{width:34px; height:34px; border-radius:50%; object-fit:cover; border:2px solid rgba(110,168,255,.4)}
.avatar-iniciais{
  width:34px; height:34px; border-radius:50%;
  background:linear-gradient(135deg,rgba(110,168,255,.8),rgba(120,240,215,.6));
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:800; color:#fff; flex-shrink:0;
  border:2px solid rgba(110,168,255,.4);
}
.avatar-img-lg{width:110px; height:110px; border-radius:50%; object-fit:cover; border:3px solid rgba(110,168,255,.4); margin:0 auto; display:block}
.avatar-iniciais-lg{
  width:110px; height:110px; border-radius:50%;
  background:linear-gradient(135deg,rgba(110,168,255,.8),rgba(120,240,215,.6));
  display:flex; align-items:center; justify-content:center;
  font-size:38px; font-weight:900; color:#fff; margin:0 auto;
  border:3px solid rgba(110,168,255,.4);
}
.avatar-preview{margin:12px auto 8px; display:flex; justify-content:center}
.btn:disabled{opacity:.6; cursor:not-allowed}
.grid{display:grid; gap:12px}
.grid.cards{grid-template-columns:repeat(12,1fr)}
.card{
  background:rgba(15,27,51,.78);
  border:1px solid rgba(32,50,85,.7);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
}
.card h2{margin:0 0 8px; font-size:14px; color:var(--muted); font-weight:600}
.kpi{font-size:26px; font-weight:800; letter-spacing:.2px}
.sub{color:var(--muted); font-size:12px}
.row{display:flex; gap:12px; align-items:center; flex-wrap:wrap}
.spacer{flex:1}
.input, select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(32,50,85,.9);
  background:rgba(8,13,24,.65);
  color:var(--text);
  outline:none;
}
.input:focus, select:focus, textarea:focus{box-shadow:0 0 0 3px rgba(110,168,255,.14); border-color:rgba(110,168,255,.65)}
.label{display:block; font-size:12px; color:var(--muted); margin:0 0 6px}
.form{display:grid; gap:10px}
.table{width:100%; border-collapse:separate; border-spacing:0 10px}
.tr{
  background:rgba(8,13,24,.45);
  border:1px solid rgba(32,50,85,.7);
  border-radius:14px;
}
.tr td{padding:10px 12px; border-top:1px solid rgba(32,50,85,.0)}
.badge{
  display:inline-flex; align-items:center; justify-content:center;
  padding:6px 10px; border-radius:999px;
  font-size:12px; border:1px solid rgba(32,50,85,.8);
  color:var(--muted);
}
.badge.agendada{border-color:rgba(110,168,255,.5); color:#cfe1ff}
.badge.confirmada{border-color:rgba(120,240,215,.45); color:#c5fff2}
.badge.concluida{border-color:rgba(67,209,127,.5); color:#d7ffea}
.badge.cancelada{border-color:rgba(255,107,107,.5); color:#ffd7d7}
.badge.faltou{border-color:rgba(255,204,102,.5); color:#ffe8b5}
.muted{color:var(--muted)}
.toast{
  position:fixed; left:16px; right:16px; bottom:16px; z-index:60;
  display:flex; justify-content:center;
}
.toast .msg{
  max-width:720px;
  width:100%;
  background:rgba(15,27,51,.92);
  border:1px solid rgba(32,50,85,.85);
  border-left:4px solid rgba(110,168,255,.85);
  border-radius:14px;
  padding:12px 14px;
  box-shadow:var(--shadow);
}
.modal{
  position:fixed; inset:0; z-index:50;
  background:rgba(0,0,0,.55);
  display:flex; align-items:flex-end; justify-content:center;
  padding:16px;
}
.modal .panel{
  width:100%; max-width:720px;
  background:rgba(15,27,51,.98);
  border:1px solid rgba(32,50,85,.85);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:14px;
}
@media (min-width: 860px){
  .modal{align-items:center}
  .card.pad{padding:18px}
}
.col-12{grid-column:span 12}
.col-6{grid-column:span 12}
.col-4{grid-column:span 12}
.col-8{grid-column:span 12}
@media (min-width: 860px){
  .col-6{grid-column:span 6}
  .col-4{grid-column:span 4}
  .col-8{grid-column:span 8}
}


/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px 16px;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 900px 600px at 20% 0%, rgba(110,168,255,.32), transparent 60%),
    radial-gradient(ellipse 700px 500px at 85% 100%, rgba(120,240,215,.2), transparent 55%),
    radial-gradient(ellipse 500px 400px at 60% 50%, rgba(110,168,255,.08), transparent 60%),
    var(--bg);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(15,27,51,.82);
  border: 1px solid rgba(110,168,255,.18);
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(110,168,255,.06),
    0 24px 60px rgba(0,0,0,.55),
    0 0 80px rgba(110,168,255,.07);
  padding: 36px 32px 32px;
  backdrop-filter: blur(18px);
  animation: loginCardIn .5s cubic-bezier(.22,1,.36,1) both;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.login-logo {
  width: 96px;
  height: 96px;
  border-radius: 26px;
  box-shadow:
    0 0 0 6px rgba(110,168,255,.15),
    0 0 0 12px rgba(110,168,255,.07),
    0 12px 40px rgba(110,168,255,.4);
  animation: logoPop .6s .1s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes logoPop {
  from { opacity: 0; transform: scale(.6); }
  to   { opacity: 1; transform: scale(1); }
}

.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #eaf0ff 30%, var(--brand2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 28px;
}

.login-fields {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  letter-spacing: .3px;
  background: linear-gradient(135deg, rgba(110,168,255,1), rgba(120,240,215,.85));
  color: #06101f;
  border: none;
  box-shadow: 0 4px 20px rgba(110,168,255,.35);
  transition: opacity .15s, transform .15s;
}

.login-btn:hover:not(:disabled) {
  opacity: .92;
  transform: translateY(-1px);
}

.login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-footer {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* =============================================
   WELCOME / SPLASH SCREEN
   ============================================= */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: welcomeIn .4s ease both;
}

@keyframes welcomeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.welcome-screen.welcome-out {
  animation: welcomeOut .6s cubic-bezier(.4,0,1,1) forwards;
}

@keyframes welcomeOut {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); }
}

.welcome-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 1000px 700px at 50% 30%, rgba(110,168,255,.28), transparent 60%),
    radial-gradient(ellipse 600px 500px at 80% 80%, rgba(120,240,215,.18), transparent 55%),
    var(--bg);
}

.welcome-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
}

.welcome-avatar-wrap {
  margin-bottom: 28px;
  animation: avatarDrop .7s .15s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes avatarDrop {
  from { opacity: 0; transform: translateY(-30px) scale(.7); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(110,168,255,.5);
  box-shadow:
    0 0 0 8px rgba(110,168,255,.1),
    0 0 0 16px rgba(110,168,255,.05),
    0 24px 60px rgba(0,0,0,.6);
  display: block;
}

.welcome-avatar-iniciais {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(110,168,255,.9), rgba(120,240,215,.7));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 58px;
  font-weight: 900;
  color: #fff;
  border: 4px solid rgba(110,168,255,.5);
  box-shadow:
    0 0 0 8px rgba(110,168,255,.1),
    0 0 0 16px rgba(110,168,255,.05),
    0 24px 60px rgba(0,0,0,.6);
}

.welcome-text {
  animation: welcomeTextIn .6s .45s cubic-bezier(.22,1,.36,1) both;
}

@keyframes welcomeTextIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.welcome-greeting {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.welcome-nome {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 900;
  letter-spacing: -.5px;
  line-height: 1.1;
  background: linear-gradient(135deg, #eaf0ff 20%, var(--brand2) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.welcome-clinica {
  font-size: 16px;
  color: var(--muted);
  font-weight: 500;
}

.welcome-dots {
  display: flex;
  gap: 8px;
  margin-top: 40px;
  animation: welcomeTextIn .5s .8s both;
}

.welcome-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(110,168,255,.5);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.welcome-dots span:nth-child(2) { animation-delay: .2s; }
.welcome-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes dotPulse {
  0%, 100% { opacity: .3; transform: scale(.8); }
  50%       { opacity: 1;  transform: scale(1.2); background: rgba(120,240,215,.8); }
}

/* =============================================
   IMPORT / EXPORT EXCEL
   ============================================= */
.import-status {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  border: 1px solid transparent;
}
.import-loading { background: rgba(110,168,255,.12); border-color: rgba(110,168,255,.3); color: var(--brand); }
.import-ok      { background: rgba(67,209,127,.12);  border-color: rgba(67,209,127,.35); color: #43d17f; }
.import-erro    { background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.35); color: var(--danger); }

.import-hint {
  margin-bottom: 4px;
}
.import-hint-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 640px) {
  .import-hint-body { grid-template-columns: 1fr; }
}
.import-hint-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.import-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.import-col {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(110,168,255,.1);
  border: 1px solid rgba(110,168,255,.25);
  color: var(--brand);
}
.import-col.required {
  background: rgba(120,240,215,.1);
  border-color: rgba(120,240,215,.3);
  color: var(--brand2);
}

/* =============================================
   LEMBRETES — PERFIL
   ============================================= */
.lembrete-dias-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: rgba(110,168,255,.06);
  border: 1px solid rgba(110,168,255,.15);
  border-radius: 12px;
}
.lembrete-dia-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}
.lembrete-chk {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}
.lembrete-textarea {
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  min-height: 90px;
}
.lembrete-vars {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}
.lembrete-reset-btn {
  margin-top: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  border-color: rgba(32,50,85,.6);
}
.lembrete-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.lembrete-toggle-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

/* =============================================
   PUSH NOTIFICATIONS — PERFIL
   ============================================= */
.push-status {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid transparent;
  margin-bottom: 4px;
}
.push-ok          { background: rgba(67,209,127,.1);  border-color: rgba(67,209,127,.3);  color: #43d17f; }
.push-warn        { background: rgba(255,204,102,.1); border-color: rgba(255,204,102,.3); color: var(--warn); }
.push-erro        { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.3); color: var(--danger); }
.push-unsupported { background: rgba(147,164,199,.1); border-color: rgba(147,164,199,.3); color: var(--muted); }

.push-btn {
  min-width: 180px;
}

/* ── Banner de instalação PWA ── */
.pwa-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 55;
  background: rgba(15,27,51,.97);
  border-top: 1px solid rgba(110,168,255,.25);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 -8px 32px rgba(0,0,0,.4);
  animation: slideUp .35s cubic-bezier(.22,1,.36,1) both;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.pwa-banner-icon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.pwa-banner-text { flex: 1; }
.pwa-banner-text strong { display: block; font-size: 14px; margin-bottom: 2px; }
.pwa-banner-text span   { font-size: 12px; color: var(--muted); }

/* =============================================
   DASHBOARD — CLEAN
   ============================================= */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.dash-saudacao {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.2px;
}
.dash-data {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  text-transform: capitalize;
}
.card-label-row {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.next-nome {
  font-weight: 800;
  font-size: 18px;
}
.slot-btn {
  padding: 7px 11px;
  font-size: 13px;
  border-radius: 10px;
}

/* =============================================
   AGENDA — TOOLBAR COMPACTA
   ============================================= */
.agenda-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  background: rgba(15,27,51,.6);
  border: 1px solid rgba(32,50,85,.7);
  border-radius: 16px;
  padding: 10px 14px;
}
.agenda-shortcuts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.agenda-toolbar .input {
  max-width: 130px;
  padding: 8px 10px;
  font-size: 13px;
}
.agenda-toolbar .input[placeholder*="Buscar"] {
  max-width: 220px;
}
@media (max-width: 700px) {
  .agenda-toolbar { flex-direction: column; align-items: stretch; }
  .agenda-toolbar .input { max-width: 100%; }
  .agenda-toolbar .input[placeholder*="Buscar"] { max-width: 100%; }
}

/* Slots livres — barra discreta */
.slots-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: rgba(110,168,255,.05);
  border: 1px solid rgba(110,168,255,.12);
  border-radius: 12px;
  margin-bottom: 10px;
}
.slots-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-right: 4px;
}

/* =============================================
   DROPDOWN MENU (⋯)
   ============================================= */
.dropdown-wrap {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  background: rgba(15,27,51,.98);
  border: 1px solid rgba(32,50,85,.9);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  min-width: 210px;
  overflow: hidden;
  animation: dropIn .15s cubic-bezier(.22,1,.36,1) both;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .1s;
}
.dropdown-item:hover {
  background: rgba(110,168,255,.1);
}
.dropdown-item + .dropdown-item {
  border-top: 1px solid rgba(32,50,85,.5);
}

/* =============================================
   LISTA DE PACIENTES — MOBILE FIRST
   ============================================= */
.patient-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.patient-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(8,13,24,.35);
  border: 1px solid rgba(32,50,85,.5);
  text-decoration: none;
  color: var(--text);
  transition: background .12s;
  cursor: pointer;
}

.patient-row:hover {
  background: rgba(110,168,255,.07);
  border-color: rgba(110,168,255,.2);
}

.patient-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(110,168,255,.7), rgba(120,240,215,.5));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.patient-info {
  flex: 1;
  min-width: 0;
}

.patient-nome {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.patient-tel {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.patient-action-btn {
  padding: 6px 10px;
  font-size: 16px;
  letter-spacing: 1px;
  border-radius: 10px;
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  line-height: 1;
}

.patient-action-btn:hover {
  background: rgba(110,168,255,.1);
  color: var(--text);
}

/* Item de perigo no dropdown */
.danger-item {
  color: var(--danger) !important;
}
.danger-item:hover {
  background: rgba(255,107,107,.1) !important;
}

/* Ícone dentro do dropdown */
.dropdown-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: .85;
}

/* =============================================
   BOTÕES EXCEL — ícone + texto (desktop) / só ícone (mobile)
   ============================================= */
.btn-excel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
}

.excel-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  /* mantém cores originais do Excel */
}

.excel-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* Mobile: esconde o texto, mantém só o ícone */
@media (max-width: 600px) {
  .excel-label {
    display: none;
  }
  .btn-excel {
    padding: 9px 10px;
  }
}

/* =============================================
   DATE PICKER CUSTOMIZADO
   ============================================= */
.dp-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.dp-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(32,50,85,.9);
  background: rgba(8,13,24,.65);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.dp-trigger:hover,
.dp-trigger:focus {
  border-color: rgba(110,168,255,.65);
  box-shadow: 0 0 0 3px rgba(110,168,255,.1);
  outline: none;
}
.dp-trigger-icon { font-size: 15px; flex-shrink: 0; }
.dp-trigger-text { flex: 1; }
.dp-placeholder   { color: var(--muted); }

/* Popup */
.dp-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: rgba(11,20,40,.98);
  border: 1px solid rgba(110,168,255,.2);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.6);
  padding: 14px;
  min-width: 280px;
  animation: dpIn .15s cubic-bezier(.22,1,.36,1) both;
}
@keyframes dpIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cabeçalho */
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 4px;
}
.dp-header-labels {
  display: flex;
  gap: 4px;
}
.dp-header-btn {
  background: rgba(110,168,255,.1);
  border: 1px solid rgba(110,168,255,.2);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  transition: background .12s;
}
.dp-header-btn:hover { background: rgba(110,168,255,.22); }
.dp-header-range {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 5px 8px;
}
.dp-nav {
  background: none;
  border: 1px solid rgba(32,50,85,.7);
  border-radius: 8px;
  color: var(--muted);
  font-size: 16px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
.dp-nav:hover { background: rgba(110,168,255,.12); color: var(--text); }

/* Dias da semana */
.dp-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.dp-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* Grid de dias */
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.dp-cell:hover:not(.dp-disabled):not(.dp-selected) {
  background: rgba(110,168,255,.15);
}
.dp-cell.dp-today {
  border: 1px solid rgba(110,168,255,.5);
  color: var(--brand);
  font-weight: 700;
}
.dp-cell.dp-selected {
  background: linear-gradient(135deg, rgba(110,168,255,.9), rgba(120,240,215,.7));
  color: #06101f;
  font-weight: 800;
}
.dp-cell.dp-empty { pointer-events: none; }
.dp-cell.dp-disabled { opacity: .3; cursor: not-allowed; }

/* Grid de meses */
.dp-month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.dp-month-cell {
  padding: 10px 4px;
  border-radius: 10px;
  border: 1px solid rgba(32,50,85,.6);
  background: rgba(8,13,24,.4);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .1s;
}
.dp-month-cell:hover { background: rgba(110,168,255,.15); border-color: rgba(110,168,255,.3); }
.dp-month-cell.dp-selected {
  background: linear-gradient(135deg, rgba(110,168,255,.9), rgba(120,240,215,.7));
  color: #06101f;
  border-color: transparent;
}

/* Grid de anos */
.dp-year-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.dp-year-cell {
  padding: 10px 4px;
  border-radius: 10px;
  border: 1px solid rgba(32,50,85,.6);
  background: rgba(8,13,24,.4);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .1s;
}
.dp-year-cell:hover { background: rgba(110,168,255,.15); border-color: rgba(110,168,255,.3); }
.dp-year-cell.dp-selected {
  background: linear-gradient(135deg, rgba(110,168,255,.9), rgba(120,240,215,.7));
  color: #06101f;
  border-color: transparent;
}

/* Date-Time picker */
.dtp-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
}
.dtp-wrap .dp-wrap { flex: 1; min-width: 0; }
.dtp-time {
  width: 110px !important;
  min-width: 110px !important;
  flex-shrink: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 10px 8px !important;
}

/* =============================================
   BUSCA DE PACIENTE — MODAL AGENDAR
   ============================================= */
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(32,50,85,.6);
  background: rgba(8,13,24,.4);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .1s, border-color .1s;
  margin-bottom: 4px;
}
.search-result:hover {
  background: rgba(110,168,255,.1);
  border-color: rgba(110,168,255,.3);
}
.search-result:last-child { margin-bottom: 0; }

.search-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(110,168,255,.7), rgba(120,240,215,.5));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.search-info { flex: 1; min-width: 0; }
.search-nome {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-tel {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.search-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.search-selected-tag {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(120,240,215,.1);
  border: 1px solid rgba(120,240,215,.3);
  color: var(--brand2);
  font-size: 13px;
  font-weight: 700;
}

/* =============================================
   CARD DE TEMA — PERFIL
   ============================================= */
.theme-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid rgba(32,50,85,.5);
  background: transparent;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  min-width: 130px;
}
.theme-option:hover {
  border-color: rgba(110,168,255,.4);
}
.theme-option.theme-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(110,168,255,.15);
}

/* Preview miniatura */
.theme-preview {
  width: 120px;
  height: 76px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.theme-preview-dark {
  background: #0b1220;
  border: 1px solid #203255;
}
.theme-preview-light {
  background: #f0f2f7;
  border: 1px solid #dde3f0;
}

.tp-topbar {
  height: 10px;
  border-radius: 4px;
  flex-shrink: 0;
}
.theme-preview-dark  .tp-topbar { background: #0f1b33; }
.theme-preview-light .tp-topbar { background: #ffffff; border: 1px solid #dde3f0; }

.tp-card {
  height: 18px;
  border-radius: 4px;
}
.tp-card-sm { height: 12px; width: 70%; }
.theme-preview-dark  .tp-card { background: #0f1b33; }
.theme-preview-light .tp-card { background: #ffffff; border: 1px solid #dde3f0; }

.theme-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* Ajuste do card de tema no modo claro */
body.light .theme-option {
  border-color: rgba(200,210,230,.7);
}
body.light .theme-option:hover {
  border-color: rgba(37,99,235,.4);
}
body.light .theme-option.theme-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* =============================================
   AÇÕES DO PACIENTE — DESKTOP / MOBILE
   ============================================= */

/* Botões individuais — desktop */
.patient-actions-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Botão de ação individual */
.pac-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  transition: background .12s;
}
.pac-btn:hover {
  background: rgba(110,168,255,.12);
}
.pac-btn-wa:hover {
  background: rgba(37,211,102,.12);
}
.pac-btn-danger:hover {
  background: rgba(255,107,107,.12);
}

/* Mobile: esconde desktop, mostra •••  */
.patient-actions-mobile {
  display: none;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .patient-actions-desktop { display: none; }
  .patient-actions-mobile  { display: block; }
}

/* Modo claro — botões */
body.light .pac-btn:hover         { background: rgba(37,99,235,.08); }
body.light .pac-btn-wa:hover      { background: rgba(22,163,74,.08); }
body.light .pac-btn-danger:hover  { background: rgba(220,38,38,.08); }

/* =============================================
   LOGIN — EXTRAS (senha, lembrar, esqueci, bio)
   ============================================= */
.login-senha-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.login-senha-wrap .input {
  padding-right: 42px;
}
.btn-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  color: var(--muted);
  line-height: 1;
}
.btn-eye:hover { color: var(--text); }

.login-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.login-lembrar {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.btn-link {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link:hover { opacity: .8; }
.btn-link:disabled { opacity: .5; cursor: not-allowed; }

.login-bio-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 14px;
  border-color: rgba(110,168,255,.3);
  background: rgba(110,168,255,.07);
  color: var(--brand);
  gap: 8px;
  justify-content: center;
}
.login-bio-btn:hover {
  background: rgba(110,168,255,.14);
}

/* Modo claro */
body.light .btn-eye { color: var(--muted); }
body.light .login-bio-btn {
  border-color: rgba(37,99,235,.25);
  background: rgba(37,99,235,.05);
  color: var(--brand);
}

/* Toggle login ↔ cadastro */
.login-toggle-row {
  text-align: center;
  padding: 14px 0 4px;
  font-size: 13px;
  border-top: 1px solid rgba(32,50,85,.4);
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
body.light .login-toggle-row { border-color: rgba(200,210,230,.5); }


/* =============================================
   MOBILE REFACTOR — UI/UX v2
   ============================================= */

/* ── Topbar compacta (sem nav textual) ── */
.topbar-actions {
  gap: 6px;
  flex-wrap: nowrap;
}
.topbar-icon-btn {
  padding: 9px 11px;
  font-size: 17px;
  border-radius: 12px;
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── FAB Dashboard ── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 45;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(110,168,255,.95), rgba(120,240,215,.8));
  color: #06101f;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(110,168,255,.45), 0 2px 8px rgba(0,0,0,.35);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  border: none;
}
.fab:hover,
.fab:focus {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 32px rgba(110,168,255,.55), 0 4px 12px rgba(0,0,0,.4);
  outline: none;
}
.fab:active {
  transform: scale(.96);
}
.fab.fab-active {
  background: linear-gradient(135deg, rgba(120,240,215,.95), rgba(110,168,255,.8));
  box-shadow: 0 0 0 4px rgba(120,240,215,.25), 0 6px 24px rgba(120,240,215,.4);
}

/* Garante que o conteúdo da página não fique atrás do FAB */
.page-content {
  padding-bottom: 88px;
}

/* ── Cards de acesso rápido (Agenda / Pacientes) ── */
.quick-access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 12px;
  border-radius: var(--radius);
  background: rgba(15,27,51,.82);
  border: 1px solid rgba(110,168,255,.2);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: background .15s, transform .12s, border-color .15s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.quick-card:hover,
.quick-card:focus {
  background: rgba(110,168,255,.12);
  border-color: rgba(110,168,255,.45);
  transform: translateY(-2px);
  outline: none;
}
.quick-card:active {
  transform: scale(.97);
}

.quick-card-icon {
  font-size: 36px;
  line-height: 1;
}

.quick-card-label {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.2px;
}

.quick-card-sub {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Tema claro */
body.light .quick-card {
  background: #ffffff;
  border-color: rgba(37,99,235,.18);
}
body.light .quick-card:hover {
  background: rgba(37,99,235,.06);
  border-color: rgba(37,99,235,.35);
}

/* ── Inputs e selects maiores (acessibilidade touch) ── */
.input,
select,
textarea {
  font-size: 16px !important; /* evita zoom automático no iOS */
  padding: 13px 14px !important;
  min-height: 48px;
}

/* Seletor de hora no date-time picker */
.dtp-time {
  font-size: 18px !important;
  font-weight: 700;
  padding: 13px 10px !important;
  min-height: 48px;
  min-width: 90px;
  text-align: center;
  letter-spacing: .5px;
}

/* Trigger do date picker */
.dp-trigger {
  font-size: 16px !important;
  padding: 13px 14px !important;
  min-height: 48px;
}

/* Labels maiores */
.label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  opacity: .75;
  margin-bottom: 8px;
}
.modal-label {
  font-size: 14px;
  opacity: 1;
  color: var(--muted);
}

/* ── Modal mobile-first ── */
.modal {
  align-items: flex-end; /* sempre bottom-sheet no mobile */
  padding: 0;
}
.modal .panel {
  border-radius: 22px 22px 0 0;
  padding: 20px 18px 32px;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 600px) {
  .modal {
    align-items: center;
    padding: 16px;
  }
  .modal .panel {
    border-radius: 18px;
    max-height: 90vh;
  }
}

/* Cabeçalho do modal */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
}
.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}
.modal-close-btn {
  padding: 8px 12px;
  font-size: 16px;
  border-radius: 10px;
  min-width: 40px;
  min-height: 40px;
}

/* Info do paciente no modal */
.modal-patient-info {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: rgba(110,168,255,.06);
  border: 1px solid rgba(110,168,255,.12);
  border-radius: 10px;
}

/* Formulário empilhado verticalmente */
.modal-form-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(32,50,85,.4);
}
.modal-field:last-of-type {
  border-bottom: none;
}

/* Botões de ação do modal */
.modal-actions {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  flex-wrap: wrap;
}
.modal-actions .btn {
  flex: 1;
  min-height: 50px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
}
.modal-actions .btn.primary {
  min-height: 52px;
}

/* Tema claro — modal */
body.light .modal-patient-info {
  background: rgba(37,99,235,.05);
  border-color: rgba(37,99,235,.12);
}
body.light .modal-field {
  border-color: rgba(200,210,230,.5);
}

/* ── DTP wrap — empilha data e hora verticalmente no mobile ── */
.dtp-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.dtp-wrap .dp-wrap {
  flex: 1;
  min-width: 160px;
}
.dtp-wrap .dtp-time {
  flex-shrink: 0;
  width: auto;
}

/* ── Popup do date picker — não sai da tela no mobile ── */
@media (max-width: 480px) {
  .dp-popup {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 20px 20px 0 0;
    min-width: unset;
    width: 100%;
    z-index: 300;
    padding: 18px 16px 32px;
    animation: dpSlideUp .2s cubic-bezier(.22,1,.36,1) both;
  }
  @keyframes dpSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .dp-cell {
    min-height: 40px;
    font-size: 15px;
  }
  .dp-weekday {
    font-size: 12px;
  }
}

/* ── Células do calendário maiores para toque ── */
.dp-cell {
  min-height: 36px;
  min-width: 36px;
  font-size: 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Botões de slot (horários livres) maiores ── */
.slot-btn {
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  min-height: 44px;
  border-radius: 12px;
}

/* ── Tabela de consultas — fonte legível ── */
.tr td {
  font-size: 14px;
}
.tr td .sub {
  font-size: 13px;
}


/* =============================================
   APPOINTMENT PICKER — data única + horários
   ============================================= */
.appt-picker-wrap {
  display: contents; /* os filhos (modal-field) entram direto no fluxo do form */
}

.appt-times-field {
  border-bottom: 1px solid rgba(32,50,85,.4);
}
body.light .appt-times-field {
  border-color: rgba(200,210,230,.5);
}

.appt-times-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.appt-time-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.appt-time-sep {
  font-size: 18px;
  color: var(--muted);
  padding-bottom: 12px;
  flex-shrink: 0;
  user-select: none;
}

/* Input de horário grande e fácil de tocar */
.appt-time {
  font-size: 20px !important;
  font-weight: 700;
  padding: 13px 10px !important;
  min-height: 52px;
  text-align: center;
  letter-spacing: .5px;
  border-radius: 14px;
}

/* Flash visual quando o horário de fim é ajustado automaticamente */
@keyframes apptTimeAdjusted {
  0%   { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(255,204,102,.3); }
  100% { border-color: rgba(32,50,85,.9); box-shadow: none; }
}
.appt-time-adjusted {
  animation: apptTimeAdjusted 1.2s ease forwards;
}


/* =============================================
   CARDS DE CONSULTA — AÇÕES RÁPIDAS
   ============================================= */
.consult-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.consult-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(8,13,24,.45);
  border: 1px solid rgba(32,50,85,.6);
  border-left: 4px solid rgba(32,50,85,.6);
  transition: transform .25s ease, background .15s;
  overflow: hidden;
  position: relative;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

/* Cores da borda esquerda por status */
.consult-card-agendada   { border-left-color: rgba(110,168,255,.7); }
.consult-card-confirmada { border-left-color: rgba(67,209,127,.8); }
.consult-card-concluida  { border-left-color: rgba(167,139,250,.8); }
.consult-card-cancelada  { border-left-color: rgba(255,107,107,.7); opacity: .65; }
.consult-card-faltou     { border-left-color: rgba(255,204,102,.7); }

/* Indicador de swipe */
.consult-card.swipe-right { background: rgba(67,209,127,.12); }
.consult-card.swipe-left  { background: rgba(255,107,107,.1); }

/* Coluna esquerda — horário */
.consult-card-left {
  flex-shrink: 0;
  min-width: 52px;
  text-align: center;
}
.consult-time {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.3px;
  line-height: 1.1;
}
.consult-time-end {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Coluna central — paciente */
.consult-card-mid {
  flex: 1;
  min-width: 0;
}
.consult-nome {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.consult-tel {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Coluna direita — badge + ações */
.consult-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.consult-badge-wrap {
  position: relative;
}

/* Badge como botão clicável */
.badge-btn {
  cursor: pointer;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  transition: transform .1s, opacity .1s;
  -webkit-tap-highlight-color: transparent;
}
.badge-btn:hover  { opacity: .85; }
.badge-btn:active { transform: scale(.93); }

/* Cores dos badges */
.badge.agendada   { background: rgba(110,168,255,.15); border: 1px solid rgba(110,168,255,.5); color: #cfe1ff; }
.badge.confirmada { background: rgba(67,209,127,.15);  border: 1px solid rgba(67,209,127,.5);  color: #d7ffea; }
.badge.concluida  { background: rgba(167,139,250,.15); border: 1px solid rgba(167,139,250,.5); color: #ede9fe; }
.badge.cancelada  { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.5); color: #ffd7d7; }
.badge.faltou     { background: rgba(255,204,102,.12); border: 1px solid rgba(255,204,102,.5); color: #ffe8b5; }

/* Menu rápido de status */
.status-quick-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  background: rgba(11,20,40,.98);
  border: 1px solid rgba(110,168,255,.2);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.55);
  min-width: 200px;
  overflow: hidden;
  animation: dropIn .15s cubic-bezier(.22,1,.36,1) both;
}

.status-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .1s;
  border-bottom: 1px solid rgba(32,50,85,.4);
}
.status-menu-item:last-child { border-bottom: none; }
.status-menu-item:hover      { background: rgba(110,168,255,.1); }
.status-menu-confirmada:hover { background: rgba(67,209,127,.1); }
.status-menu-cancelada        { color: #ffd7d7; }
.status-menu-cancelada:hover  { background: rgba(255,107,107,.1); }
.status-menu-concluida:hover  { background: rgba(167,139,250,.1); }
.status-menu-faltou:hover     { background: rgba(255,204,102,.1); }

/* Botões de ação rápida no card */
.consult-actions {
  display: flex;
  gap: 4px;
}
.consult-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(32,50,85,.5);
  background: rgba(15,27,51,.6);
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background .12s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.consult-action-btn:hover  { background: rgba(110,168,255,.12); border-color: rgba(110,168,255,.3); }
.consult-action-btn:active { transform: scale(.9); }

/* ── Painel de confirmação de cancelamento ── */
.cancel-confirm-panel {
  text-align: center;
  padding: 28px 20px 24px;
}
.cancel-icon  { font-size: 40px; margin-bottom: 12px; }
.cancel-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.cancel-sub   { font-size: 14px; color: var(--muted); margin-bottom: 20px; }

/* ── Chips de motivo de cancelamento ── */
.cancel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.cancel-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(32,50,85,.7);
  background: rgba(15,27,51,.6);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.cancel-chip:hover   { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.4); }
.cancel-chip.selected {
  background: rgba(255,107,107,.18);
  border-color: rgba(255,107,107,.7);
  color: #ffd7d7;
}

/* ── Tema claro ── */
body.light .consult-card {
  background: rgba(240,242,247,.6);
  border-color: rgba(200,210,230,.6);
}
body.light .consult-card-agendada   { border-left-color: rgba(37,99,235,.6); }
body.light .consult-card-confirmada { border-left-color: rgba(22,163,74,.7); }
body.light .consult-card-concluida  { border-left-color: rgba(124,58,237,.6); }
body.light .consult-card-cancelada  { border-left-color: rgba(220,38,38,.6); }
body.light .consult-card-faltou     { border-left-color: rgba(217,119,6,.6); }
body.light .consult-card.swipe-right { background: rgba(22,163,74,.08); }
body.light .consult-card.swipe-left  { background: rgba(220,38,38,.06); }
body.light .badge.agendada   { background: rgba(37,99,235,.1);  border-color: rgba(37,99,235,.4);  color: #1d4ed8; }
body.light .badge.confirmada { background: rgba(22,163,74,.1);  border-color: rgba(22,163,74,.4);  color: #15803d; }
body.light .badge.concluida  { background: rgba(124,58,237,.1); border-color: rgba(124,58,237,.4); color: #6d28d9; }
body.light .badge.cancelada  { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.4);  color: #dc2626; }
body.light .badge.faltou     { background: rgba(217,119,6,.1);  border-color: rgba(217,119,6,.4);  color: #d97706; }
body.light .status-quick-menu {
  background: #ffffff;
  border-color: rgba(200,210,230,.8);
  box-shadow: 0 8px 24px rgba(30,50,100,.12);
}
body.light .status-menu-item { color: var(--text); border-color: rgba(200,210,230,.5); }
body.light .cancel-chip {
  background: #f8faff;
  border-color: rgba(200,210,230,.8);
  color: var(--text);
}
body.light .consult-action-btn {
  background: #f8faff;
  border-color: rgba(200,210,230,.8);
}


/* =============================================
   AUDITORIA — CORREÇÕES E MELHORIAS
   ============================================= */

/* ── 1. Bottom Navigation Bar ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  align-items: stretch;
  background: rgba(11,18,32,.97);
  border-top: 1px solid rgba(32,50,85,.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px 8px;
  text-decoration: none;
  color: var(--muted);
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  border: none;
  background: none;
  cursor: pointer;
  min-height: 56px;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
  color: var(--brand);
  background: rgba(110,168,255,.06);
  outline: none;
}

.bottom-nav-item.active {
  color: var(--brand);
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.15);
}

.bottom-nav-icon {
  font-size: 20px;
  line-height: 1;
  transition: transform .15s;
  display: block;
}

.bottom-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  line-height: 1;
}

/* Indicador ativo — ponto abaixo do ícone */
.bottom-nav-item.active::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 2px;
}

/* Ajusta padding do conteúdo para não ficar atrás da bottom nav */
.page-content {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Tema claro */
body.light .bottom-nav {
  background: rgba(255,255,255,.97);
  border-top-color: rgba(200,210,230,.8);
  box-shadow: 0 -4px 20px rgba(30,50,100,.08);
}
body.light .bottom-nav-item.active { color: var(--brand); }
body.light .bottom-nav-item:hover  { background: rgba(37,99,235,.05); }

/* Desktop: esconde bottom nav, mostra topbar normal */
@media (min-width: 860px) {
  .bottom-nav { display: none; }
  .page-content { padding-bottom: 24px !important; }
}

/* ── 2. Swipe — ícones animados ── */
.swipe-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .1s;
  z-index: 2;
}
.swipe-hint-right { left: 14px; }
.swipe-hint-left  { right: 14px; }

/* Cores mais vibrantes no swipe */
.consult-card.swipe-right {
  background: rgba(67,209,127,.2) !important;
  border-left-color: rgba(67,209,127,.9) !important;
}
.consult-card.swipe-left {
  background: rgba(255,107,107,.18) !important;
  border-left-color: rgba(255,107,107,.9) !important;
}

/* ── 3. Contraste aumentado no tema claro ── */
body.light {
  --muted: #5a6a8a; /* era #7a8aaa — razão 6.5:1 */
}

/* ── 4. Labels maiores nos modais ── */
.modal-label {
  font-size: 15px !important;
  font-weight: 700;
  opacity: 1;
  color: var(--muted);
}

/* ── 5. Telefone maior nos cards ── */
.consult-tel {
  font-size: 13px !important;
}

/* ── 6. Topbar compacta em mobile ── */
@media (max-width: 480px) {
  .brand h1   { font-size: 13px; }
  .brand small { display: none; } /* esconde subtítulo em telas muito pequenas */
  .topbar .row { padding: 8px 12px; }
  .topbar-icon-btn { min-width: 38px; min-height: 38px; padding: 7px 9px; }
}

/* ── 7. Seletor de horário — stack vertical em telas < 400px ── */
@media (max-width: 400px) {
  .appt-times-row {
    flex-direction: column;
    gap: 8px;
  }
  .appt-time-sep { display: none; }
  .appt-time-group { width: 100%; }
  .appt-time { width: 100%; text-align: left; }
}

/* ── 8. Skeleton screens ── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  pointer-events: none;
  cursor: default;
}

.skeleton-time,
.skeleton-badge,
.skeleton-line {
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(32,50,85,.4) 25%,
    rgba(110,168,255,.12) 50%,
    rgba(32,50,85,.4) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-time {
  width: 44px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.skeleton-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 14px;
  width: 80%;
}

.skeleton-line.short {
  width: 50%;
  height: 11px;
}

.skeleton-badge {
  width: 72px;
  height: 26px;
  border-radius: 999px;
  flex-shrink: 0;
}

body.light .skeleton-time,
body.light .skeleton-badge,
body.light .skeleton-line {
  background: linear-gradient(
    90deg,
    rgba(200,210,230,.5) 25%,
    rgba(37,99,235,.08) 50%,
    rgba(200,210,230,.5) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}

/* ── 9. Menu de status — posicionamento dinâmico ── */
.status-quick-menu {
  /* base: abre abaixo */
  top: calc(100% + 6px);
  bottom: auto;
}
/* classe adicionada via JS quando espaço insuficiente abaixo */
.status-quick-menu.open-above {
  top: auto;
  bottom: calc(100% + 6px);
}

/* ── 10. Skip link de acessibilidade ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 9999;
  background: var(--brand);
  color: #06101f;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus {
  top: 16px;
}


/* =============================================
   FLUXOS DE CONCLUSÃO / FALTOU + MELHORIAS
   ============================================= */

/* ── Botões de ação rápida ✔️ e 🚫 ── */
.action-concluir {
  border-color: rgba(67,209,127,.45) !important;
  color: #43d17f !important;
}
.action-concluir:hover {
  background: rgba(67,209,127,.15) !important;
  border-color: rgba(67,209,127,.7) !important;
}

.action-faltou {
  border-color: rgba(255,204,102,.45) !important;
  color: var(--warn) !important;
}
.action-faltou:hover {
  background: rgba(255,204,102,.15) !important;
  border-color: rgba(255,204,102,.7) !important;
}

/* ── Botão "Confirmar Falta" (laranja) ── */
.warn-btn {
  background: linear-gradient(135deg, rgba(255,204,102,.9), rgba(255,160,50,.8));
  color: #1a1000;
  border-color: transparent;
  font-weight: 700;
}
.warn-btn:hover:not(:disabled) { opacity: .9; }

/* ── Menu de status — item primário destacado ── */
.status-menu-primary {
  font-weight: 700;
  color: var(--text) !important;
  background: rgba(110,168,255,.08);
}
.status-menu-primary:hover { background: rgba(110,168,255,.18) !important; }

.status-menu-concluida.status-menu-primary {
  background: rgba(67,209,127,.1);
  color: #d7ffea !important;
}
.status-menu-concluida.status-menu-primary:hover { background: rgba(67,209,127,.18) !important; }

.status-menu-empty {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── Toast com cor por tipo ── */
.toast-success .msg { border-left-color: rgba(67,209,127,.9) !important; }
.toast-danger  .msg { border-left-color: rgba(255,107,107,.9) !important; }
.toast-warn    .msg { border-left-color: rgba(255,204,102,.9) !important; }
.toast-info    .msg { border-left-color: rgba(110,168,255,.9) !important; }

/* ── Animação de pulse no card ao mudar status ── */
@keyframes cardPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.025); box-shadow: 0 0 0 4px rgba(110,168,255,.2); }
  100% { transform: scale(1); box-shadow: none; }
}
.card-pulse {
  animation: cardPulse .45s cubic-bezier(.22,1,.36,1) both;
}

/* Tema claro */
body.light .action-concluir { border-color: rgba(22,163,74,.4) !important; color: #15803d !important; }
body.light .action-faltou   { border-color: rgba(217,119,6,.4) !important; color: #d97706 !important; }
body.light .status-menu-primary { background: rgba(37,99,235,.07); }
body.light .warn-btn { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }


/* =============================================
   TOPBAR — DROPDOWN DE PERFIL
   ============================================= */

/* Botão trigger — avatar + chevron */
.topbar-profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 5px;
  border-radius: 999px;
  border: 1px solid rgba(32,50,85,.7);
  background: rgba(15,27,51,.6);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.topbar-profile-btn:hover,
.topbar-profile-btn:focus {
  background: rgba(110,168,255,.1);
  border-color: rgba(110,168,255,.4);
  outline: none;
}
.topbar-profile-btn.open {
  background: rgba(110,168,255,.14);
  border-color: rgba(110,168,255,.55);
}

/* Avatar dentro do trigger */
.topbar-avatar-trigger {
  width: 30px !important;
  height: 30px !important;
  font-size: 11px !important;
  border: none !important;
  flex-shrink: 0;
}

/* Chevron animado */
.topbar-chevron {
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: transform .2s;
}
.topbar-profile-btn.open .topbar-chevron {
  transform: rotate(180deg);
}

/* Wrapper do dropdown */
.topbar-profile-wrap {
  position: relative;
}

/* Menu dropdown */
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 180px;
  background: rgba(11,20,40,.98);
  border: 1px solid rgba(110,168,255,.2);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.55);
  overflow: hidden;
  animation: dropIn .15s cubic-bezier(.22,1,.36,1) both;
}

/* Itens do dropdown */
.topbar-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(32,50,85,.4);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background .1s;
}
.topbar-dropdown .dropdown-item:last-child {
  border-bottom: none;
}
.topbar-dropdown .dropdown-item:hover {
  background: rgba(110,168,255,.1);
}
.topbar-dropdown .dropdown-item.active {
  color: var(--brand);
  background: rgba(110,168,255,.08);
}
.topbar-dropdown .dropdown-item svg {
  flex-shrink: 0;
  opacity: .8;
}
.topbar-dropdown .danger-item {
  color: var(--danger);
}
.topbar-dropdown .danger-item:hover {
  background: rgba(255,107,107,.1);
}

/* Remove estilos antigos que não se aplicam mais */
.topbar-actions { display: none; }
.topbar-icon-btn { display: none; }

/* Tema claro */
body.light .topbar-profile-btn {
  background: rgba(240,242,247,.8);
  border-color: rgba(200,210,230,.8);
}
body.light .topbar-profile-btn:hover,
body.light .topbar-profile-btn.open {
  background: rgba(37,99,235,.07);
  border-color: rgba(37,99,235,.3);
}
body.light .topbar-dropdown {
  background: #ffffff;
  border-color: rgba(200,210,230,.8);
  box-shadow: 0 8px 24px rgba(30,50,100,.12);
}
body.light .topbar-dropdown .dropdown-item {
  color: var(--text);
  border-color: rgba(200,210,230,.5);
}
body.light .topbar-dropdown .dropdown-item:hover {
  background: rgba(37,99,235,.06);
}
body.light .topbar-dropdown .danger-item { color: #dc2626; }
body.light .topbar-dropdown .danger-item:hover { background: rgba(220,38,38,.06); }

/* Mobile compacto */
@media (max-width: 480px) {
  .topbar-profile-btn { padding: 4px 7px 4px 4px; }
  .topbar-avatar-trigger { width: 26px !important; height: 26px !important; }
}


/* =============================================
   UI/UX REFINEMENTS v3
   — border-radius, sombras, hover states,
     gradientes, PWA banner, login footer,
     botões Excel com label, avatar genérico
   ============================================= */

/* ── 1. Variáveis de design refinadas ── */
:root {
  --radius:   14px;
  --radius-sm: 10px;
  --radius-xs:  8px;
  --transition: .18s cubic-bezier(.4,0,.2,1);
  --shadow-card: 0 2px 8px rgba(0,0,0,.28), 0 0 0 1px rgba(110,168,255,.06);
  --shadow-modal: 0 8px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(110,168,255,.08);
  --shadow-btn:   0 2px 8px rgba(0,0,0,.25);
}
body.light {
  --shadow-card:  0 2px 10px rgba(30,50,100,.09), 0 0 0 1px rgba(37,99,235,.05);
  --shadow-modal: 0 8px 40px rgba(30,50,100,.18), 0 0 0 1px rgba(37,99,235,.07);
  --shadow-btn:   0 2px 8px rgba(30,50,100,.12);
}

/* ── 2. Cards — sombra e radius consistentes ── */
.card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,.35), 0 0 0 1px rgba(110,168,255,.1);
}
body.light .card:hover {
  box-shadow: 0 4px 18px rgba(30,50,100,.13), 0 0 0 1px rgba(37,99,235,.08);
}

/* ── 3. Modais — sombra mais profunda ── */
.modal .panel {
  box-shadow: var(--shadow-modal);
}

/* ── 4. Botões — hover/focus/active uniformes com transição ── */
.btn {
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition),
    opacity var(--transition);
  border-radius: var(--radius-sm);
}
.btn:hover:not(:disabled) {
  box-shadow: var(--shadow-btn);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(0) scale(.97);
  box-shadow: none;
}
.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.btn.primary:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(110,168,255,.4);
  opacity: .93;
}
body.light .btn.primary:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(37,99,235,.3);
}

/* ── 5. Inputs — focus state mais visível ── */
.input,
select,
textarea {
  border-radius: var(--radius-sm) !important;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.input:focus,
select:focus,
textarea:focus {
  border-color: rgba(110,168,255,.7) !important;
  box-shadow: 0 0 0 3px rgba(110,168,255,.16) !important;
}
body.light .input:focus,
body.light select:focus,
body.light textarea:focus {
  border-color: rgba(37,99,235,.55) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
}

/* ── 6. Date picker trigger — mesmo estilo dos inputs ── */
.dp-trigger {
  border-radius: var(--radius-sm) !important;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.dp-trigger:focus {
  border-color: rgba(110,168,255,.7) !important;
  box-shadow: 0 0 0 3px rgba(110,168,255,.16) !important;
}

/* ── 7. Cards de consulta — hover sutil ── */
.consult-card {
  border-radius: var(--radius-sm);
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}
.consult-card:hover {
  box-shadow: 0 3px 14px rgba(0,0,0,.3);
}
body.light .consult-card:hover {
  box-shadow: 0 3px 14px rgba(30,50,100,.1);
}

/* ── 8. Patient rows — hover mais suave ── */
.patient-row {
  border-radius: var(--radius-sm);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.patient-row:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}

/* ── 9. Botões Excel — sempre mostram label (ícone + texto) ── */
.excel-label {
  display: inline !important; /* sobrescreve o display:none do breakpoint */
}
.btn-excel {
  padding: 9px 14px;
  gap: 8px;
  border-radius: var(--radius-sm);
}
/* Em telas muito pequenas (< 400px) esconde só o texto, mantém ícone */
@media (max-width: 400px) {
  .excel-label { display: none !important; }
  .btn-excel   { padding: 9px 10px; }
}

/* ── 10. Avatar genérico — ícone de pessoa em SVG ── */
/* Quando não há foto, o avatar de iniciais já existe.
   Adicionamos um fallback visual mais "avatar" com ícone de pessoa
   para o caso de iniciais vazias. */
.avatar-iniciais:empty::before,
.avatar-iniciais-lg:empty::before,
.patient-avatar:empty::before,
.search-avatar:empty::before {
  content: "👤";
  font-size: 1em;
}

/* ── 11. PWA Banner — discreto, dispensável, não reaparece ── */
.pwa-banner {
  /* Reposiciona para o topo como alternativa menos intrusiva */
  top: 0;
  bottom: auto;
  border-top: none;
  border-bottom: 1px solid rgba(110,168,255,.2);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  animation: slideDown .35s cubic-bezier(.22,1,.36,1) both;
  padding: 10px 16px;
  gap: 10px;
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
/* Botão de fechar discreto */
.pwa-banner-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
}
.pwa-banner-close:hover {
  color: var(--text);
  background: rgba(110,168,255,.1);
}
/* Ícone menor no banner do topo */
.pwa-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.pwa-banner-text strong { font-size: 13px; }
.pwa-banner-text span   { font-size: 11px; }
/* Botão de instalar no banner */
.pwa-banner-install {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
body.light .pwa-banner {
  background: rgba(255,255,255,.97);
  border-color: rgba(200,210,230,.8);
  box-shadow: 0 4px 20px rgba(30,50,100,.1);
}

/* ── 12. Login footer — integrado, menos chamativo ── */
.login-footer {
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
  opacity: .7;
  text-align: center;
  letter-spacing: .1px;
}
/* Remove o estilo de "dica" chamativa — vira texto simples */
.login-footer::before {
  content: "💡 ";
  font-size: 10px;
  opacity: .6;
}

/* ── 13. Dropdown de perfil — radius e sombra refinados ── */
.topbar-dropdown {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-modal);
}
.topbar-dropdown .dropdown-item {
  border-radius: 0;
  transition: background var(--transition);
}
.topbar-dropdown .dropdown-item:first-child {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.topbar-dropdown .dropdown-item:last-child {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* ── 14. Dropdown de ações (⋯) — mesmo refinamento ── */
.dropdown-menu {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-modal);
}
.dropdown-item {
  transition: background var(--transition);
}

/* ── 15. Badges — radius e transição ── */
.badge {
  border-radius: 999px;
  transition: opacity var(--transition), transform var(--transition);
}
.badge-btn:hover { transform: scale(1.04); }

/* ── 16. Quick cards (dashboard) — sombra e hover ── */
.quick-card {
  box-shadow: var(--shadow-card);
  transition: background var(--transition), transform var(--transition),
              border-color var(--transition), box-shadow var(--transition);
}
.quick-card:hover {
  box-shadow: 0 6px 24px rgba(110,168,255,.2), 0 0 0 1px rgba(110,168,255,.2);
}
body.light .quick-card:hover {
  box-shadow: 0 6px 24px rgba(37,99,235,.12), 0 0 0 1px rgba(37,99,235,.12);
}

/* ── 17. Slots de horário livre — hover mais claro ── */
.slot-btn {
  border-radius: var(--radius-sm);
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition), box-shadow var(--transition);
}
.slot-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(110,168,255,.25);
}

/* ── 18. Toast — radius e sombra ── */
.toast .msg {
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

/* ── 19. Chips de cancelamento — radius ── */
.cancel-chip {
  border-radius: 999px;
  transition: background var(--transition), border-color var(--transition);
}

/* ── 20. Responsividade — ajustes de grid em telas médias ── */
@media (min-width: 480px) and (max-width: 860px) {
  .col-6 { grid-column: span 6; }
  .col-4 { grid-column: span 6; }
  .col-8 { grid-column: span 12; }
}
@media (max-width: 479px) {
  .col-6,
  .col-4,
  .col-8 { grid-column: span 12; }
  .quick-access-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-card { padding: 16px 8px; }
  .quick-card-label { font-size: 15px; }
  .quick-card-icon  { font-size: 28px; }
}


/* =============================================
   SIDEBAR + LAYOUT v4
   — sidebar fixa no desktop, bottom-nav no mobile
   ============================================= */

/* ── Layout wrapper ── */
.layout-wrap {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 58px); /* desconta topbar */
}

.layout-main {
  flex: 1;
  min-width: 0;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 58px; /* altura da topbar */
  height: calc(100vh - 58px);
  overflow-y: auto;
  padding: 20px 12px;
  border-right: 1px solid rgba(32,50,85,.55);
  background: rgba(11,18,32,.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* escondida no mobile — mostrada só no desktop */
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
  border: 1px solid transparent;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-item:hover {
  background: rgba(110,168,255,.08);
  color: var(--text);
  border-color: rgba(110,168,255,.15);
}

.sidebar-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Item ativo */
.sidebar-item.active {
  background: rgba(110,168,255,.14);
  color: var(--brand);
  border-color: rgba(110,168,255,.35);
  box-shadow: 0 0 0 1px rgba(110,168,255,.1) inset;
}

/* Barra lateral esquerda no item ativo */
.sidebar-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.sidebar-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.sidebar-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Desktop: mostra sidebar, ajusta layout ── */
@media (min-width: 860px) {
  .sidebar {
    display: flex; /* mostra a sidebar */
  }

  /* Remove bottom nav no desktop */
  .bottom-nav { display: none !important; }

  /* Conteúdo não precisa de padding-bottom para bottom nav */
  .page-content {
    padding-bottom: 32px !important;
  }

  /* Container do conteúdo principal — sem max-width lateral excessivo */
  .layout-main .container {
    max-width: var(--max);
    padding: 20px 24px;
  }
}

/* ── Tablet (860–1100px): sidebar mais estreita ── */
@media (min-width: 860px) and (max-width: 1100px) {
  .sidebar {
    width: 64px; /* modo compacto — só ícones */
    padding: 20px 8px;
  }
  .sidebar-label { display: none; }
  .sidebar-item {
    justify-content: center;
    padding: 12px;
    gap: 0;
  }
  .sidebar-item.active::before {
    left: -8px;
  }
  .sidebar-icon { font-size: 20px; width: auto; }
}

/* ── Mobile: esconde sidebar, mantém bottom nav ── */
@media (max-width: 859px) {
  .sidebar { display: none !important; }
  .bottom-nav { display: flex !important; }
}

/* ── Tema claro — sidebar ── */
body.light .sidebar {
  background: rgba(255,255,255,.85);
  border-right-color: rgba(200,210,230,.7);
}
body.light .sidebar-item:hover {
  background: rgba(37,99,235,.06);
  border-color: rgba(37,99,235,.15);
  color: var(--text);
}
body.light .sidebar-item.active {
  background: rgba(37,99,235,.1);
  color: var(--brand);
  border-color: rgba(37,99,235,.3);
}
body.light .sidebar-item.active::before {
  background: var(--brand);
}

/* ── Bottom nav melhorada (mobile) ── */
.bottom-nav-item {
  min-height: 58px; /* área de toque maior */
  padding: 10px 4px 10px;
  gap: 4px;
}
.bottom-nav-icon {
  font-size: 22px; /* ícone maior */
}
.bottom-nav-label {
  font-size: 11px; /* label mais legível */
  font-weight: 700;
}
/* Indicador ativo — linha no topo */
.bottom-nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--brand);
}
.bottom-nav-item {
  position: relative; /* para o ::before funcionar */
}
/* Remove o ponto abaixo (substituído pela linha acima) */
.bottom-nav-item.active::after {
  display: none;
}

/* ── Topbar — altura consistente ── */
.topbar .row {
  min-height: 58px;
}

/* =============================================
   BOTÕES DE AÇÃO DO CARD — WhatsApp + E-mail
   ============================================= */

/* WhatsApp — verde */
.consult-action-wa {
  border-color: rgba(37,211,102,.4) !important;
  color: #25d366 !important;
  font-size: 14px !important;
}
.consult-action-wa:hover {
  background: rgba(37,211,102,.14) !important;
  border-color: rgba(37,211,102,.7) !important;
}

/* E-mail — azul discreto */
.consult-action-email {
  border-color: rgba(110,168,255,.35) !important;
  color: var(--brand) !important;
  font-size: 14px !important;
}
.consult-action-email:hover {
  background: rgba(110,168,255,.14) !important;
  border-color: rgba(110,168,255,.65) !important;
}

/* Tema claro */
body.light .consult-action-wa {
  border-color: rgba(22,163,74,.35) !important;
  color: #16a34a !important;
}
body.light .consult-action-wa:hover {
  background: rgba(22,163,74,.08) !important;
}
body.light .consult-action-email {
  border-color: rgba(37,99,235,.3) !important;
  color: var(--brand) !important;
}
body.light .consult-action-email:hover {
  background: rgba(37,99,235,.07) !important;
}

/* =============================================
   CONSULT-ACTIONS — ajuste para 6 botões
   ============================================= */

/* Botões menores quando há muitos */
.consult-actions {
  gap: 3px;
  flex-wrap: wrap;        /* quebra linha se necessário */
  justify-content: flex-end;
  max-width: 130px;       /* limita largura da coluna de ações */
}

.consult-action-btn {
  width: 28px;
  height: 28px;
  font-size: 13px;
  border-radius: 7px;
}

/* Mobile: botões ainda menores */
@media (max-width: 480px) {
  .consult-actions {
    max-width: 110px;
    gap: 2px;
  }
  .consult-action-btn {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
}

/* Desktop: pode ser um pouco maior */
@media (min-width: 860px) {
  .consult-actions {
    max-width: none;
    flex-wrap: nowrap;
    gap: 4px;
  }
  .consult-action-btn {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
}

/* =============================================
   MENU DE AÇÕES DA CONSULTA — bottom-sheet
   ============================================= */

/* Botão ⋯ no card — único, limpo */
.consult-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(110,168,255,.3);
  background: rgba(110,168,255,.08);
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
  padding-bottom: 4px; /* alinha os pontinhos verticalmente */
}
.consult-menu-btn:hover {
  background: rgba(110,168,255,.18);
  border-color: rgba(110,168,255,.6);
}
.consult-menu-btn:active {
  transform: scale(.92);
}
body.light .consult-menu-btn {
  border-color: rgba(37,99,235,.25);
  background: rgba(37,99,235,.06);
}
body.light .consult-menu-btn:hover {
  background: rgba(37,99,235,.12);
  border-color: rgba(37,99,235,.45);
}

/* Overlay */
.consult-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn .18s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Painel bottom-sheet */
.consult-menu-panel {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 20px 20px 36px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.5);
  border: 1px solid rgba(110,168,255,.12);
  border-bottom: none;
  animation: slideUpPanel .22s cubic-bezier(.22,1,.36,1) both;
}
@keyframes slideUpPanel {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
body.light .consult-menu-panel {
  background: #ffffff;
  border-color: rgba(200,210,230,.6);
  box-shadow: 0 -8px 40px rgba(30,50,100,.15);
}

/* Cabeçalho */
.consult-menu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 8px;
}
.consult-menu-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.consult-menu-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.consult-menu-close {
  background: rgba(110,168,255,.1);
  border: 1px solid rgba(110,168,255,.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  transition: background var(--transition);
}
.consult-menu-close:hover { background: rgba(110,168,255,.2); color: var(--text); }
body.light .consult-menu-close { background: rgba(37,99,235,.07); border-color: rgba(37,99,235,.15); }

/* Grade de botões — 3 por linha */
.consult-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Cada item da grade */
.consult-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 14px;
  border: 1px solid rgba(32,50,85,.5);
  background: rgba(15,27,51,.6);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.consult-menu-item:hover {
  background: rgba(110,168,255,.12);
  border-color: rgba(110,168,255,.4);
  transform: translateY(-2px);
}
.consult-menu-item:active { transform: scale(.95); }

.consult-menu-item-icon {
  font-size: 28px;
  line-height: 1;
  display: block;
}
.consult-menu-item-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* Variantes coloridas */
.consult-menu-ok {
  border-color: rgba(67,209,127,.4);
  background: rgba(67,209,127,.08);
  color: #43d17f;
}
.consult-menu-ok:hover { background: rgba(67,209,127,.18); border-color: rgba(67,209,127,.7); }

.consult-menu-warn {
  border-color: rgba(255,204,102,.4);
  background: rgba(255,204,102,.08);
  color: var(--warn);
}
.consult-menu-warn:hover { background: rgba(255,204,102,.18); border-color: rgba(255,204,102,.7); }

.consult-menu-wa {
  border-color: rgba(37,211,102,.4);
  background: rgba(37,211,102,.08);
  color: #25d366;
}
.consult-menu-wa:hover { background: rgba(37,211,102,.18); border-color: rgba(37,211,102,.7); }

.consult-menu-email {
  border-color: rgba(110,168,255,.35);
  background: rgba(110,168,255,.08);
  color: var(--brand);
}
.consult-menu-email:hover { background: rgba(110,168,255,.18); border-color: rgba(110,168,255,.65); }

.consult-menu-danger {
  border-color: rgba(255,107,107,.4);
  background: rgba(255,107,107,.08);
  color: var(--danger);
}
.consult-menu-danger:hover { background: rgba(255,107,107,.18); border-color: rgba(255,107,107,.7); }

/* Tema claro */
body.light .consult-menu-item {
  background: #f8faff;
  border-color: rgba(200,210,230,.8);
  color: var(--text);
}
body.light .consult-menu-item:hover { background: rgba(37,99,235,.06); border-color: rgba(37,99,235,.3); }
body.light .consult-menu-ok    { background: rgba(22,163,74,.07);  border-color: rgba(22,163,74,.3);  color: #15803d; }
body.light .consult-menu-warn  { background: rgba(217,119,6,.07);  border-color: rgba(217,119,6,.3);  color: #d97706; }
body.light .consult-menu-wa    { background: rgba(22,163,74,.07);  border-color: rgba(22,163,74,.3);  color: #16a34a; }
body.light .consult-menu-email { background: rgba(37,99,235,.07);  border-color: rgba(37,99,235,.25); color: var(--brand); }
body.light .consult-menu-danger{ background: rgba(220,38,38,.07);  border-color: rgba(220,38,38,.3);  color: #dc2626; }

/* Desktop — abre como modal centralizado */
@media (min-width: 600px) {
  .consult-menu-overlay { align-items: center; padding: 16px; }
  .consult-menu-panel {
    border-radius: 18px;
    border: 1px solid rgba(110,168,255,.15);
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* ── Botão ⋯ — tamanho proporcional ao card ── */
.consult-menu-btn {
  width: 40px  !important;
  height: 36px !important;
  font-size: 18px !important;
  border-radius: 10px !important;
  padding-bottom: 2px !important;
}

/* ── Modal de ações — garante z-index acima de tudo ── */
.consult-menu-overlay {
  z-index: 200 !important;
}

/* ── Painel — largura mínima garantida ── */
.consult-menu-panel {
  min-width: 300px;
  width: 100% !important;
  max-width: 520px !important;
}

/* ── Grade — mínimo 3 colunas com tamanho fixo ── */
.consult-menu-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px !important;
}

.consult-menu-item {
  padding: 18px 8px !important;
  min-height: 90px !important;
}

.consult-menu-item-icon {
  font-size: 30px !important;
}

.consult-menu-item-label {
  font-size: 12px !important;
  font-weight: 700 !important;
}

/* ── Card de consulta — coluna direita reorganizada ── */
.consult-card-right {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0;
}

/* Botão ⋯ — pequeno e discreto, ao lado do badge */
.consult-menu-btn {
  width: 32px  !important;
  height: 32px !important;
  font-size: 16px !important;
  border-radius: 8px !important;
  padding: 0 0 3px 0 !important;
  flex-shrink: 0;
  border: 1px solid rgba(110,168,255,.2) !important;
  background: rgba(110,168,255,.06) !important;
  color: var(--muted) !important;
  letter-spacing: 1px;
}
.consult-menu-btn:hover {
  background: rgba(110,168,255,.15) !important;
  border-color: rgba(110,168,255,.5) !important;
  color: var(--text) !important;
}
body.light .consult-menu-btn {
  border-color: rgba(37,99,235,.2) !important;
  background: rgba(37,99,235,.05) !important;
}
body.light .consult-menu-btn:hover {
  background: rgba(37,99,235,.1) !important;
}

/* ── Corrige card cortado — conteúdo não some ── */
.consult-card {
  overflow: visible !important; /* permite badge/menu saírem do card se necessário */
}

.consult-card-mid {
  flex: 1 1 0 !important;
  min-width: 0 !important;       /* permite truncar o texto sem empurrar os outros */
  overflow: hidden;
}

.consult-card-left {
  flex-shrink: 0 !important;
  min-width: 48px !important;
}

.consult-card-right {
  flex-shrink: 0 !important;
  min-width: 0 !important;
  max-width: 140px;
}

/* Badge não quebra linha */
.badge-btn {
  white-space: nowrap !important;
}

/* =============================================
   TEMA CLINICO PROFISSIONAL
   ============================================= */
:root {
  --status-confirmed:#22C55E;
  --status-pending:#F59E0B;
  --status-canceled:#EF4444;
  --status-info:#0EA5E9;
  --primary-contrast:#FFFFFF;
}

body {
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

body.light {
  --bg:#FFFFFF;
  --card:#FFFFFF;
  --muted:#6B7280;
  --text:#1F2937;
  --line:#D1E5F0;
  --brand:#0EA5E9;
  --brand2:#0369A1;
  --title:#0369A1;
  --surface:#F0F9FF;
  background: var(--bg);
}

body:not(.light) {
  --bg:#0F172A;
  --card:#1E293B;
  --muted:#CBD5E1;
  --text:#F8FAFC;
  --line:#334155;
  --brand:#38BDF8;
  --brand2:#7DD3FC;
  --title:#7DD3FC;
  --surface:#1E293B;
  background: var(--bg);
}

.topbar {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 70%, transparent);
}

body.light .topbar {
  background: rgba(255,255,255,.94);
  border-bottom-color: var(--line);
}

.brand h1,
.dash-saudacao,
.modal-title,
.next-nome,
.patient-nome,
.consult-nome,
.import-hint-title,
.theme-label {
  color: var(--title);
}

.brand small,
.dash-data,
.sub,
.muted,
.label,
.modal-label,
.card-label-row,
.quick-card-sub,
.consult-time-end,
.consult-tel,
.patient-tel,
.search-tel,
.login-sub,
.login-footer {
  color: var(--muted);
}

.container {
  padding-inline: 18px;
}

.card,
.quick-card,
.login-card,
.modal .panel,
.agenda-toolbar,
.slots-bar,
.patient-row,
.consult-card,
.tr,
.search-result,
.dropdown-menu,
.topbar-dropdown,
.status-quick-menu,
.pwa-banner,
.modal-patient-info,
.lembrete-dias-row,
.appt-times-field {
  background: var(--card);
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

body.light .card,
body.light .quick-card,
body.light .login-card,
body.light .modal .panel,
body.light .agenda-toolbar,
body.light .slots-bar,
body.light .patient-row,
body.light .consult-card,
body.light .tr,
body.light .search-result,
body.light .dropdown-menu,
body.light .topbar-dropdown,
body.light .status-quick-menu,
body.light .pwa-banner,
body.light .modal-patient-info,
body.light .lembrete-dias-row,
body.light .appt-times-field {
  background: var(--card);
  border-color: var(--line);
}

.card h2 {
  color: var(--title);
  font-size: 15px;
  font-weight: 700;
}

body.light .card h2 {
  color: var(--title);
}

.kpi {
  color: var(--text);
  font-weight: 800;
}

.nav a {
  background: color-mix(in srgb, var(--surface) 86%, var(--card));
  border-color: var(--line);
  color: var(--muted);
}

body.light .nav a {
  background: #FFFFFF;
  border-color: var(--line);
  color: var(--muted);
}

.btn,
.topbar-profile-btn,
.consult-action-btn,
.cancel-chip,
.pac-btn,
.dp-trigger,
.dp-month-cell,
.dp-year-cell,
.input,
select,
textarea {
  background: color-mix(in srgb, var(--surface) 86%, var(--card));
  border-color: var(--line);
  color: var(--text);
  border-radius: var(--radius2);
  box-shadow: none;
}

body.light .btn,
body.light .topbar-profile-btn,
body.light .consult-action-btn,
body.light .cancel-chip,
body.light .pac-btn,
body.light .dp-trigger,
body.light .dp-month-cell,
body.light .dp-year-cell,
body.light .input,
body.light select,
body.light textarea {
  background: #FFFFFF;
  border-color: var(--line);
  color: var(--text);
}

.btn:hover,
.nav a:hover,
.quick-card:hover,
.patient-row:hover,
.search-result:hover,
.consult-action-btn:hover,
.topbar-profile-btn:hover,
.topbar-profile-btn.open,
.dropdown-item:hover,
.topbar-dropdown .dropdown-item:hover,
.status-menu-item:hover,
.dp-cell:hover:not(.dp-disabled):not(.dp-selected),
.dp-nav:hover,
.dp-header-btn:hover {
  background: color-mix(in srgb, var(--brand) 10%, var(--card));
  border-color: color-mix(in srgb, var(--brand) 44%, var(--line));
}

.btn.primary,
.login-btn,
.fab,
.skip-link,
.dp-cell.dp-selected,
.dp-month-cell.dp-selected,
.dp-year-cell.dp-selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 24%, transparent);
}

body.light .btn.primary,
body.light .login-btn,
body.light .fab,
body.light .skip-link,
body.light .dp-cell.dp-selected,
body.light .dp-month-cell.dp-selected,
body.light .dp-year-cell.dp-selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 24%, transparent);
}

body:not(.light) .btn.primary,
body:not(.light) .login-btn,
body:not(.light) .fab,
body:not(.light) .skip-link,
body:not(.light) .dp-cell.dp-selected,
body:not(.light) .dp-month-cell.dp-selected,
body:not(.light) .dp-year-cell.dp-selected {
  color: #0F172A;
}

.btn.active,
.btn.selected,
.nav a.active,
.topbar-dropdown .dropdown-item.active,
.status-menu-primary {
  background: color-mix(in srgb, var(--brand) 13%, var(--card));
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  color: var(--brand);
}

body.light .btn.active,
body.light .btn.selected,
body.light .nav a.active,
body.light .topbar-dropdown .dropdown-item.active,
body.light .status-menu-primary {
  background: color-mix(in srgb, var(--brand) 13%, var(--card));
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  color: var(--brand);
}

.btn.danger,
.danger-item,
.topbar-dropdown .danger-item {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

.btn.whatsapp,
.pac-btn-wa-main {
  color: var(--status-confirmed) !important;
  border-color: color-mix(in srgb, var(--status-confirmed) 45%, var(--line)) !important;
  background: color-mix(in srgb, var(--status-confirmed) 10%, var(--card)) !important;
}

.login-bg,
.welcome-bg {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 72%, var(--bg)) 0%, var(--bg) 58%),
    var(--bg);
}

body.light .login-bg,
body.light .welcome-bg {
  background:
    linear-gradient(180deg, #F0F9FF 0%, #FFFFFF 58%),
    #FFFFFF;
}

.login-card {
  max-width: 430px;
  border-radius: 8px;
  backdrop-filter: none;
}

.login-title,
.welcome-nome {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--title);
}

body.light .login-title,
body.light .welcome-nome {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--title);
}

.login-logo,
.brand img {
  border-radius: 8px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 20%, transparent);
}

.avatar-iniciais,
.avatar-iniciais-lg,
.welcome-avatar-iniciais,
.patient-avatar,
.search-avatar {
  background: var(--brand);
  color: #FFFFFF;
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
}

body.light .avatar-iniciais,
body.light .avatar-iniciais-lg,
body.light .welcome-avatar-iniciais,
body.light .patient-avatar,
body.light .search-avatar {
  background: var(--brand);
  color: #FFFFFF;
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
}

body:not(.light) .avatar-iniciais,
body:not(.light) .avatar-iniciais-lg,
body:not(.light) .welcome-avatar-iniciais,
body:not(.light) .patient-avatar,
body:not(.light) .search-avatar {
  color: #0F172A;
}

.agenda-toolbar,
.slots-bar,
.modal-patient-info,
.lembrete-dias-row,
.search-selected-tag,
.import-col {
  background: color-mix(in srgb, var(--brand) 7%, var(--card));
  border-color: color-mix(in srgb, var(--brand) 20%, var(--line));
}

.consult-card {
  border-left-width: 4px;
  box-shadow: none;
}

.consult-card-agendada,
body.light .consult-card-agendada {
  border-left-color: var(--status-pending);
}

.consult-card-confirmada,
.consult-card-concluida,
body.light .consult-card-confirmada,
body.light .consult-card-concluida {
  border-left-color: var(--status-confirmed);
}

.consult-card-cancelada,
body.light .consult-card-cancelada {
  border-left-color: var(--status-canceled);
}

.consult-card-faltou,
body.light .consult-card-faltou {
  border-left-color: var(--status-pending);
}

.badge.agendada,
body.light .badge.agendada {
  background: color-mix(in srgb, var(--status-pending) 12%, var(--card));
  border-color: color-mix(in srgb, var(--status-pending) 48%, var(--line));
  color: var(--status-pending);
}

.badge.confirmada,
.badge.concluida,
body.light .badge.confirmada,
body.light .badge.concluida {
  background: color-mix(in srgb, var(--status-confirmed) 12%, var(--card));
  border-color: color-mix(in srgb, var(--status-confirmed) 48%, var(--line));
  color: var(--status-confirmed);
}

.badge.cancelada,
body.light .badge.cancelada {
  background: color-mix(in srgb, var(--status-canceled) 11%, var(--card));
  border-color: color-mix(in srgb, var(--status-canceled) 48%, var(--line));
  color: var(--status-canceled);
}

.badge.faltou,
body.light .badge.faltou {
  background: color-mix(in srgb, var(--status-pending) 12%, var(--card));
  border-color: color-mix(in srgb, var(--status-pending) 48%, var(--line));
  color: var(--status-pending);
}

.action-concluir,
body.light .action-concluir {
  border-color: color-mix(in srgb, var(--status-confirmed) 52%, var(--line)) !important;
  color: var(--status-confirmed) !important;
}

.action-faltou,
body.light .action-faltou,
.warn-btn,
body.light .warn-btn {
  border-color: color-mix(in srgb, var(--status-pending) 52%, var(--line)) !important;
  color: var(--status-pending) !important;
}

.warn-btn,
body.light .warn-btn {
  background: color-mix(in srgb, var(--status-pending) 14%, var(--card));
}

.status-menu-confirmada:hover,
.status-menu-concluida:hover,
.status-menu-concluida.status-menu-primary,
.status-menu-concluida.status-menu-primary:hover {
  background: color-mix(in srgb, var(--status-confirmed) 13%, var(--card)) !important;
}

.status-menu-cancelada,
body.light .status-menu-cancelada {
  color: var(--status-canceled);
}

.status-menu-cancelada:hover,
.danger-item:hover,
.topbar-dropdown .danger-item:hover {
  background: color-mix(in srgb, var(--status-canceled) 10%, var(--card)) !important;
}

.status-menu-faltou:hover {
  background: color-mix(in srgb, var(--status-pending) 13%, var(--card)) !important;
}

.toast-success .msg,
.import-ok,
.push-ok {
  border-color: color-mix(in srgb, var(--status-confirmed) 42%, var(--line));
  border-left-color: var(--status-confirmed) !important;
  color: var(--status-confirmed);
}

.toast-danger .msg,
.import-erro,
.push-erro {
  border-color: color-mix(in srgb, var(--status-canceled) 42%, var(--line));
  border-left-color: var(--status-canceled) !important;
  color: var(--status-canceled);
}

.toast-warn .msg,
.push-warn {
  border-color: color-mix(in srgb, var(--status-pending) 42%, var(--line));
  border-left-color: var(--status-pending) !important;
  color: var(--status-pending);
}

.toast-info .msg,
.import-loading {
  border-color: color-mix(in srgb, var(--status-info) 42%, var(--line));
  border-left-color: var(--status-info) !important;
  color: var(--brand);
}

.bottom-nav {
  background: color-mix(in srgb, var(--card) 96%, transparent);
  border-top-color: var(--line);
  box-shadow: 0 -6px 20px rgba(15,23,42,.12);
}

body.light .bottom-nav {
  background: rgba(255,255,255,.97);
  border-top-color: var(--line);
}

.bottom-nav-item.active,
.bottom-nav-back {
  color: var(--brand) !important;
}

.bottom-nav-item.active::after {
  background: var(--brand);
}

.theme-preview-dark {
  background: #0F172A;
  border-color: #334155;
}

.theme-preview-light {
  background: #FFFFFF;
  border-color: #D1E5F0;
}

.theme-preview-dark .tp-topbar,
.theme-preview-dark .tp-card {
  background: #1E293B;
}

.theme-preview-light .tp-topbar,
.theme-preview-light .tp-card {
  background: #F0F9FF;
  border-color: #D1E5F0;
}

@keyframes cardPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.018); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
  100% { transform: scale(1); box-shadow: none; }
}

/* =============================================
   PAGAMENTOS / CHECKOUT PRO
   ============================================= */
.billing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--status-pending) 45%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--status-pending) 10%, var(--card));
  color: var(--text);
  font-size: 13px;
}

.billing-banner-blocked {
  border-color: color-mix(in srgb, var(--status-canceled) 45%, var(--line));
  background: color-mix(in srgb, var(--status-canceled) 10%, var(--card));
}

.billing-banner-btn {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 720px) {
  .billing-plan-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.billing-plan {
  position: relative;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, var(--card));
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

body.light .billing-plan {
  background: #FFFFFF;
}

.billing-plan strong {
  font-size: 16px;
  color: var(--title);
}

.billing-plan span {
  font-size: 13px;
  color: var(--muted);
}

.billing-plan-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}

.billing-plan-featured {
  border-color: color-mix(in srgb, var(--status-confirmed) 45%, var(--line));
}

.billing-plan-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--status-confirmed) 16%, var(--card));
  color: var(--status-confirmed) !important;
  font-size: 10px !important;
  font-weight: 800;
}

.billing-checkout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.billing-selected-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--title);
}

.billing-checkout-btn {
  min-height: 46px;
}

.billing-status-note,
.billing-return-msg {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: var(--radius2);
  border: 1px solid color-mix(in srgb, var(--status-pending) 35%, var(--line));
  background: color-mix(in srgb, var(--status-pending) 10%, var(--card));
  color: var(--text);
  font-size: 13px;
}

.billing-return-msg {
  margin-bottom: 12px;
}

.billing-steps {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.profile-payment-card {
  border-style: dashed;
}

.push-install-prompt {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--line));
  background: var(--card);
  box-shadow: var(--shadow);
}

.push-install-copy {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.push-install-copy strong {
  color: var(--title);
  font-size: 14px;
}

.push-install-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.push-install-action {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .push-install-prompt {
    align-items: stretch;
    flex-direction: column;
  }
}
