:root {
    --bg: #faf6ee;
    --surface: #fffdf9;
    --border: #e9dfc8;
    --text: #3c3225;
    --text-muted: #8a7a5f;
    --accent: #a9824c;
    --accent-dark: #8a6a3a;
    --accent-light: #f4ead4;
    --danger: #b5432f;
    --danger-light: #f7e6e1;
    --success: #6b8f4e;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--accent-light);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.topbar .logo {
    color: var(--accent-dark);
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    background: var(--accent-light);
    padding-right: 10px;
}
.topnav {
    flex-shrink: 0;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    background: var(--accent-light);
    padding-left: 10px;
}
.topnav a {
    color: var(--accent-dark);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
}
.topnav a:hover {
    color: var(--text);
    text-decoration: underline;
}

.container {
    max-width: 900px;
    margin: 24px auto;
    padding: 0 16px;
    flex: 1 0 auto;
    width: 100%;
}

/* ---------------- Barra lateral (sidebar) ---------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}
.sidebar {
    width: 230px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    transition: width 0.18s ease;
    z-index: 2;
    overflow: hidden;
}
.sidebar-topo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--accent-dark);
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.sidebar-logo-img {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.sidebar-logo-inicial {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    flex-shrink: 0;
    background: var(--accent-light);
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}
.sidebar-busca {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-busca input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
}
.sidebar-nome-clinica {
    font-weight: 700;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-toggle {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--text-muted);
    padding: 0;
}
.sidebar-toggle:hover {
    background: var(--accent-light);
    color: var(--accent-dark);
}
.sidebar-toggle svg {
    transition: transform 0.18s ease;
}
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-muted);
}
.sidebar-nav a:hover {
    background: var(--accent-light);
}
.sidebar-nav a.ativo {
    background: var(--accent-light);
    color: var(--accent-dark);
    font-weight: 700;
}
.sidebar-nav a.ativo svg {
    color: var(--accent-dark);
}
.sidebar-nav a span {
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-nav-sair {
    margin-top: auto;
}
.sidebar-rodape {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.marca-drclin-mini {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 800;
    letter-spacing: 0.14em;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.6;
}
.marca-drclin-mini-soft {
    color: var(--accent);
}
.sidebar-usuario-logado {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    line-height: 1.3;
}
.sidebar-usuario-nome {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.sidebar-usuario-papel {
    font-size: 11px;
    color: var(--text-muted);
}
.paginacao {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.sidebar.sidebar-recolhida {
    width: 64px;
}
.sidebar.sidebar-recolhida .sidebar-nome-clinica,
.sidebar.sidebar-recolhida .sidebar-nav a span,
.sidebar.sidebar-recolhida .sidebar-rodape {
    display: none;
}
.sidebar.sidebar-recolhida .sidebar-topo {
    justify-content: center;
    padding: 18px 8px;
}
.sidebar.sidebar-recolhida .sidebar-logo {
    justify-content: center;
    flex: 0 0 auto;
}
.sidebar.sidebar-recolhida .sidebar-toggle {
    position: absolute;
    right: -13px;
    top: 18px;
    background: var(--surface);
}
.sidebar.sidebar-recolhida .sidebar-toggle svg {
    transform: rotate(180deg);
}
.sidebar.sidebar-recolhida .sidebar-nav {
    align-items: center;
}
.sidebar.sidebar-recolhida .sidebar-nav a {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
}

.app-conteudo {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text);
}

.voltar {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--accent-dark);
    text-decoration: none;
}

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.search-bar input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text);
}

.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff8ea;
}
.btn-danger {
    background: var(--surface);
    border-color: var(--danger);
    color: var(--danger);
}
.btn:disabled, button:disabled {
    opacity: 0.65;
    cursor: wait;
}
.btn-carregando {
    padding-left: 30px !important;
    position: relative;
}
.btn-carregando::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 13px;
    height: 13px;
    margin-top: -7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    opacity: 0.75;
    animation: girar-carregando 0.7s linear infinite;
}
@keyframes girar-carregando {
    to { transform: rotate(360deg); }
}

.tabela {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
}
.tabela th, .tabela td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.tabela thead th {
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: inset 0 -1px 0 var(--border);
}
.tabela tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.018);
}
body[data-tema="escuro"] .tabela tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}
.tabela tr:hover {
    background: var(--accent-light);
    cursor: pointer;
}
.tabela .acao a {
    color: var(--accent-dark);
    text-decoration: none;
}

.vazio {
    color: var(--text-muted);
    padding: 34px 24px;
    text-align: center;
    max-width: 460px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 10px;
    line-height: 1.5;
}
.vazio::before {
    content: "";
    display: block;
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    background-color: var(--text-muted);
    opacity: 0.4;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5 5 4h14l2 4.5'/%3E%3Cpath d='M3 8.5V18a1.5 1.5 0 0 0 1.5 1.5h15A1.5 1.5 0 0 0 21 18V8.5'/%3E%3Cpath d='M3 8.5h18'/%3E%3Cpath d='M9 12.5a3 3 0 0 0 6 0'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5 5 4h14l2 4.5'/%3E%3Cpath d='M3 8.5V18a1.5 1.5 0 0 0 1.5 1.5h15A1.5 1.5 0 0 0 21 18V8.5'/%3E%3Cpath d='M3 8.5h18'/%3E%3Cpath d='M9 12.5a3 3 0 0 0 6 0'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}
.vazio a { color: var(--accent-dark); }

.dica-faturas {
    background: #fff8e6;
    border: 1px solid #f0e0b0;
    color: #6b5a2a;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.92em;
    margin-bottom: 16px;
}

/* Indicador de status por cor (substitui emoji coloridos em abas e rótulos) */
.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.status-dot-vermelho { background: var(--danger); }
.status-dot-amarelo { background: #c9932e; }
.status-dot-verde { background: var(--success); }

.form-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}
.form-card label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
    color: var(--text);
}
.form-card input, .form-card textarea, .form-card select {
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
}
.form-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}
.config-secao {
    margin: 24px 0 4px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--accent-dark);
    font-size: 1.05rem;
}
.form-card h3.config-secao:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.info-card {
    background: var(--surface);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
    margin-bottom: 20px;
}
.info-card p { margin: 6px 0; }

