/* Mobile first: estilos base valem para o celular; @media (min-width) amplia. */

/* ---------- tema ---------- */
:root {
  --gs-azul: #2563eb;
  --gs-azul-escuro: #1d4ed8;
  --gs-verde: #10b981;
  --gs-agua: #14b8a6;
  --gs-tinta: #0f1f38;
  --gs-texto: #34465c;
  --gs-suave: #64748b;
  --gs-linha: #e5eaf2;
  --gs-fundo: #f3f6fb;
  --gs-card: #ffffff;
  --gs-campo: #f8fafc;
  --gs-raio: 1.25rem;
  --gs-sombra: 0 1px 2px rgba(15, 31, 56, .05), 0 8px 24px rgba(15, 31, 56, .06);
  --gs-sombra-forte: 0 2px 4px rgba(15, 31, 56, .06), 0 16px 40px rgba(15, 31, 56, .12);
  --gs-gradiente: linear-gradient(135deg, #2563eb 0%, #14b8a6 100%);

  --altura-abas: 64px;
  --largura-lateral: 264px;

  --bs-primary: var(--gs-azul);
  --bs-primary-rgb: 37, 99, 235;
  --bs-success: var(--gs-verde);
  --bs-success-rgb: 16, 185, 129;
  --bs-body-color: var(--gs-texto);
  --bs-body-bg: var(--gs-fundo);
  --bs-emphasis-color: var(--gs-tinta);
  --bs-secondary-color: var(--gs-suave);
  --bs-border-color: var(--gs-linha);
  --bs-border-radius: .75rem;
  --bs-border-radius-sm: .5rem;
  --bs-border-radius-lg: 1rem;
  --bs-link-color: var(--gs-azul);
  --bs-link-color-rgb: 37, 99, 235;
  --bs-link-hover-color: var(--gs-azul-escuro);
  --bs-focus-ring-color: rgba(37, 99, 235, .25);
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; background: var(--gs-fundo) !important; color: var(--gs-texto); }
button, a, label, input, select, textarea { touch-action: manipulation; }
.min-w-0 { min-width: 0; }
h1, h2, h3, h4, h5, h6 { color: var(--gs-tinta); }

/* iOS dá zoom em campos com fonte < 16px */
input, select, textarea { font-size: max(16px, 1rem); }

.login-card { width: 100%; max-width: 400px; }

/* ---------- componentes base ---------- */
.card {
  border: 1px solid var(--gs-linha);
  border-radius: var(--gs-raio);
  box-shadow: var(--gs-sombra);
  background: var(--gs-card);
}
.card-body { padding: 1.25rem; }
.painel { background: var(--gs-card); border: 1px solid var(--gs-linha); border-radius: var(--gs-raio); box-shadow: var(--gs-sombra); }
.painel-corpo { padding: 1rem; }
.painel-titulo { font-size: 1.05rem; font-weight: 700; margin-bottom: .75rem; }
.lista-titulo { font-size: 1rem; font-weight: 700; margin: .25rem 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.contagem {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .45rem;
  border-radius: 999px; background: #e8efff; color: var(--gs-azul); font-size: .8rem; font-weight: 700;
}

.form-label { font-weight: 600; font-size: .875rem; color: var(--gs-tinta); margin-bottom: .35rem; }
.form-control, .form-select {
  background-color: var(--gs-campo); border: 1px solid var(--gs-linha); border-radius: .75rem;
  min-height: 46px; color: var(--gs-tinta);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.form-control:focus, .form-select:focus {
  background-color: #fff; border-color: #93b4f7; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
textarea.form-control { min-height: 96px; }
.form-control::placeholder { color: #9aa8ba; }
.form-text { color: var(--gs-suave); }

.btn { border-radius: .75rem; font-weight: 600; }
.btn-lg { min-height: 52px; font-size: 1rem; }
.btn-primary {
  --bs-btn-bg: var(--gs-azul); --bs-btn-border-color: var(--gs-azul);
  --bs-btn-hover-bg: var(--gs-azul-escuro); --bs-btn-hover-border-color: var(--gs-azul-escuro);
  --bs-btn-active-bg: #1e40af; --bs-btn-active-border-color: #1e40af;
  --bs-btn-disabled-bg: #9db7f5; --bs-btn-disabled-border-color: #9db7f5;
  background-image: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,0));
  box-shadow: 0 6px 16px rgba(37, 99, 235, .25);
}
.btn-primary:disabled { box-shadow: none; }
.btn-success { --bs-btn-bg: var(--gs-verde); --bs-btn-border-color: var(--gs-verde); --bs-btn-hover-bg: #059669; --bs-btn-hover-border-color: #059669; }
.btn-outline-secondary { --bs-btn-color: var(--gs-texto); --bs-btn-border-color: var(--gs-linha); --bs-btn-hover-bg: #eef2f8; --bs-btn-hover-color: var(--gs-tinta); --bs-btn-hover-border-color: var(--gs-linha); }
.btn-suave { --bs-btn-color: var(--gs-azul); --bs-btn-bg: #eaf1ff; --bs-btn-border-color: transparent; --bs-btn-hover-bg: #dbe7ff; --bs-btn-hover-color: var(--gs-azul-escuro); --bs-btn-hover-border-color: transparent; --bs-btn-active-bg: #cfdfff; }
.btn-excluir, .btn-outline-danger { --bs-btn-color: #dc2626; --bs-btn-bg: #fef2f2; --bs-btn-border-color: transparent; --bs-btn-hover-bg: #fee2e2; --bs-btn-hover-color: #b91c1c; --bs-btn-hover-border-color: transparent; --bs-btn-active-bg: #fecaca; }
.btn-fantasma { --bs-btn-color: var(--gs-suave); --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-hover-bg: #eef2f8; --bs-btn-hover-color: var(--gs-tinta); }

.alert { border: 0; border-radius: .9rem; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-info { background: #eff6ff; color: #1e40af; }
.badge { font-weight: 600; }

.selo { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #f1f5f9; color: var(--gs-suave); }
.selo-ok { background: #ecfdf5; color: #047857; }
.selo-aviso { background: #fffbeb; color: #b45309; }

.vazio {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center;
  padding: 2rem 1rem; border: 2px dashed var(--gs-linha); border-radius: var(--gs-raio);
  color: var(--gs-suave); background: rgba(255, 255, 255, .6);
}
.vazio span { font-size: 1.75rem; }

.item-lista { position: relative; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.item-lista::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--cor-item, var(--gs-azul)); }
.item-rosa { --cor-item: #ec4899; }
.item-verde { --cor-item: var(--gs-verde); }
.item-ambar { --cor-item: #f59e0b; }
@media (hover: hover) { .item-lista:hover { box-shadow: var(--gs-sombra-forte); } }
.item-lista dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600 !important; color: var(--gs-suave) !important; margin-top: .25rem; }

/* ---------- cabeçalho das seções ---------- */
.secao-topo { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; flex-wrap: wrap; }
.secao-topo > .min-w-0 { flex: 1 1 12rem; }
.secao-icone {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 8px 18px rgba(15, 31, 56, .15);
}
.secao-icone svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cor-azul { background: var(--gs-gradiente); }
.cor-rosa { background: linear-gradient(135deg, #ec4899, #f97316); }
.cor-verde { background: linear-gradient(135deg, #10b981, #14b8a6); }
.cor-ambar { background: linear-gradient(135deg, #f59e0b, #f97316); }
.cor-roxo { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.secao-titulo { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.2; }
.secao-sub { margin: .1rem 0 0; color: var(--gs-suave); font-size: .875rem; }

.segmentado { display: inline-flex; padding: 4px; border-radius: 999px; background: #e8edf5; gap: 2px; }
.segmentado button {
  border: 0; background: transparent; color: var(--gs-suave); font-weight: 600; font-size: .875rem;
  padding: .45rem 1rem; border-radius: 999px; min-height: 36px; transition: background .15s, color .15s;
}
.segmentado button.active { background: #fff; color: var(--gs-tinta); box-shadow: 0 1px 3px rgba(15, 31, 56, .12); }

/* ---------- estrutura: celular ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.lateral { display: contents; }
.lateral-marca, .paciente-card, .lateral-usuario { display: none; }

.topo-movel {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: .5rem;
  padding: calc(.6rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .6rem max(1rem, env(safe-area-inset-left));
  background: rgba(243, 246, 251, .85);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(229, 234, 242, .8);
}
.entrada-logo.logo-mini { width: 38px; height: 38px; border-radius: 12px; margin: 0; box-shadow: 0 6px 14px rgba(37, 99, 235, .25); }
.entrada-logo.logo-mini svg { width: 21px; height: 21px; }
.topo-titulo { font-weight: 800; color: var(--gs-tinta); line-height: 1.1; letter-spacing: -.01em; }
.topo-paciente { font-size: .75rem; color: var(--gs-suave); max-width: 60vw; }

.conteudo-principal {
  padding: 1rem max(1rem, env(safe-area-inset-right)) calc(var(--altura-abas) + env(safe-area-inset-bottom) + 2rem) max(1rem, env(safe-area-inset-left));
}
.carregando-inicial { display: flex; justify-content: center; padding: 4rem 0; }

.barra-carregando {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1090;
  background: linear-gradient(90deg, transparent, var(--gs-azul), var(--gs-agua), transparent);
  background-size: 50% 100%; background-repeat: no-repeat;
  animation: carregando 1s linear infinite;
  pointer-events: none;
}
@keyframes carregando { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* Barra inferior flutuante */
.abas {
  position: fixed; z-index: 1030;
  left: max(.75rem, env(safe-area-inset-left)); right: max(.75rem, env(safe-area-inset-right));
  bottom: calc(.6rem + env(safe-area-inset-bottom));
  display: flex; padding: .35rem;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid rgba(229, 234, 242, .9); border-radius: 1.4rem;
  box-shadow: 0 10px 30px rgba(15, 31, 56, .14);
}
.aba {
  flex: 1; min-width: 0; min-height: calc(var(--altura-abas) - .7rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--gs-suave); border-radius: 1.05rem;
  padding: 0 1px; font-size: .66rem; font-weight: 600; letter-spacing: -.01em;
  transition: background .15s, color .15s;
}
.aba > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aba svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.aba.active { color: var(--gs-azul); background: #eaf1ff; }
.badge-aba { position: absolute; top: -6px; right: -10px; font-size: .625rem; }

/* ---------- medicação ---------- */
.contador {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.1rem; margin-bottom: 1rem;
  border-radius: var(--gs-raio); color: #fff;
  background: var(--gs-gradiente); box-shadow: 0 12px 28px rgba(37, 99, 235, .25);
}
.contador-pct { font-size: 2.2rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.contador-pct small { font-size: 1rem; font-weight: 700; opacity: .85; margin-left: 1px; }
.contador-texto { font-weight: 600; font-size: .9rem; margin-bottom: .45rem; opacity: .95; }
.contador .progress { height: 8px; background: rgba(255, 255, 255, .28); border-radius: 999px; }
.contador .progress-bar { background: #fff; border-radius: 999px; transition: width .4s ease; }

.dia-nav { background: var(--gs-campo); border-radius: 1rem; padding: .35rem; }
.btn-nav {
  width: 44px; height: 44px; font-size: 1.5rem; line-height: 1; padding: 0; flex-shrink: 0;
  background: #fff; border: 1px solid var(--gs-linha); color: var(--gs-tinta); border-radius: .8rem;
}
.btn-nav:hover { background: #eef2f8; }
.btn-nav:disabled { opacity: .35; }
.data-dia { width: auto; margin: 0 auto; color: var(--gs-suave); font-size: 16px; min-height: 0; background: transparent !important; box-shadow: none !important; }
.selo-hoje { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: var(--gs-azul); color: #fff; font-size: .7rem; font-weight: 700; vertical-align: middle; }

.periodos { display: grid; gap: 1.25rem; }
.periodo-titulo { display: flex; align-items: center; gap: .6rem; font-size: 1rem; font-weight: 700; margin: 0 0 .6rem; }
.periodo-titulo small { display: block; font-size: .75rem; font-weight: 500; color: var(--gs-suave); }
.periodo-icone {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
  background: var(--cor-periodo-fundo, #eef2f8);
}
.periodo-manha { --cor-periodo-fundo: #fff7e6; }
.periodo-tarde { --cor-periodo-fundo: #fff1e7; }
.periodo-noite { --cor-periodo-fundo: #eef0ff; }
.periodo-domingo { --cor-periodo-fundo: #fdf2f8; }

.doses { display: grid; gap: .5rem; }
.dose-item {
  display: flex; align-items: center; gap: .9rem;
  min-height: 60px; padding: .7rem .9rem;
  background: #fff; border: 1px solid var(--gs-linha); border-radius: 1rem;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s, transform .08s;
}
.dose-item:active { transform: scale(.99); }
@media (hover: hover) { .dose-item:hover { border-color: #c7d4ea; } }
.dose-nome { font-weight: 600; color: var(--gs-tinta); }
.dose-marca { color: #047857; font-size: .78rem; }
.dose-pendente { color: #9aa8ba; font-size: .78rem; }
.dose-item.dada { background: #ecfdf5; border-color: #a7f3d0; }
.dose-item.dada .dose-nome { color: #065f46; }
.dose-item.htmx-request { opacity: .5; }

.check-dose { cursor: pointer; border: 2px solid #c3cfe0; }
.check-dose:checked { background-color: var(--gs-verde); border-color: var(--gs-verde); }
.check-dose:focus { box-shadow: 0 0 0 4px rgba(16, 185, 129, .2); border-color: var(--gs-verde); }
.dose-item .check-dose { width: 1.7rem; height: 1.7rem; border-radius: 50%; }

/* grade do mês */
.seletor-mes .form-select { font-weight: 600; }
.tabela-med { border: 1px solid var(--gs-linha); border-radius: 1rem; }
.tabela-med table { font-size: .8125rem; --bs-table-bg: #fff; border-collapse: separate; border-spacing: 0; }
.tabela-med td, .tabela-med th { border-bottom: 1px solid #eef2f7; }
.tabela-med tbody tr:last-child td, .tabela-med tbody tr:last-child th { border-bottom: 1px solid #eef2f7; }
.tabela-med thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; border-bottom: 1px solid var(--gs-linha); padding: .5rem .25rem; color: var(--gs-tinta); }
.tabela-med .col-med {
  position: sticky; left: 0; z-index: 1;
  width: 8.5rem; min-width: 8.5rem; max-width: 8.5rem;
  white-space: normal; line-height: 1.2; padding-left: .75rem;
  background: #fff;
  box-shadow: 1px 0 0 var(--gs-linha);
}
.tabela-med thead .col-med { z-index: 3; background: #f8fafc; font-weight: 700; }
.tabela-med .dia { min-width: 40px; line-height: 1.1; font-weight: 700; }
.tabela-med .semana { font-size: .68rem; font-weight: 500; color: var(--gs-suave); text-transform: uppercase; letter-spacing: .03em; }
.tabela-med th.domingo { background: #fff7e6; }
.tabela-med th.hoje { background: var(--gs-azul) !important; color: #fff; border-radius: .6rem .6rem 0 0; }
.tabela-med th.hoje .semana { color: rgba(255, 255, 255, .85); }
.tabela-med .grupo th, .tabela-med .grupo td { background: #f5f8fc; font-weight: 700; color: var(--gs-tinta); padding-top: .55rem; padding-bottom: .55rem; }
.tabela-med .celula { cursor: pointer; padding: .45rem .25rem; }
.tabela-med .celula:has(input:checked) { background: #ecfdf5; }
.tabela-med .celula .check-dose { width: 1.35em; height: 1.35em; border-radius: .4em; }
.tabela-med .nao-aplica { color: #c3cfe0; background: #fafbfd; }
.tabela-med .htmx-request { opacity: .4; }

/* ---------- relatórios ---------- */
.relatorio { max-width: 720px; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: .45rem .9rem;
  border-radius: 999px; border: 1px solid var(--gs-linha); background: #fff;
  font-weight: 600; font-size: .875rem; color: var(--gs-texto); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-check:checked + .chip { background: var(--gs-azul); border-color: var(--gs-azul); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .25); }
.btn-check:focus-visible + .chip { box-shadow: 0 0 0 4px rgba(37, 99, 235, .2); }
.datas-personalizadas { display: none; }
.personalizado .datas-personalizadas { display: flex; }
.acoes-relatorio { display: grid; gap: .6rem; }
.acoes-relatorio .btn-lg { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; }
.acoes-relatorio svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.outras-exportacoes { max-width: 720px; }
.outras-exportacoes summary { cursor: pointer; color: var(--gs-suave); font-weight: 600; font-size: .9rem; padding: .5rem 0; }
@media (min-width: 768px) { .acoes-relatorio { grid-template-columns: 1fr 1fr; } .acoes-relatorio > .d-flex { grid-column: 1 / -1; } }

/* ---------- permissões e histórico ---------- */
.dose-item.bloqueada { cursor: default; }
.dose-item.bloqueada .check-dose { opacity: .85; cursor: not-allowed; }
.dose-item.bloqueada:not(.dada) { background: #fafbfd; }
.check-dose:disabled:checked { background-color: #6ee7b7; border-color: #6ee7b7; opacity: 1; }
.tabela-med .celula:has(input:disabled) { cursor: default; }
.selo-azul { background: #eaf1ff; color: var(--gs-azul); }
.cadastro-acoes .form-select { min-height: 38px; max-width: 100%; }
.acoes { display: grid; gap: .1rem; max-height: 420px; overflow-y: auto; }
.acao { display: flex; gap: .75rem; padding: .55rem 0; border-top: 1px solid #eef2f7; font-size: .875rem; }
.acao-quando { flex-shrink: 0; width: 7.5rem; color: var(--gs-suave); font-size: .78rem; padding-top: .1rem; }

/* ---------- remédios (admin) ---------- */
.remedio {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .75rem .6rem .4rem; background: #fff;
  border: 1px solid var(--gs-linha); border-radius: 1rem;
}
.remedio-ordem .btn { width: 32px; height: 26px; padding: 0; font-size: .7rem; line-height: 1; border-radius: .5rem; }
.remedio-ordem .btn:disabled { opacity: .25; border-color: transparent; }
.lista-remedios { display: grid; gap: .5rem; }
.remedio-encerrado { background: #f8fafc; }
.remedio-encerrado .dose-nome { color: var(--gs-suave); text-decoration: line-through; text-decoration-color: #c3cfe0; }
.remedio-edicao { grid-column: 1 / -1; border-color: #93b4f7; box-shadow: 0 0 0 4px rgba(37, 99, 235, .08); }
.atalho-remedios { background: linear-gradient(135deg, #ffffff 0%, #f1f6ff 100%); }
.atalho-remedios .periodo-icone { background: #eaf1ff; width: 44px; height: 44px; font-size: 1.3rem; }

/* ---------- botões de ícone, avatar ---------- */
.btn-icone { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-icone svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #e8efff; color: var(--gs-azul); font-weight: 700; text-transform: uppercase;
}

/* ---------- anexos ---------- */
.anexo-miniatura {
  width: 72px; height: 72px; border-radius: 1rem; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ecfdf5, #e0f2fe); color: #047857; text-decoration: none;
  border: 1px solid var(--gs-linha);
}
.anexo-miniatura img { width: 100%; height: 100%; object-fit: cover; }
progress { height: 6px; accent-color: var(--gs-azul); }
input[type=file].form-control { padding: .55rem .75rem; }
input[type=file]::file-selector-button { border-radius: .5rem; border: 0; background: #e8efff; color: var(--gs-azul); font-weight: 600; margin-right: .75rem; padding: .35rem .75rem; }

/* ---------- agitação ---------- */
.texto { white-space: pre-line; overflow-wrap: anywhere; }
.btn-toque { min-height: 38px; display: inline-flex; align-items: center; }

/* ---------- avisos ---------- */
.toast-erro {
  position: fixed; z-index: 1080;
  left: .75rem; right: .75rem;
  bottom: calc(var(--altura-abas) + env(safe-area-inset-bottom) + 1.25rem);
  border-radius: 1rem;
}

/* Indicadores HTMX (spinners dentro de botões) */
.htmx-indicator:not(.barra-carregando) { display: none; }
.htmx-request .htmx-indicator:not(.barra-carregando),
.htmx-request.htmx-indicator:not(.barra-carregando) { display: inline-block; }

/* ---------- a partir de 768px ---------- */
@media (min-width: 768px) {
  .painel-corpo { padding: 1.5rem; }
  .card-body { padding: 1.5rem; }
  .secao-titulo { font-size: 1.6rem; }
  .tabela-med { max-height: 70vh; }
  .tabela-med table { font-size: .875rem; }
  .tabela-med .col-med { width: 1%; min-width: 200px; max-width: none; white-space: nowrap; }
  .tabela-med .dia { min-width: 40px; }
  .doses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exportar { max-width: 620px; }
}

/* ---------- desktop: menu lateral ---------- */
@media (min-width: 992px) {
  .app { display: grid; grid-template-columns: var(--largura-lateral) minmax(0, 1fr); }
  .topo-movel { display: none; }

  .lateral {
    display: flex; flex-direction: column; gap: 1.25rem;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 1.5rem 1rem;
    background: #fff; border-right: 1px solid var(--gs-linha);
  }
  .lateral-marca .entrada-logo.logo-mini { width: 42px; height: 42px; }
  .lateral-marca { display: flex; align-items: center; gap: .65rem; padding: 0 .5rem; font-weight: 800; font-size: 1.2rem; color: var(--gs-tinta); letter-spacing: -.02em; }
  .paciente-card {
    display: flex; align-items: center; gap: .75rem;
    padding: .9rem; border-radius: 1rem; color: #fff;
    background: var(--gs-gradiente); box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
  }
  .paciente-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .22); font-weight: 800; letter-spacing: .02em;
  }
  .paciente-rotulo { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; font-weight: 700; }
  .paciente-nome { font-weight: 700; line-height: 1.2; }
  .paciente-cpf { font-size: .75rem; opacity: .85; }

  .abas {
    position: static; flex-direction: column; gap: .25rem; padding: 0;
    background: none; border: 0; box-shadow: none; border-radius: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .aba {
    display: flex; flex: none; min-height: 46px; flex-direction: row; justify-content: flex-start; gap: .75rem;
    padding: .6rem .85rem; border-radius: .85rem; font-size: .95rem; color: var(--gs-texto);
  }
  .aba svg { width: 20px; height: 20px; }
  .aba:hover { background: #f1f5fb; color: var(--gs-tinta); }
  .aba.active { background: #eaf1ff; color: var(--gs-azul); }
  .aba.active::before { content: ""; width: 4px; height: 22px; border-radius: 4px; background: var(--gs-azul); margin-left: -.85rem; margin-right: -.35rem; }
  .badge-aba { top: -8px; right: -8px; }

  .lateral-usuario {
    display: flex; align-items: center; gap: .6rem; margin-top: auto;
    padding: .75rem; border-radius: 1rem; background: var(--gs-campo); border: 1px solid var(--gs-linha);
  }

  .conteudo-principal { padding: 2rem 2.5rem 3rem; max-width: 1280px; width: 100%; }
  .toast-erro { left: auto; right: 1.5rem; bottom: 1.5rem; max-width: 420px; }
}

@media (min-width: 1400px) {
  .doses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- login / aguardando ---------- */
.tela-entrada {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 15% 10%, rgba(13, 110, 253, .18), transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(32, 201, 151, .18), transparent 45%),
    linear-gradient(160deg, #eef4ff 0%, #f6fbf9 100%);
}
.entrada-conteudo { width: 100%; max-width: 400px; }
.entrada-marca { text-align: center; margin-bottom: 1.5rem; }
.entrada-logo {
  width: 64px; height: 64px; border-radius: 20px; margin-bottom: .75rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d6efd, #20c997);
  box-shadow: 0 10px 24px rgba(13, 110, 253, .3);
}
.entrada-logo svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.entrada-titulo { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; margin: 0; color: #12263f; }
.entrada-subtitulo { color: #5b6b80; margin: .25rem 0 0; }
.entrada-card, .tela-entrada .login-card {
  border-radius: 1.25rem;
  box-shadow: 0 1px 2px rgba(18, 38, 63, .06), 0 12px 32px rgba(18, 38, 63, .1);
}
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  min-height: 52px; font-weight: 600;
  background: #fff; color: #1f1f1f;
  border: 1px solid #dadce0; border-radius: .75rem;
  transition: background-color .15s, box-shadow .15s;
}
.btn-google:hover, .btn-google:focus-visible { background: #f8f9fa; color: #1f1f1f; border-color: #c6c9cc; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.btn-google:active { background: #eef0f2; }
.btn-google svg { width: 22px; height: 22px; flex-shrink: 0; }
.entrada-recursos { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; }
.entrada-recursos li { display: flex; align-items: center; gap: .75rem; font-size: .9375rem; color: #34465c; }
.entrada-recursos span {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f1f5fb; font-size: 1.1rem;
}
.entrada-aviso {
  margin-top: 1.5rem; padding: .75rem 1rem; border-radius: .75rem;
  background: #f1f5fb; color: #5b6b80; font-size: .8125rem; line-height: 1.4;
}
.entrada-descricao { color: #5b6b80; font-size: .9375rem; line-height: 1.5; margin: .75rem auto 0; max-width: 360px; }
.links-legais { display: flex; justify-content: center; gap: .5rem; margin-top: .5rem; font-size: .8125rem; color: #7a8899; }
.links-legais a { color: #4a6ea8; text-decoration: none; }
.links-legais a:hover { text-decoration: underline; }

/* ---------- páginas institucionais ---------- */
.pagina-legal { max-width: 760px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.pagina-legal .voltar { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 600; color: #12263f; margin-bottom: 1.5rem; }
.pagina-legal .voltar .entrada-logo { width: 36px; height: 36px; border-radius: 10px; margin: 0; box-shadow: none; }
.pagina-legal .voltar .entrada-logo svg { width: 20px; height: 20px; }
.pagina-legal article { background: #fff; border-radius: 1.25rem; padding: 2rem 1.5rem; box-shadow: 0 1px 2px rgba(18, 38, 63, .06), 0 12px 32px rgba(18, 38, 63, .08); }
.pagina-legal h1 { font-size: 1.6rem; font-weight: 700; color: #12263f; }
.pagina-legal h2 { font-size: 1.1rem; font-weight: 700; color: #12263f; margin-top: 1.75rem; }
.pagina-legal p, .pagina-legal li { color: #34465c; line-height: 1.6; }
.pagina-legal .atualizado { color: #7a8899; font-size: .875rem; }
.pagina-legal .destaque { background: #f1f5fb; border-left: 4px solid #0d6efd; padding: 1rem 1.25rem; border-radius: .5rem; }
@media (min-width: 768px) { .pagina-legal article { padding: 2.5rem 3rem; } }

.entrada-rodape { text-align: center; color: #7a8899; font-size: .8125rem; margin: 1.25rem 0 0; }