.historico {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.atendimento-card {
    background: var(--surface);
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
    border-left: 4px solid var(--accent);
}
.atendimento-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.tag {
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}
.procedimento {
    margin: 4px 0;
    font-weight: 500;
}
.obs {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}
.btn-link-danger {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
}
.btn-link {
    background: none;
    border: none;
    color: var(--accent-dark);
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
    padding: 0;
}

/* ---------------- Flash messages ---------------- */
.flash {
    background: #eef3e6;
    border: 1px solid var(--success);
    color: #3f5c2e;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}
.flash-erro {
    background: var(--danger-light);
    border-color: var(--danger);
    color: #7a2d1e;
}

/* ---------------- Agenda: navegação de mês/dia ---------------- */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.cal-nav h1, .cal-nav h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text);
}

/* ---------------- Agenda: calendário mensal ---------------- */
.calendario {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
    table-layout: fixed;
}
.calendario th {
    background: var(--accent-light);
    padding: 10px;
    font-size: 0.85rem;
    color: var(--accent-dark);
}
.calendario td {
    border: 1px solid var(--border);
    height: 70px;
    vertical-align: top;
    padding: 0;
}
.calendario td a {
    display: block;
    height: 100%;
    width: 100%;
    padding: 8px;
    text-decoration: none;
    color: var(--text);
    position: relative;
}
.calendario td a:hover {
    background: var(--accent-light);
}
.cal-dia.fora-do-mes a {
    color: #cabb9c;
}
.cal-dia.hoje {
    background: #faf1da;
}
.cal-numero {
    font-weight: 600;
}
.cal-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--accent);
    color: #fff8ea;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 10px;
}

/* ---------------- Agenda: visão do dia (grade de horários) ---------------- */
.grade-horarios {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.btn-fora-horario {
    display: block;
    margin: 10px 0;
    font-size: 12.5px;
    font-weight: 600;
}
.grade-fora-horario {
    margin-bottom: 10px;
    padding: 8px;
    background: #f7f0de;
    border-radius: 10px;
}
.grade-fora-horario .slot-hora {
    background: #ecdfc0;
    color: var(--accent-dark);
}
.slot {
    display: flex;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.08);
    overflow: hidden;
    min-height: 46px;
}
.slot-hora {
    width: 70px;
    flex-shrink: 0;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--accent-dark);
    font-size: 0.9rem;
}
.slot-vazio {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.slot-vazio:hover {
    background: #fbf6ea;
    color: var(--accent-dark);
}
.slot.ocupado {
    border-left: 4px solid var(--accent);
}
.slot.status-realizado {
    border-left-color: var(--success);
}
.slot.status-faltou {
    border-left-color: var(--danger);
}
.slot.bloqueado {
    border-left: 4px solid var(--text-muted);
    background: #f2ede1;
}
.slot-bloqueio {
    font-weight: 600;
    color: var(--text-muted);
}
.escondido {
    display: none;
}

/* ---------------- Galeria de anexos (fotos/raio-x) ---------------- */
.galeria-anexos {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.anexo-card {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
    padding: 8px;
    width: 140px;
    text-align: center;
}
.anexo-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
.anexo-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    background: var(--accent-light);
    border-radius: 4px;
    text-decoration: none;
    color: var(--accent-dark);
    font-weight: 600;
}
.anexo-card .btn-link-danger {
    margin-top: 6px;
    display: inline-block;
}
.anexo-nome {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 6px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.anexo-data {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}
.anexos-categoria-titulo {
    margin: 20px 0 10px;
    font-size: 1rem;
    color: var(--accent-dark);
}

/* ---------------- Área de arrastar e soltar (upload de anexos) ---------------- */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background: #fbf8f2;
    transition: background 0.15s, border-color 0.15s;
}
.dropzone:hover, .dropzone.dropzone-ativa {
    background: var(--accent-light);
    border-color: var(--accent);
}
.dropzone p {
    margin: 4px 0;
    color: var(--text);
}
.dropzone-link {
    color: var(--accent-dark);
    text-decoration: underline;
    font-weight: 600;
}
.dropzone-dica {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.preview-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.preview-item {
    position: relative;
    width: 90px;
    text-align: center;
}
.preview-item img {
    width: 90px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: block;
}
.preview-pdf {
    width: 90px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: 6px;
    font-size: 1.5rem;
}
.preview-nome {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.preview-remover {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    line-height: 1;
}

/* ---------------- Logo da clínica ---------------- */
.logo-img {
    height: 28px;
    width: 28px;
    object-fit: contain;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 6px;
}
.logo-icone-svg {
    vertical-align: middle;
    margin-right: 6px;
    color: var(--accent);
}
.logo-preview-atual {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--accent-light);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
}
.logo-preview-atual img {
    height: 50px;
    width: 50px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 4px;
}
.logo-img-login {
    max-height: 70px;
    max-width: 70%;
    object-fit: contain;
    margin-bottom: 8px;
}
.logo-orcamento {
    max-height: 70px;
    max-width: 220px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* ---------------- Abas de arquivos (Raio-X / Foto / Documento) ---------------- */
.tabs-anexos {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}
.tab-btn:hover {
    color: var(--accent-dark);
}
.tab-btn.ativo {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}
.tab-contagem {
    background: var(--accent-light);
    color: var(--accent-dark);
    font-size: 0.75rem;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 4px;
}
.tab-btn.ativo .tab-contagem {
    background: var(--accent);
    color: white;
}

/* ---------------- Odontograma ---------------- */
.legenda-odontograma {
    display: flex;
    gap: 8px 18px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.bola-legenda {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.resumo-odonto {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.odonto-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.odonto-arco-wrap {
    flex: 2;
    min-width: 320px;
    background: var(--surface);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
    padding: 10px;
}
.odonto-svg {
    width: 100%;
    height: auto;
    display: block;
}
.dente-svg-g {
    cursor: pointer;
}
.dente-svg-corpo {
    transition: filter 0.1s;
}
.dente-svg-g:hover .dente-svg-corpo {
    filter: brightness(0.94);
}
.dente-svg-ausente {
    stroke-dasharray: 3 3;
    opacity: 0.6;
}

.odonto-painel {
    flex: 1;
    min-width: 260px;
    background: var(--surface);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
    padding: 18px;
}
.odonto-painel select, .odonto-painel textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    margin-top: 4px;
    margin-bottom: 6px;
}
.odonto-painel label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
    display: block;
}
.superficies-opcoes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}
.superficies-opcoes .checkbox-linha {
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text);
}
.historico-dente {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.historico-item {
    font-size: 0.85rem;
    color: var(--text-muted);
    border-left: 3px solid var(--accent-light);
    padding: 4px 10px;
}

/* ---------------- Padrões de fundo (aparência configurável) ---------------- */
body.fundo-marca-dente::after {
    content: "🦷";
    position: fixed;
    font-size: 220px;
    opacity: 0.06;
    bottom: -50px;
    right: -30px;
    z-index: 0;
    pointer-events: none;
}
.fundo-ilustracao {
    position: fixed;
    bottom: -40px;
    right: -30px;
    width: 380px;
    height: auto;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}
.topbar, .container {
    position: relative;
    z-index: 1;
}

/* ---------------- Temas prontos (configurações de aparência) ---------------- */
.temas-prontos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tema-swatch {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
}
.tema-swatch:hover {
    border-color: var(--accent);
}
.tema-swatch-cor {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.1);
}
.slot-conteudo {
    flex: 1;
    padding: 8px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.slot-paciente {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}
.slot-paciente:hover {
    text-decoration: underline;
}
.slot-status {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent-dark);
    background: var(--accent-light);
    padding: 2px 8px;
    border-radius: 10px;
}
.slot-proc, .slot-prof {
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.slot-acoes {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
    align-items: center;
    flex-wrap: wrap;
}
.btn-link-whatsapp {
    color: var(--success);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-link-whatsapp:hover {
    text-decoration: underline;
}
.sem-telefone {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

/* ---------------- Formulário de agendamento ---------------- */
.form-linha {
    display: flex;
    gap: 14px;
}
.form-linha > div {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.checkbox-linha {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-weight: normal;
    color: #7a2d1e;
}
.checkbox-linha input {
    width: auto;
}

/* ---------------- Financeiro ---------------- */
.financeiro-resumo {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.financeiro-item {
    background: var(--surface);
    border-radius: 8px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
    border-left: 3px solid var(--accent);
    flex: 1;
    min-width: 160px;
}
.financeiro-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.financeiro-valor {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-dark);
}
.cor-verde { color: var(--success); }
.cor-vermelha { color: var(--danger); }

.meta-mensal-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
    margin-bottom: 16px;
}
.meta-mensal-cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-weight: 600;
    margin-bottom: 8px;
}
.meta-mensal-barra {
    height: 10px;
    border-radius: 6px;
    background: var(--border);
    overflow: hidden;
    margin-bottom: 6px;
}
.meta-mensal-progresso {
    height: 100%;
    background: var(--accent);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.graficos-grade {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
.grafico-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.grafico-card h3 {
    margin: 0 0 14px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.grafico-largo { width: 100%; }
.grafico-caixa { position: relative; height: 260px; }
.grafico-caixa-media { height: 220px; }
@media (max-width: 640px) {
    .grafico-caixa { height: 220px; }
    .grafico-caixa-media { height: 200px; }
}

.dica {
    background: var(--accent-light);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--accent-dark);
    margin: 6px 0 10px;
}
.dica a { color: var(--accent-dark); }
.dica code {
    background: var(--surface);
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* ---------------- Tabela de itens do orçamento (formulário) ---------------- */
.tabela-itens {
    width: 100%;
    border-collapse: collapse;
}
.tabela-itens th {
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 4px 6px;
}
.tabela-itens td {
    padding: 4px 6px;
}
.tabela-itens input {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text);
}
.btn-remover-item {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
}

/* ---------------- Folha de orçamento (impressão) ---------------- */
.orcamento-folha {
    /* Documento pra impressão -- sempre com "tinta escura em papel claro",
       mesmo que a clínica tenha configurado um tema escuro no sistema. */
    --text: #3c3225;
    --text-muted: #8a7a5f;
    --border: #e9dfc8;
    color: var(--text);
    background: #fffdf8;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.10);
    max-width: 720px;
    margin: 0 auto;
}
.orcamento-cabecalho {
    text-align: center;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 16px;
    margin-bottom: 16px;
}
.orcamento-cabecalho h1 {
    margin: 0 0 6px;
    color: var(--accent-dark);
    font-size: 1.5rem;
}
.orcamento-cabecalho p {
    margin: 2px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.orcamento-titulo {
    text-align: center;
    letter-spacing: 1px;
    color: var(--text);
    font-size: 1.1rem;
    margin: 20px 0;
}
.orcamento-info {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.tabela-orcamento-print {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.tabela-orcamento-print th {
    background: var(--accent-light);
    text-align: left;
    padding: 10px;
    font-size: 0.85rem;
    color: var(--accent-dark);
}
.tabela-orcamento-print td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
}
.total-label {
    text-align: right;
    font-weight: 700;
    padding: 10px;
}
.total-valor {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--accent-dark);
    padding: 10px;
}
.total-valor-sub {
    font-weight: 600;
    padding: 6px 10px;
    color: var(--text);
}
.orcamento-obs {
    margin: 16px 0;
    font-size: 0.9rem;
    color: var(--text);
}
.orcamento-validade-nota {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 20px;
}
.orcamento-assinaturas {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-top: 60px;
}
.linha-assinatura {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text);
}
.linha-assinatura .linha {
    border-top: 1px solid var(--text);
    margin-bottom: 6px;
}

/* ===================================================================
   RESPONSIVO PARA CELULAR
   =================================================================== */

/* Barra fina no topo com o botão de menu (☰) -- só existe no celular/tablet;
   no desktop a navegação já é a barra lateral, então essa barra fica escondida. */
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }
.sidebar-fechar-mobile { display: none; }

@media (max-width: 900px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 30;
    }
    .mobile-menu-botao {
        background: none;
        border: none;
        color: var(--text);
        padding: 4px;
        cursor: pointer;
        display: flex;
        flex-shrink: 0;
    }
    .mobile-topbar-logo {
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        color: var(--text);
        font-weight: 700;
        overflow: hidden;
    }
    .mobile-topbar-logo img {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        object-fit: cover;
        flex-shrink: 0;
    }
    .mobile-topbar-inicial {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        background: var(--accent-light);
        color: var(--accent-dark);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        flex-shrink: 0;
    }
    .mobile-topbar-logo span:last-child {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* A barra lateral vira uma gaveta que desliza por cima do conteúdo, em
       vez de espremer tudo lado a lado como fazia sem essas regras. */
    .app-shell {
        display: block;
    }
    .sidebar,
    .sidebar.sidebar-recolhida {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 50;
        box-shadow: 2px 0 16px rgba(0,0,0,0.18);
    }
    .sidebar.sidebar-aberta-mobile {
        transform: translateX(0);
    }
    /* No celular a gaveta sempre abre por completo -- ignora o modo
       "recolhido pra ícones" que só existe pra economizar espaço no desktop. */
    .sidebar.sidebar-recolhida .sidebar-nome-clinica,
    .sidebar.sidebar-recolhida .sidebar-nav a span,
    .sidebar.sidebar-recolhida .sidebar-rodape {
        display: initial;
    }
    .sidebar.sidebar-recolhida .sidebar-topo {
        justify-content: space-between;
        padding: 16px 18px;
    }
    .sidebar.sidebar-recolhida .sidebar-logo {
        justify-content: flex-start;
        flex: 1 1 auto;
    }
    .sidebar.sidebar-recolhida .sidebar-nav {
        align-items: stretch;
    }
    .sidebar.sidebar-recolhida .sidebar-nav a {
        width: auto;
        height: auto;
        padding: 10px 18px;
        justify-content: flex-start;
    }
    .sidebar-toggle {
        display: none;
    }
    .sidebar-fechar-mobile {
        display: flex;
        position: absolute;
        top: 14px;
        right: 14px;
        background: none;
        border: none;
        color: var(--text-muted);
        padding: 6px;
        cursor: pointer;
    }
    .sidebar-backdrop.ativo {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 15, 5, 0.45);
        z-index: 40;
    }
    body.menu-mobile-aberto {
        overflow: hidden;
    }
    .app-conteudo {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 10px;
        margin: 14px auto;
    }


    /* Cabeçalhos de página: título em cima, botões organizados em grade abaixo */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .page-header h1 {
        font-size: 1.2rem;
    }
    .page-header > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .page-header > div .btn,
    .page-header > div a.btn,
    .page-header > div button.btn,
    .page-header > div form {
        width: 100%;
        margin: 0;
    }
    .page-header .btn {
        text-align: center;
        justify-content: center;
        font-size: 0.78rem;
        padding: 10px 6px;
        white-space: normal;
        line-height: 1.3;
    }

    /* Formulários: campos lado a lado viram empilhados */
    .form-linha {
        flex-direction: column;
        gap: 0;
    }

    /* Tabelas: rolagem horizontal em vez de espremer as colunas */
    .tabela {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Resumo financeiro e abas: melhor aproveitamento da largura */
    .financeiro-resumo {
        flex-direction: column;
    }
    .tabs-anexos {
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
    }
    .tab-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* Agenda: horário menor e ações empilhadas */
    .slot-hora {
        width: 54px;
        font-size: 0.78rem;
    }
    .slot-acoes {
        gap: 8px;
    }
    .cal-nav {
        flex-wrap: wrap;
        gap: 6px;
    }
    .cal-nav h1, .cal-nav h2 {
        width: 100%;
        order: -1;
        text-align: center;
    }
    .calendario td {
        height: 48px;
    }
    .cal-numero {
        font-size: 0.8rem;
    }

    /* Odontograma: dentes um pouco menores pra caberem na tela */
    .dente-btn {
        width: 34px;
        height: 34px;
        font-size: 0.75rem;
    }
    .odonto-layout {
        flex-direction: column;
    }
    .resumo-odonto {
        flex-direction: column;
    }

    /* Documentos (orçamento/receituário/atestado) impressos: menos respiro */
    .orcamento-folha {
        padding: 20px 16px;
    }
    .orcamento-info {
        flex-direction: column;
        gap: 8px;
    }
    .orcamento-assinaturas {
        flex-direction: column;
        gap: 30px;
        margin-top: 60px !important;
    }

    /* Login: card ocupando melhor a tela pequena */
    .login-card {
        padding: 28px 20px;
    }
}

@media print {
    .topbar, .no-imprimir, .voltar {
        display: none !important;
    }
    body {
        background: white;
    }
    .container {
        max-width: 100%;
        margin: 0;
    }
    @page {
        size: A4;
        margin: 15mm;
    }
    .orcamento-folha {
        box-shadow: none;
        padding: 10mm 5mm;
        max-width: 100%;
        min-height: 250mm;
        display: flex;
        flex-direction: column;
        font-size: 1.1rem;
    }
    .orcamento-cabecalho h1 {
        font-size: 2rem;
    }
    .orcamento-cabecalho p {
        font-size: 1rem;
    }
    .orcamento-titulo {
        font-size: 1.4rem;
        margin: 32px 0;
    }
    .orcamento-info {
        font-size: 1.05rem;
        margin-bottom: 32px;
    }
    .tabela-orcamento-print th {
        font-size: 1rem;
        padding: 14px;
    }
    .tabela-orcamento-print td {
        padding: 16px 14px;
        font-size: 1.05rem;
    }
    .total-valor {
        font-size: 1.3rem;
    }
    .orcamento-obs {
        font-size: 1rem;
        margin: 24px 0;
    }
    .orcamento-validade-nota {
        font-size: 0.9rem;
    }
    /* Empurra as assinaturas para o final da folha, preenchendo o espaço em branco */
    .orcamento-assinaturas {
        margin-top: auto;
        padding-top: 100px;
    }
}

/* ---------------- Tela de login / definir senha ---------------- */
body.pagina-entrada {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(1100px 620px at 50% -10%, var(--accent-light) 0%, var(--bg) 55%, var(--bg) 100%);
}
.marca-entrada-topo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 800;
    letter-spacing: 0.14em;
    font-size: 30px;
    margin-bottom: 6px;
}
.marca-entrada-topo .marca-drclin-ponto {
    font-size: 11px;
}
.slogan-entrada-topo {
    font-size: 12.5px;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    margin: 0 0 30px;
    text-align: center;
}
.login-tela {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
@keyframes entrada-suave {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(60,50,37,0.04), 0 20px 44px -14px rgba(60,50,37,0.16);
    padding: 40px 40px 34px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: entrada-suave 0.35s ease-out;
}
.login-card::before {
    content: "";
    position: absolute;
    top: 0; left: 20px; right: 20px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--accent), #d9b877, var(--accent));
}
.login-card h1 {
    margin: 0 0 4px;
    font-size: 22px;
    color: var(--text);
}
.logo-wrap-entrada {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(60,50,37,0.08);
    background: linear-gradient(160deg, var(--accent-light), #eee0c3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-wrap-entrada img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.logo-wrap-entrada svg {
    width: 36px;
    height: 36px;
    color: var(--accent-dark);
}
.login-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}
.login-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.login-card input {
    padding: 13px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--surface);
}
.login-card input:focus {
    outline: none;
    border-color: var(--accent);
}
.login-card .btn-primary {
    padding: 13px;
    margin-top: 6px;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
    box-shadow: 0 6px 16px -6px rgba(60,50,37,0.35);
}
.login-aviso {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 18px;
    text-align: left;
}
.rodape-micro-entrada {
    margin-top: 26px;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.55;
    letter-spacing: 0.05em;
    text-align: center;
}

/* --- Widget flutuante de suporte via WhatsApp --- */
.suporte-whatsapp-widget {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}
.suporte-botao-flutuante {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}
.suporte-botao-flutuante:hover {
    transform: scale(1.07);
}
.suporte-painel {
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.22);
    overflow: hidden;
    font-size: 0.92rem;
}
.suporte-painel.escondido {
    display: none;
}
.suporte-painel-header {
    background: #25D366;
    color: #fff;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.suporte-fechar {
    background: none;
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
}
.suporte-painel-corpo {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.suporte-painel-corpo p {
    margin: 0;
    color: #333;
    line-height: 1.4;
}
.suporte-btn-whatsapp {
    background: #25D366;
    color: #fff;
    text-decoration: none;
    text-align: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
}
.suporte-btn-whatsapp:hover {
    background: #1ebd5a;
}
@media (max-width: 600px) {
    .suporte-whatsapp-widget {
        bottom: 14px;
        right: 14px;
    }
    .suporte-painel {
        width: calc(100vw - 40px);
        max-width: 300px;
    }
}

/* --- Marca DrClin (versalete com pontos, opção 10) --- */
.marca-drclin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.24em;
    margin-top: 22px;
}
.marca-drclin-ponto {
    color: #B98D3E;
    font-size: 8px;
}
.marca-drclin-nome {
    color: #16232B;
}
.marca-drclin-soft {
    color: #B98D3E;
}
.marca-drclin-slogan {
    text-align: center;
    font-size: 12px;
    color: #8A8578;
    margin: 6px 0 0;
    letter-spacing: 0.02em;
}

.rodape-drclin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    opacity: 0.4;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.rodape-drclin .marca-drclin-ponto {
    font-size: 5px;
}

.marca-drclin-topo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    text-align: center;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2em;
    white-space: nowrap;
}
@media (max-width: 900px) {
    .marca-drclin-topo {
        display: none;
    }
}


/* ---------------------------------------------------------------------------
   Sidebar - seletor de idioma (PT / EN)
--------------------------------------------------------------------------- */
.seletor-idioma {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 6px;
}
.seletor-idioma a {
    color: var(--muted);
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
}
.seletor-idioma a.ativo {
    color: var(--accent-dark);
    background: var(--accent-light);
}
.seletor-idioma-sep {
    color: var(--border);
}
.sidebar.sidebar-recolhida .seletor-idioma {
    display: none;
}

/* ---------------------------------------------------------------------------
   Sidebar - divisor "Sistema" acima dos itens complementares
--------------------------------------------------------------------------- */
.sidebar-divisor {
    margin: 14px 12px 4px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 700;
}
.sidebar-divisor:first-child { margin-top: 4px; }
.sidebar.sidebar-recolhida .sidebar-divisor {
    display: none;
}
.sidebar-divisor-restrita {
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.85;
}
.sidebar-divisor-restrita svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Notificações - toggles e lista de envios do dia
--------------------------------------------------------------------------- */
.card-toggles {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 0;
    margin-bottom: 24px;
}
.item-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.item-toggle:last-of-type {
    border-bottom: none;
}
.item-toggle-titulo {
    font-weight: 600;
    font-size: 14.5px;
    margin: 0 0 3px;
}
.item-toggle-desc {
    font-size: 12.5px;
    color: var(--muted);
    margin: 0;
}
.item-toggle-desc select,
.item-toggle-desc input[type="number"] {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12.5px;
}
.card-toggles .form-actions {
    padding: 14px 20px 18px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-trilho {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 20px;
    transition: 0.15s;
}
.switch-trilho::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: 0.15s;
}
.switch input:checked + .switch-trilho {
    background: var(--accent);
}
.switch input:checked + .switch-trilho::after {
    left: 21px;
}
.lista-envio {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.lista-envio li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.lista-envio li:last-child {
    border-bottom: none;
}
.vazio-inline {
    font-size: 12.5px;
    color: var(--muted);
    font-style: italic;
}

/* ---------------------------------------------------------------------------
   Central de Ajuda - busca, categorias e acordeão de perguntas
--------------------------------------------------------------------------- */
.ajuda-topo {
    text-align: center;
    margin-bottom: 20px;
}
.ajuda-topo h1 {
    margin: 0 0 6px;
}
.ajuda-topo .sub {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}
.ajuda-busca {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    margin: 0 auto 24px;
    max-width: 520px;
}
.ajuda-busca input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    flex: 1;
}
.ajuda-categorias {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.ajuda-categoria {
    background: var(--accent-light);
    color: var(--accent-dark);
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
}
.ajuda-categoria.ativa {
    background: var(--accent);
    color: #fff;
}
.faq {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 0 auto 10px;
    max-width: 680px;
}
.faq-pergunta {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.faq-mais {
    color: var(--muted);
    font-size: 16px;
}
.faq-resposta {
    display: none;
    padding: 0 18px 14px;
    font-size: 13.5px;
    color: var(--muted);
}
.faq.aberta .faq-resposta {
    display: block;
}
.faq.aberta .faq-mais {
    transform: rotate(45deg);
}
.suporte-cta {
    margin: 26px auto 0;
    text-align: center;
    background: var(--accent-light);
    border-radius: 12px;
    padding: 20px;
    max-width: 680px;
}
.suporte-cta p {
    margin: 0 0 12px;
    font-size: 14px;
}

/* ---------------------------------------------------------------------------
   Minha Assinatura
--------------------------------------------------------------------------- */
.plano-card {
    background: linear-gradient(135deg, #2c2416, #3c3225);
    color: #fff;
    border-radius: 14px;
    padding: 26px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.plano-nome {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #d9b877;
    font-weight: 700;
    margin: 0 0 6px;
}
.plano-preco {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
}
.plano-preco span {
    font-size: 14px;
    font-weight: 500;
    color: #cfc9ba;
}
.plano-status {
    background: rgba(255,255,255,0.14);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Estoque
--------------------------------------------------------------------------- */
.abas-estoque {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.abas-estoque a {
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.abas-estoque a.ativa {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
/* Cada variante carrega um ícone além da cor -- assim o status nunca depende
   só de enxergar a cor certa (mesmo cuidado aplicado nos gráficos). */
.pill-baixo::before { content: "\26A0"; font-size: 10px; }
.pill-ideal::before { content: "\2713"; font-size: 10px; }
.pill-ok::before { content: "\25CB"; font-size: 9px; }
.pill-baixo {
    background: var(--danger-light);
    color: var(--danger);
}
.pill-ideal {
    background: #e9f1e2;
    color: var(--success);
}
.pill-ok {
    background: var(--accent-light);
    color: var(--accent-dark);
}
.modal-fundo {
    position: fixed;
    inset: 0;
    background: rgba(30, 24, 12, 0.35);
    z-index: 50;
    align-items: center;
    justify-content: center;
}
.modal-caixa {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal-caixa h3 {
    margin: 0 0 16px;
    font-size: 16px;
}
.modal-caixa label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 12px 0 4px;
}
.modal-caixa input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

/* ---------------------------------------------------------------------------
   Controle de Prótese (quadro kanban)
--------------------------------------------------------------------------- */
.protese-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
}
.protese-coluna {
    background: #f7f0de;
    border-radius: 10px;
    min-width: 230px;
    max-width: 230px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
}
.protese-coluna-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
}
.protese-contagem {
    background: var(--accent);
    color: #fff;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 11px;
}
.protese-cartoes {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}
.protese-cartao {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(60,50,37,0.08);
}
.protese-cartao-paciente {
    font-weight: 700;
    font-size: 13.5px;
    margin: 0 0 4px;
}
.protese-cartao-detalhe {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 2px;
}
.protese-cartao-data {
    font-size: 11.5px;
    color: var(--accent-dark);
    margin: 6px 0 0;
    font-weight: 600;
}
.protese-cartao-acoes {
    margin-top: 8px;
    font-size: 12px;
}
.protese-mover {
    margin-top: 6px;
}
.protese-mover select {
    width: 100%;
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.protese-vazio {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    padding: 14px 0;
    font-style: italic;
}
@media (max-width: 700px) {
    .protese-board {
        flex-wrap: nowrap;
    }
}

/* ---------------- Alerta de condição crítica (topo da ficha do paciente) ---------------- */
.alerta-critico {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
}

/* ---------------- Avatar do paciente (foto ou inicial) ---------------- */
.avatar-paciente {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 10px;
    flex-shrink: 0;
}
.avatar-paciente img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-paciente-inicial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 1.1rem;
}
.avatar-paciente-mini {
    width: 28px;
    height: 28px;
    margin-right: 8px;
}

/* ---------------- Linha do tempo do paciente ---------------- */
.linha-tempo {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 2px solid var(--border);
    margin-left: 6px;
}
.linha-tempo-item {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 10px 0 10px 18px;
    position: relative;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.linha-tempo-item::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--surface);
}
.linha-tempo-data {
    flex-shrink: 0;
    width: 90px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.linha-tempo-corpo {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.linha-tempo-resumo {
    color: var(--text-muted);
    font-size: 0.85rem;
}

