/* =====================================================================
   Odentia - Design System
   CSS puro, responsivo e sem dependencias externas (funciona offline).

   Organizacao:
     1. Tokens (variaveis CSS)
     2. Reset e base
     3. Layout (shell, sidebar, topbar, conteudo)
     4. Componentes (botoes, cards, tabelas, forms, modais, toasts)
     5. Modulos (agenda, odontograma, graficos, prontuario)
     6. Utilitarios
     7. Responsividade
     8. Impressao
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. TOKENS
   --------------------------------------------------------------------- */
:root {
    /* Marca Odentia - azul-marinho (confianca) + verde-agua (saude) */
    --brand-ink:  #17284f;
    --brand-ink-600: #23386a;
    --brand-ink-700: #1b2b4e;
    --brand-aqua: #2bb0a0;
    --brand-aqua-600: #229688;
    --brand-aqua-50: #eafaf8;

    /* Azul funcional (links, acoes) */
    --brand-50:  #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;
    --brand-300: #93c5fd;
    --brand-400: #60a5fa;
    --brand-500: #2f7bf6;
    --brand-600: #1d63d8;
    --brand-700: #1a4fae;
    --brand-800: #1b4588;
    --brand-900: #1c3c6e;

    /* Neutros */
    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Semanticos */
    --success:   #16a34a;
    --success-bg:#dcfce7;
    --warning:   #f59e0b;
    --warning-bg:#fef3c7;
    --danger:    #dc2626;
    --danger-bg: #fee2e2;
    --info:      #0891b2;
    --info-bg:   #cffafe;
    --purple:    #7c3aed;
    --purple-bg: #ede9fe;
    --pink:      #db2777;
    --teal:      #0d9488;

    /* Superficie */
    --bg-body:    #f1f5f9;
    --bg-surface: #ffffff;
    --bg-soft:    #f8fafc;
    --bg-hover:   #f1f5f9;
    --border:     #e2e8f0;
    --border-strong: #cbd5e1;

    /* Texto */
    --text:        #1e293b;
    --text-muted:  #64748b;
    --text-subtle: #94a3b8;
    --text-invert: #ffffff;

    /* Sidebar */
    --sidebar-w:        260px;
    --sidebar-w-sm:     72px;
    --sidebar-bg:       #0f172a;
    --sidebar-bg-hover: #1e293b;
    --sidebar-text:     #cbd5e1;
    --sidebar-active:   var(--brand-500);

    /* Topbar */
    --topbar-h: 62px;

    /* Sombras */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
    --shadow-xl: 0 24px 48px rgba(15, 23, 42, .16);

    /* Raio */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 999px;

    /* Transicao */
    --transition: 160ms cubic-bezier(.4, 0, .2, 1);
}

/* ---------------------------------------------------------------------
   2. RESET E BASE
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-body);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

/* O atributo [hidden] so vira "display:none" pela folha do navegador, e
   qualquer regra do autor vence a dela. .modal-backdrop tem display:flex,
   .field-error display:block, .modal display via flex do pai -- entao um
   <div class="modal-backdrop" hidden> continuaria visivel.
   Com !important aqui o atributo volta a mandar, e o JS pode continuar
   alternando com removeAttribute/setAttribute. */
[hidden] { display: none !important; }

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 650;
    line-height: 1.25;
    color: var(--gray-900);
    letter-spacing: -.01em;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

code, pre, .mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: .875em;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

::selection { background: var(--brand-200); color: var(--gray-900); }

/* Foco visivel para acessibilidade */
:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* Barra de rolagem */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--r-full);
    border: 2px solid var(--gray-100);
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---------------------------------------------------------------------
   3. LAYOUT
   --------------------------------------------------------------------- */

/* ---------- Shell da aplicacao ---------- */
.app-shell { display: flex; min-height: 100vh; }

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-w);
    transition: margin var(--transition);
}

.app-content {
    flex: 1;
    padding: 22px 26px 60px;
    max-width: 1680px;
    width: 100%;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width var(--transition), transform var(--transition);
    overflow: hidden;
}

.sidebar-head {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    flex-shrink: 0;
}

.sidebar-logo {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: #fff;
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 15px;
    flex-shrink: 0;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(23, 40, 79, .22);
}

/* Sidebar escura: usa a variante clara do logo (anel e olho brancos) */
.sidebar-logo-light {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.sidebar-brand {
    color: #fff;
    font-weight: 650;
    font-size: 15px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px 20px;
}

.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border: none; }

.nav-group-label {
    padding: 14px 12px 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--gray-500);
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--r-md);
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--sidebar-bg-hover);
    color: #fff;
    text-decoration: none;
}

.nav-item.active {
    background: var(--brand-500);
    color: #fff;
    box-shadow: 0 2px 10px rgba(47, 123, 246, .3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -10px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    background: #fff;
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 19px; height: 19px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.nav-badge {
    min-width: 20px;
    height: 19px;
    padding: 0 6px;
    border-radius: var(--r-full);
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.nav-badge.muted { background: rgba(255, 255, 255, .16); color: var(--gray-300); }

.nav-sub {
    display: none;
    padding: 3px 0 3px 42px;
}

.nav-item.open + .nav-sub { display: block; }

.nav-sub-item {
    display: block;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    color: var(--gray-400);
    font-size: 13px;
    white-space: nowrap;
}

.nav-sub-item:hover, .nav-sub-item.active {
    color: #fff;
    background: rgba(255, 255, 255, .06);
    text-decoration: none;
}

.nav-caret {
    width: 14px; height: 14px;
    transition: transform var(--transition);
    flex-shrink: 0;
}
.nav-item.open .nav-caret { transform: rotate(90deg); }

/* Item bloqueado por plano */
.nav-item.locked { opacity: .48; cursor: not-allowed; }
.nav-item.locked::after {
    content: 'PRO';
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .05em;
    padding: 2px 5px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .12);
    color: var(--gray-400);
}

.sidebar-foot {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    flex-shrink: 0;
}

.plan-mini {
    background: rgba(255, 255, 255, .06);
    border-radius: var(--r-md);
    padding: 11px 12px;
}

.plan-mini-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--gray-500);
    font-weight: 700;
    margin-bottom: 3px;
}

.plan-mini-name {
    color: #fff;
    font-weight: 650;
    font-size: 14px;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-mini-name .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
}

.plan-progress {
    height: 5px;
    background: rgba(255, 255, 255, .12);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-bottom: 5px;
}

.plan-progress span {
    display: block;
    height: 100%;
    border-radius: var(--r-full);
    background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
    transition: width 400ms ease;
}

.plan-progress span.warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.plan-progress span.danger { background: linear-gradient(90deg, #f87171, var(--danger)); }

.plan-mini-meta {
    font-size: 11px;
    color: var(--gray-400);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

/* Sidebar recolhida */
.sidebar.collapsed { width: var(--sidebar-w-sm); }
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-sub,
.sidebar.collapsed .plan-mini { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .nav-badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; font-size: 9px; }

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 1020;
    flex-shrink: 0;
}

.topbar-toggle {
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    display: grid; place-items: center;
    color: var(--gray-600);
    transition: background var(--transition);
    flex-shrink: 0;
}
.topbar-toggle:hover { background: var(--gray-100); color: var(--gray-900); }
.topbar-toggle .nav-icon { width: 20px; height: 20px; }

.topbar-search {
    flex: 1;
    max-width: 460px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    height: 38px;
    padding: 0 38px 0 38px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-soft);
    font-size: 14px;
    transition: all var(--transition);
}

.topbar-search input:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px var(--brand-100);
}

.topbar-search .search-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--text-subtle);
    pointer-events: none;
}

.topbar-search kbd {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    font-size: 10.5px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: #fff;
    color: var(--text-subtle);
    pointer-events: none;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.topbar-btn {
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    display: grid; place-items: center;
    color: var(--gray-600);
    position: relative;
    transition: background var(--transition);
}

.topbar-btn:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.topbar-btn .nav-icon { width: 19px; height: 19px; }

.topbar-btn .dot {
    position: absolute;
    top: 6px; right: 6px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: var(--r-full);
    background: var(--danger);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    display: grid; place-items: center;
    border: 2px solid #fff;
}

.topbar-divider {
    width: 1px;
    height: 26px;
    background: var(--border);
    margin: 0 6px;
}

/* Menu do usuario */
.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 9px 5px 5px;
    border-radius: var(--r-md);
    transition: background var(--transition);
    color: var(--text);
}

.user-chip:hover { background: var(--gray-100); text-decoration: none; }

.avatar {
    width: 32px; height: 32px;
    border-radius: var(--r-full);
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-meta { line-height: 1.2; }
.user-meta strong { display: block; font-size: 13.5px; font-weight: 600; }
.user-meta span { font-size: 11.5px; color: var(--text-muted); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 236px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 1060;
}

.dropdown.open .dropdown-menu,
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu.left { right: auto; left: 0; }
.dropdown-menu.wide { min-width: 340px; }

.dropdown-header {
    padding: 10px 12px 11px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 5px;
}

.dropdown-header strong { display: block; font-size: 14px; }
.dropdown-header span { font-size: 12px; color: var(--text-muted); }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--r-md);
    color: var(--text);
    font-size: 14px;
    text-align: left;
    transition: background var(--transition);
}

.dropdown-item:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }
.dropdown-item .nav-icon { width: 17px; height: 17px; flex-shrink: 0; }
.dropdown-sep { height: 1px; background: var(--border); margin: 5px 0; }

/* ---------------------------------------------------------------------
   4. COMPONENTES
   --------------------------------------------------------------------- */

/* ---------- Page header ---------- */
.page-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.page-head-text { flex: 1; min-width: 240px; }
.page-head h1 { font-size: 1.5rem; margin-bottom: 3px; }
.page-head p { color: var(--text-muted); font-size: 14px; }

.page-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 9px;
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb .sep { color: var(--gray-300); }

/* ---------- Botoes ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 550;
    white-space: nowrap;
    transition: all var(--transition);
    border: 1px solid transparent;
    line-height: 1;
    text-decoration: none;
}

.btn:hover { text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
.btn .nav-icon { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
    background: var(--brand-500);
    color: #fff;
    box-shadow: 0 1px 3px rgba(47, 123, 246, .35);
}
.btn-primary:hover { background: var(--brand-600); color: #fff; box-shadow: 0 3px 8px rgba(47, 123, 246, .4); }
.btn-primary:active { background: var(--brand-700); }

.btn-secondary {
    background: var(--bg-surface);
    color: var(--gray-700);
    border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-900); }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-outline-danger { background: #fff; color: var(--danger); border-color: #fca5a5; }
.btn-outline-danger:hover { background: var(--danger-bg); color: #b91c1c; border-color: var(--danger); }

.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: var(--r-sm); }
.btn-sm .nav-icon { width: 14px; height: 14px; }

.btn-lg { height: 46px; padding: 0 24px; font-size: 15.5px; }
.btn-xl { height: 52px; padding: 0 30px; font-size: 16px; border-radius: var(--r-lg); }

.btn-block { width: 100%; }

.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

.btn-group {
    display: inline-flex;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
}

.btn-group .btn {
    border-radius: 0;
    border: 0;
    border-right: 1px solid var(--border);
    box-shadow: none;
}
.btn-group .btn:last-child { border-right: 0; }
.btn-group .btn.active { background: var(--brand-500); color: #fff; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-head {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-head h2, .card-head h3 { font-size: 15px; font-weight: 620; }
.card-head p { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.card-head-actions { margin-left: auto; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px; }
.card-body.flush { padding: 0; }
.card-foot {
    padding: 13px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

/* ---------- Stat cards ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}

a.stat:hover, .stat.link:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}

.stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--r-md);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.stat-icon .nav-icon { width: 20px; height: 20px; }
.stat-icon.blue   { background: var(--brand-100);  color: var(--brand-600); }
.stat-icon.green  { background: var(--success-bg); color: var(--success); }
.stat-icon.orange { background: var(--warning-bg); color: #b45309; }
.stat-icon.red    { background: var(--danger-bg);  color: var(--danger); }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
.stat-icon.teal   { background: var(--info-bg);    color: var(--info); }

.stat-body { flex: 1; min-width: 0; }
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 550;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.15;
    letter-spacing: -.02em;
}
.stat-value.sm { font-size: 1.2rem; }
.stat-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.stat-meta.up { color: var(--success); }
.stat-meta.down { color: var(--danger); }

/* ---------- Tabelas ---------- */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr { transition: background 100ms ease; }
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr:last-child td { border-bottom: 0; }

.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table tfoot td {
    padding: 12px 14px;
    font-weight: 700;
    background: var(--bg-soft);
    border-top: 2px solid var(--border-strong);
}

.table-clickable tbody tr { cursor: pointer; }

/* Celula de pessoa */
.person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.person-info { min-width: 0; }
.person-name {
    font-weight: 570;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.person-meta {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Badges / Pills ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: 11.5px;
    font-weight: 620;
    white-space: nowrap;
    line-height: 1.5;
}

.badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.badge.no-dot::before { display: none; }

.badge-success { background: var(--success-bg); color: #15803d; }
.badge-warning { background: var(--warning-bg); color: #b45309; }
.badge-danger  { background: var(--danger-bg);  color: #b91c1c; }
.badge-info    { background: var(--info-bg);    color: #0e7490; }
.badge-purple  { background: var(--purple-bg);  color: #6d28d9; }
.badge-muted   { background: var(--gray-100);   color: var(--gray-600); }
.badge-brand   { background: var(--brand-100);  color: var(--brand-700); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--r-full);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 12.5px;
    font-weight: 550;
}

.chip-remove {
    display: grid; place-items: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--gray-300);
    color: #fff;
    font-size: 11px;
    line-height: 1;
}
.chip-remove:hover { background: var(--danger); }

/* ---------- Forms ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 15px;
}

.field { grid-column: span 12; }
.field.col-2  { grid-column: span 2; }
.field.col-3  { grid-column: span 3; }
.field.col-4  { grid-column: span 4; }
.field.col-5  { grid-column: span 5; }
.field.col-6  { grid-column: span 6; }
.field.col-8  { grid-column: span 8; }
.field.col-9  { grid-column: span 9; }

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 570;
    color: var(--gray-700);
    margin-bottom: 5px;
}

.field-label .req { color: var(--danger); margin-left: 2px; }
.field-label .hint {
    font-weight: 400;
    color: var(--text-subtle);
    font-size: 12px;
    margin-left: 5px;
}

.input, .select, .textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: var(--bg-surface);
    font-size: 14px;
    color: var(--text);
    transition: all var(--transition);
}

.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.textarea.tall { min-height: 130px; }

.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-400); }

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-100);
}

.input:disabled, .select:disabled, .textarea:disabled {
    background: var(--gray-100);
    color: var(--text-muted);
    cursor: not-allowed;
}

.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
    border-color: var(--danger);
    background: #fffbfb;
}
.input.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-bg); }

.input-group { position: relative; display: flex; }
.input-group .input { padding-left: 38px; }
.input-group-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--text-subtle);
    pointer-events: none;
}
.input-group .btn { margin-left: -1px; border-radius: 0 var(--r-md) var(--r-md) 0; }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 32px;
}

.field-help { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field-error {
    display: block;
    font-size: 12.5px;
    color: var(--danger);
    margin-top: 4px;
    font-weight: 500;
}

/* Checkbox / radio */
.check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.check input[type="checkbox"],
.check input[type="radio"] {
    width: 17px; height: 17px;
    margin: 1px 0 0;
    accent-color: var(--brand-500);
    cursor: pointer;
    flex-shrink: 0;
}

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch-track {
    width: 38px; height: 21px;
    background: var(--gray-300);
    border-radius: var(--r-full);
    position: relative;
    transition: background var(--transition);
    flex-shrink: 0;
}
.switch-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 17px; height: 17px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-track { background: var(--brand-500); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--brand-100); }

/* Masks de entrada */
.mask-cpf, .mask-cnpj, .mask-phone, .mask-cep, .mask-money, .mask-digits {
    font-variant-numeric: tabular-nums;
}

/* Fieldset */
.fieldset {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 17px;
    margin-bottom: 17px;
    background: var(--bg-surface);
}

.fieldset:last-child { margin-bottom: 0; }

.fieldset-legend {
    font-size: 13px;
    font-weight: 680;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--brand-700);
    padding: 0 8px;
    margin-left: -8px;
    display: block;
}

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 15px;
    border-radius: var(--r-md);
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.5;
}

.alert .nav-icon { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 650; display: block; margin-bottom: 2px; }

.alert-success { background: var(--success-bg); color: #14532d; border-color: #86efac; }
.alert-warning { background: var(--warning-bg); color: #78350f; border-color: #fcd34d; }
.alert-danger  { background: var(--danger-bg);  color: #7f1d1d; border-color: #fca5a5; }
.alert-info    { background: var(--info-bg);    color: #164e63; border-color: #a5f3fc; }
.alert-brand   { background: var(--brand-50);   color: var(--brand-800); border-color: var(--brand-200); }

/* ---------- Toasts ---------- */
.toast-host {
    position: fixed;
    top: 16px; right: 16px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-500);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    animation: toastIn 240ms cubic-bezier(.16, 1, .3, 1);
    pointer-events: auto;
}

.toast.success { border-left-color: var(--success); }
.toast.danger  { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }

.toast-icon { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.toast.success .toast-icon { color: var(--success); }
.toast.danger  .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    .toast-icon { color: var(--info); }

.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 620; display: block; }
.toast-close {
    color: var(--text-subtle);
    width: 18px; height: 18px;
    display: grid; place-items: center;
    border-radius: var(--r-sm);
    flex-shrink: 0;
}
.toast-close:hover { background: var(--gray-100); color: var(--gray-700); }

.toast.hiding { animation: toastOut 180ms ease forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(28px) scale(.97); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(28px) scale(.97); }
}

/* ---------- Modais ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
    z-index: 1070;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 18px;
    overflow-y: auto;
    animation: fadeIn 150ms ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--bg-surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    animation: modalIn 220ms cubic-bezier(.16, 1, .3, 1);
    margin: auto 0;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal.sm { max-width: 420px; }
.modal.lg { max-width: 800px; }
.modal.xl { max-width: 1100px; }

.modal-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.modal-head h2 { font-size: 17px; }
.modal-head p { font-size: 13.5px; color: var(--text-muted); margin-top: 2px; }

.modal-close {
    margin-left: auto;
    width: 32px; height: 32px;
    border-radius: var(--r-md);
    display: grid; place-items: center;
    color: var(--text-muted);
    flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-900); }

.modal-body { padding: 22px; max-height: 68vh; overflow-y: auto; }
.modal-foot {
    padding: 15px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 9px;
    justify-content: flex-end;
    background: var(--bg-soft);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
    flex-wrap: wrap;
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    margin-bottom: 18px;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 550;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 7px;
}

.tab:hover { color: var(--gray-900); text-decoration: none; }
.tab.active { color: var(--brand-600); border-bottom-color: var(--brand-500); }
.tab .nav-icon { width: 16px; height: 16px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 180ms ease; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- PaginaÃƒÂ§ao ---------- */
.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 13px 18px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: auto;
}

.page-link {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    font-size: 13.5px;
    color: var(--gray-700);
    background: var(--bg-surface);
    transition: all var(--transition);
}

.page-link:hover { background: var(--gray-50); border-color: var(--gray-400); text-decoration: none; }
.page-link.active { background: var(--brand-500); border-color: var(--brand-500); color: #fff; font-weight: 620; }
.page-link.disabled { opacity: .45; pointer-events: none; }
.page-link .nav-icon { width: 15px; height: 15px; }

/* ---------- Estado vazio ---------- */
.empty {
    padding: 48px 24px;
    text-align: center;
}

.empty-icon {
    width: 56px; height: 56px;
    border-radius: var(--r-xl);
    background: var(--gray-100);
    color: var(--gray-400);
    display: grid; place-items: center;
    margin: 0 auto 14px;
}
.empty-icon .nav-icon { width: 27px; height: 27px; }
.empty h3 { font-size: 15.5px; margin-bottom: 5px; }
.empty p { color: var(--text-muted); font-size: 14px; max-width: 400px; margin: 0 auto 16px; }

/* ---------- Skeleton ---------- */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: var(--r-sm);
}

@keyframes shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.skeleton-text { height: 12px; margin-bottom: 7px; }
.skeleton-circle { border-radius: 50%; }

/* ---------------------------------------------------------------------
   5. MODULOS
   --------------------------------------------------------------------- */

/* ---------- Site publico ---------- */
.public-body {
    background: #fff;
    color: var(--text);
}

.public-header {
    height: 70px;
    display: flex;
    align-items: center;
    gap: 26px;
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 26px;
}

.public-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    color: var(--gray-900);
}
.public-logo:hover { text-decoration: none; }

/* ---------------------------------------------------------------------
   MARCA ODENTIA
   Logo = svg (assets/img/logo-mark.svg) + nome em fonte geometrica.
   --------------------------------------------------------------------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -.028em;
    color: var(--brand-ink);
    text-decoration: none;
    line-height: 1;
}

.brand:hover { text-decoration: none; color: var(--brand-ink); }

.brand-mark {
    display: block;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
}

.brand-name {
    font-size: 1.28em;
    font-weight: 800;
    letter-spacing: -.035em;
    white-space: nowrap;
}

/* Variante clara (sobre fundo escuro) */
.brand-light,
.brand-light:hover { color: #fff; }

.brand-light .brand-mark {
    /* O logo original e escuro; sobre fundo escuro, inverte o anel. */
    filter: brightness(0) invert(1) hue-rotate(180deg) saturate(2.4);
}

/* Sem texto: apenas a marca */
.brand-mark-only .brand-name { display: none; }

.public-logo-mark {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    display: grid; place-items: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(47, 123, 246, .3);
}
.public-logo-mark .nav-icon { width: 19px; height: 19px; }

.public-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
}

.public-nav a {
    padding: 8px 13px;
    border-radius: var(--r-md);
    color: var(--gray-600);
    font-size: 14.5px;
    font-weight: 500;
    transition: all var(--transition);
}

.public-nav a:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.public-nav a.active { color: var(--brand-600); background: var(--brand-50); font-weight: 600; }
.public-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }

/* Hero */
.hero {
    padding: 78px 26px 62px;
    text-align: center;
    background:
        radial-gradient(1100px 480px at 50% -140px, var(--brand-50), transparent 70%),
        linear-gradient(180deg, #fff, var(--bg-soft));
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 15px;
    border-radius: var(--r-full);
    background: var(--brand-50);
    border: 1px solid var(--brand-200);
    color: var(--brand-700);
    font-size: 13px;
    font-weight: 570;
    margin-bottom: 22px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.35rem);
    line-height: 1.12;
    letter-spacing: -.035em;
    max-width: 900px;
    margin: 0 auto 18px;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(120deg, var(--brand-500), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1.075rem;
    color: var(--gray-600);
    max-width: 640px;
    margin: 0 auto 30px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    gap: 11px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 34px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 26px;
    border-top: 1px solid var(--border);
    max-width: 680px;
    margin: 0 auto;
}

.hero-stat strong {
    display: block;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -.02em;
}
.hero-stat span { font-size: 13px; color: var(--text-muted); }

/* Secoes publicas */
.section { padding: 66px 26px; }
.section.alt { background: var(--bg-soft); }
.section-narrow { max-width: 1120px; margin: 0 auto; }

.section-head { text-align: center; max-width: 700px; margin: 0 auto 42px; }
.section-head .eyebrow {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--brand-600);
    margin-bottom: 11px;
}
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); letter-spacing: -.03em; margin-bottom: 12px; }
.section-head p { color: var(--gray-600); font-size: 1.02rem; line-height: 1.65; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 20px;
}

.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 26px;
    transition: all var(--transition);
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
}

.feature-icon {
    width: 46px; height: 46px;
    border-radius: var(--r-lg);
    display: grid; place-items: center;
    margin-bottom: 15px;
    color: #fff;
}
.feature-icon .nav-icon { width: 23px; height: 23px; }
.feature-card h3 { font-size: 16.5px; margin-bottom: 9px; }
.feature-card ul { list-style: none; }
.feature-card li {
    font-size: 14px;
    color: var(--gray-600);
    padding: 4px 0 4px 22px;
    position: relative;
    line-height: 1.5;
}
.feature-card li::before {
    content: '';
    position: absolute;
    left: 4px; top: 11px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--success);
}

/* Cards de plano */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(292px, 1fr));
    gap: 22px;
    align-items: start;
}

.plan-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--r-xl);
    padding: 28px;
    position: relative;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.plan-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.plan-card.featured {
    border-color: var(--brand-500);
    box-shadow: 0 12px 40px rgba(47, 123, 246, .16);
}

.plan-badge {
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    padding: 4px 15px;
    border-radius: var(--r-full);
    background: var(--brand-500);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(47, 123, 246, .35);
    white-space: nowrap;
}

.plan-name { font-size: 1.2rem; font-weight: 680; margin-bottom: 6px; }
.plan-desc { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; min-height: 42px; line-height: 1.5; }

.plan-price { margin-bottom: 20px; }
.plan-price-value { font-size: 2.35rem; font-weight: 700; letter-spacing: -.035em; line-height: 1; color: var(--gray-900); }
.plan-price-value small { font-size: .95rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.plan-price-note { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }

.plan-features { list-style: none; margin-bottom: 22px; flex: 1; }
.plan-features li {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 5px 0;
    font-size: 13.5px;
    color: var(--gray-600);
    line-height: 1.45;
}
.plan-features .ico { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--success); }
.plan-features .ico.no { color: var(--gray-300); }
.plan-features li.off { color: var(--gray-400); text-decoration: line-through; text-decoration-color: var(--gray-300); }

.plan-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--gray-400);
    margin: 12px 0 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* Depoimentos */
.testimonial {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.testimonial p { font-size: 14.5px; color: var(--gray-700); line-height: 1.65; flex: 1; }
.testimonial-author { display: flex; align-items: center; gap: 11px; }

.stars { color: var(--warning); letter-spacing: 1px; font-size: 13px; }

/* CTA final */
.cta {
    background: linear-gradient(135deg, var(--gray-900), var(--brand-800));
    border-radius: var(--r-xl);
    padding: 48px 40px;
    text-align: center;
    color: #fff;
}
.cta h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 11px; }
.cta p { color: var(--gray-300); max-width: 580px; margin: 0 auto 26px; font-size: 1rem; line-height: 1.65; }

/* Footer */
.public-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 48px 26px 26px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 36px;
    max-width: 1120px;
    margin: 0 auto 34px;
}

.footer-col h4 {
    color: #fff;
    font-size: 13px;
    font-weight: 680;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 14px;
}
.footer-col a { color: var(--gray-400); display: block; font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-about p { font-size: 14px; line-height: 1.65; margin: 12px 0 16px; max-width: 320px; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .09);
    padding-top: 20px;
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
}

/* ---------- Auth ---------- */
.auth-body {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.auth-aside {
    background:
        radial-gradient(900px 500px at 30% 15%, rgba(47, 123, 246, .28), transparent 65%),
        linear-gradient(160deg, var(--gray-900), #0b1220);
    color: #fff;
    padding: 46px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-aside::after {
    content: '';
    position: absolute;
    width: 460px; height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 148, 136, .22), transparent 68%);
    bottom: -170px; right: -130px;
}

.auth-aside-head { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.auth-aside-head .public-logo { color: #fff; }
.auth-aside-content { position: relative; z-index: 1; }
.auth-aside-content h2 { color: #fff; font-size: 2.05rem; line-height: 1.2; margin-bottom: 15px; letter-spacing: -.03em; }
.auth-aside-content p { color: var(--gray-300); font-size: 15.5px; line-height: 1.7; max-width: 440px; }

.auth-points { list-style: none; margin-top: 26px; display: grid; gap: 11px; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; color: var(--gray-200); font-size: 14.5px; }
.auth-points .ico { width: 17px; height: 17px; color: var(--success); flex-shrink: 0; margin-top: 2px; }

.auth-aside-foot {
    position: relative;
    z-index: 1;
    font-size: 12.5px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 9px;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 26px;
    background: #fff;
    overflow-y: auto;
}

.auth-box { width: 100%; max-width: 430px; }
.auth-box.wide { max-width: 620px; }

.auth-head { margin-bottom: 26px; }
.auth-head h1 { font-size: 1.65rem; margin-bottom: 7px; letter-spacing: -.025em; }
.auth-head p { color: var(--text-muted); font-size: 14.5px; }

.auth-foot {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-foot a { font-weight: 570; }

.demo-accounts {
    background: var(--brand-50);
    border: 1px solid var(--brand-200);
    border-radius: var(--r-md);
    padding: 12px 14px;
    margin-bottom: 20px;
}
.demo-accounts h4 {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--brand-700);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.demo-account {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    font-size: 12.5px;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: opacity var(--transition);
}
.demo-account:hover { opacity: .68; }
.demo-account code {
    font-size: 11.5px;
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--brand-200);
    color: var(--brand-800);
}
.demo-account .label { font-weight: 570; color: var(--brand-800); min-width: 148px; }

/* Seletor de plano no cadastro */
.plan-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.plan-option { position: relative; }
.plan-option input { position: absolute; opacity: 0; width: 0; height: 0; }

.plan-option label {
    display: block;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--r-md);
    padding: 13px;
    cursor: pointer;
    transition: all var(--transition);
    height: 100%;
}
.plan-option label:hover { border-color: var(--brand-400); }
.plan-option input:checked + label {
    border-color: var(--brand-500);
    background: var(--brand-50);
    box-shadow: 0 0 0 3px var(--brand-100);
}
.plan-option input:focus-visible + label { box-shadow: 0 0 0 3px var(--brand-200); }

.plan-option-name { font-weight: 650; font-size: 14.5px; margin-bottom: 3px; }
.plan-option-price { font-size: 13px; color: var(--text-muted); }
.plan-option input:checked + label .plan-option-name { color: var(--brand-700); }
.plan-option-tag {
    position: absolute;
    top: -8px; right: 9px;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--r-full);
    background: var(--brand-500);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ---------- Agenda ---------- */
.agenda-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.agenda-nav { display: flex; align-items: center; gap: 5px; }
.agenda-nav-label {
    min-width: 190px;
    text-align: center;
    font-weight: 620;
    font-size: 15px;
    padding: 0 10px;
}

/* Visao dia */
.agenda-timeline {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--bg-surface);
}

.time-slot {
    display: grid;
    grid-template-columns: 74px 1fr;
    border-bottom: 1px solid var(--border);
    min-height: 58px;
}

.time-slot:last-child { border-bottom: 0; }
.time-slot-label {
    padding: 8px 10px;
    font-size: 12.5px;
    font-weight: 620;
    color: var(--text-muted);
    background: var(--bg-soft);
    border-right: 1px solid var(--border);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.time-slot-body {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.time-slot.is-now { background: var(--brand-50); }
.time-slot.is-now .time-slot-label { background: var(--brand-100); color: var(--brand-800); }

/* Card de consulta */
.appt {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--r-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-500);
    text-align: left;
    width: 100%;
    transition: all var(--transition);
}

.appt:hover { box-shadow: var(--shadow-md); transform: translateX(2px); text-decoration: none; }
.appt-time {
    font-size: 13px;
    font-weight: 680;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
    min-width: 88px;
    flex-shrink: 0;
}
.appt-body { flex: 1; min-width: 0; }
.appt-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.appt-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.appt-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gray-300); }

/* Visao semana */
.week-grid {
    display: grid;
    grid-template-columns: 68px repeat(7, minmax(120px, 1fr));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--bg-surface);
    min-width: 900px;
}

.week-head {
    padding: 9px 6px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--bg-soft);
    position: sticky;
    top: 0;
    z-index: 2;
}
.week-head:last-child { border-right: 0; }
.week-head-dow { font-size: 10.5px; text-transform: uppercase; color: var(--text-muted); font-weight: 650; letter-spacing: .05em; }
.week-head-num {
    font-size: 17px;
    font-weight: 680;
    margin-top: 1px;
    color: var(--gray-900);
    width: 32px; height: 32px;
    display: grid; place-items: center;
    margin-inline: auto;
    border-radius: 50%;
}
.week-head.today .week-head-num { background: var(--brand-500); color: #fff; }
.week-head.weekend { background: #fbfbfc; }

.week-cell {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 4px;
    min-height: 62px;
    position: relative;
}
.week-cell:last-child { border-right: 0; }
.week-cell.weekend { background: #fbfbfc; }
.week-cell.today-col { background: var(--brand-50); }
.week-time {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 5px 8px;
    text-align: right;
    font-size: 11.5px;
    color: var(--text-muted);
    background: var(--bg-soft);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.week-appt {
    font-size: 11.5px;
    padding: 5px 7px;
    border-radius: var(--r-sm);
    background: var(--brand-50);
    border-left: 2.5px solid var(--brand-500);
    margin-bottom: 3px;
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
}
.week-appt:hover { box-shadow: var(--shadow-sm); transform: scale(1.02); }
.week-appt strong { display: block; color: var(--gray-900); font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-appt span { color: var(--gray-500); font-size: 11px; }

/* Visao mes */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--bg-surface);
}

.month-dow {
    padding: 9px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 680;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}

.month-day {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    min-height: 106px;
    padding: 6px;
    position: relative;
    transition: background var(--transition);
}
.month-day:nth-child(7n) { border-right: 0; }
.month-day.outside { background: #fafbfc; }
.month-day.outside .day-num { color: var(--gray-300); }
.month-day.today { background: var(--brand-50); }
.month-day.today .day-num { background: var(--brand-500); color: #fff; }

.day-num {
    font-size: 12.5px;
    font-weight: 680;
    color: var(--gray-700);
    width: 24px; height: 24px;
    display: grid; place-items: center;
    border-radius: 50%;
    margin-bottom: 3px;
}

.day-appt {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--brand-50);
    border-left: 2px solid var(--brand-500);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    color: var(--gray-800);
}
.day-appt:hover { background: var(--brand-100); }
.day-appt.more { background: transparent; color: var(--text-muted); font-weight: 600; cursor: pointer; border: 0; padding-left: 6px; }
.day-appt.more:hover { background: var(--gray-100); }

/* ---------- Odontograma ---------- */
.chart-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px;
    overflow-x: auto;
}

.tooth-row {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 22px;
    min-width: max-content;
}

.tooth {
    width: 46px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: transform var(--transition);
    position: relative;
}

.tooth:hover { transform: translateY(-3px); }

.tooth-num {
    font-size: 10px;
    font-weight: 680;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.tooth-shape {
    width: 42px;
    height: 54px;
    border: 2px solid var(--border-strong);
    border-radius: 46% 46% 42% 42% / 56% 56% 44% 44%;
    background: #fff;
    position: relative;
    display: grid;
    place-items: center;
    transition: all var(--transition);
    overflow: hidden;
}

.tooth:hover .tooth-shape { border-color: var(--brand-400); box-shadow: var(--shadow-sm); }
.tooth.selected .tooth-shape { border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }

.tooth-shape.absent { background: var(--gray-100); border-style: dashed; color: var(--gray-400); }
.tooth-shape.absent::before { content: '\00d7'; font-size: 26px; font-weight: 300; }

.tooth-shape[data-color] { color: #fff; border-color: transparent; }

.tooth-symbol {
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.tooth-marks {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    pointer-events: none;
}

.tooth-mark {
    font-size: 8px;
    font-weight: 700;
    display: grid;
    place-items: center;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}

.tooth-label {
    font-size: 9px;
    color: var(--text-subtle);
    text-align: center;
    max-width: 46px;
    line-height: 1.2;
}

.tooth-quadrant {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 7px;
}

.tooth-midline {
    border-top: 1.5px solid var(--gray-300);
    margin: 6px 0;
}

.tooth-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-600);
    padding: 4px 9px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    cursor: pointer;
    transition: all var(--transition);
}
.legend-item:hover { border-color: var(--gray-400); }
.legend-item.active { background: var(--brand-50); border-color: var(--brand-400); color: var(--brand-800); font-weight: 570; }

.legend-swatch {
    width: 13px; height: 13px;
    border-radius: 4px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
}

.tooth-detail {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px;
    background: var(--bg-soft);
}

/* ---------- Prontuario ---------- */
.record-timeline { position: relative; padding-left: 26px; }
.record-timeline::before {
    content: '';
    position: absolute;
    left: 7px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--border);
}

.record-entry { position: relative; padding-bottom: 20px; }
.record-entry:last-child { padding-bottom: 0; }

.record-dot {
    position: absolute;
    left: -25px; top: 4px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--brand-500);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--brand-100);
}

.record-entry.superseded .record-dot { background: var(--gray-400); box-shadow: 0 0 0 2px var(--gray-200); }
.record-entry.superseded { opacity: .68; }

.record-head {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.record-date { font-weight: 620; font-size: 14px; color: var(--gray-900); }
.record-prof { font-size: 13px; color: var(--text-muted); }

.record-block { margin-top: 9px; }
.record-block-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--brand-700);
    margin-bottom: 2px;
}
.record-block-text { font-size: 14px; color: var(--gray-700); line-height: 1.6; white-space: pre-wrap; }

/* ---------- Ficha do paciente ---------- */
.patient-header {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 18px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.patient-header-main { flex: 1; min-width: 240px; }
.patient-header h1 { font-size: 1.4rem; margin-bottom: 4px; }
.patient-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.patient-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.patient-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
    gap: 11px;
    width: 100%;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border);
}

.patient-stat { text-align: center; }
.patient-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.patient-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    margin-top: 2px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px 20px;
}

.info-item { min-width: 0; }
.info-label {
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.info-value { font-size: 14.5px; color: var(--gray-900); word-break: break-word; }

/* ---------- Financeiro ---------- */
.money { font-variant-numeric: tabular-nums; font-weight: 570; }
.money.pos { color: var(--success); }
.money.neg { color: var(--danger); }
.money-lg { font-size: 1.35rem; font-weight: 700; }

.fin-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.fin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px;
    border-left: 3px solid var(--brand-500);
}
.fin-card.green  { border-left-color: var(--success); }
.fin-card.red    { border-left-color: var(--danger); }
.fin-card.orange { border-left-color: var(--warning); }
.fin-card.purple { border-left-color: var(--purple); }
.fin-label {
    font-size: 11.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 620;
    margin-bottom: 4px;
}
.fin-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; color: var(--gray-900); }
.fin-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ---------- Graficos ---------- */
.chart-box { position: relative; width: 100%; }
.chart-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.legend-entry { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--gray-600); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ---------- Itens dinamicos (orcamento, receita) ---------- */
.item-rows { display: flex; flex-direction: column; gap: 9px; }

.item-row {
    display: grid;
    grid-template-columns: 1fr 92px 84px 96px 92px 36px;
    gap: 8px;
    align-items: center;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-soft);
}

.item-row-head {
    background: transparent;
    border: 0;
    padding: 0 9px 4px;
    font-size: 11px;
    font-weight: 680;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.item-total { font-weight: 680; text-align: right; font-variant-numeric: tabular-nums; color: var(--gray-900); }
.item-remove { color: var(--text-subtle); width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); }
.item-remove:hover { background: var(--danger-bg); color: var(--danger); }

/* Bloco de item da receita: o form-grid ocupa a largura cheia. */
.item-block {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--bg-soft);
}
.item-block + .item-block { margin-top: 12px; }

/* ---------- Filtros ---------- */
.filters {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 16px;
}

.filter-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-item label { font-size: 11.5px; font-weight: 620; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.filter-item .input, .filter-item .select { min-height: 34px; font-size: 13.5px; padding: 6px 10px; }
.filter-item.wide { flex: 1; min-width: 200px; }
.filter-item .select { padding-right: 30px; }
.filter-actions { display: flex; gap: 7px; margin-left: auto; }

/* ---------- Notificacoes ---------- */
.notif-list { max-height: 420px; overflow-y: auto; }
.notif {
    display: flex;
    gap: 11px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    color: var(--text);
}
.notif:hover { background: var(--gray-50); text-decoration: none; }
.notif.unread { background: var(--brand-50); }
.notif-icon {
    width: 32px; height: 32px;
    border-radius: var(--r-md);
    display: grid; place-items: center;
    flex-shrink: 0;
    background: var(--gray-100);
    color: var(--gray-600);
}
.notif-icon .nav-icon { width: 16px; height: 16px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13.5px; font-weight: 600; color: var(--gray-900); margin-bottom: 1px; }
.notif-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.notif-time { font-size: 11px; color: var(--text-subtle); margin-top: 3px; }

/* ---------- Progresso ---------- */
.progress {
    height: 7px;
    background: var(--gray-200);
    border-radius: var(--r-full);
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    background: var(--brand-500);
    border-radius: var(--r-full);
    transition: width 500ms ease;
}
.progress.success span { background: var(--success); }
.progress.warning span { background: var(--warning); }
.progress.danger span  { background: var(--danger); }
.progress.thick { height: 10px; }

/* ---------- Utilitarios ---------- */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center{ align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 22px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 11.5px; }
.text-lg      { font-size: 1.1rem; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: #b45309; }
.text-brand   { color: var(--brand-600); }
.text-purple  { color: var(--purple); }
.text-bold    { font-weight: 700; }
.text-semi    { font-weight: 600; }
.text-upper   { text-transform: uppercase; letter-spacing: .05em; }
.text-nowrap  { white-space: nowrap; }

.mt-0 { margin-top: 0; } .mt-1 { margin-top: 5px; } .mt-2 { margin-top: 10px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 22px; } .mt-5 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 5px; } .mb-2 { margin-bottom: 10px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 22px; } .mb-5 { margin-bottom: 30px; }

.p-0 { padding: 0; } .p-2 { padding: 10px; } .p-3 { padding: 16px; } .p-4 { padding: 22px; }
.hidden { display: none !important; }
.m-0 { margin: 0 !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.grid-sidebar { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }

/* Permite que itens de grid encolham abaixo da largura do conteudo.
   Sem isso, uma tabela larga dentro do grid forca a coluna a crescer
   (min-width: auto) e estoura a pagina no celular. */
.grid-2 > *, .grid-3 > *, .grid-4 > *,
.grid-auto > *, .grid-sidebar > * { min-width: 0; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------------------------------------------------------------------
   7. RESPONSIVIDADE
   --------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 1200px) {
    .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 1024px) {
    .app-content { padding: 18px 18px 50px; }
    .topbar { padding: 0 18px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }

    /* Sidebar vira overlay */
    .app-main { margin-left: 0; }
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-xl); }
    .sidebar.open { transform: translateX(0); }
    .sidebar.collapsed { width: var(--sidebar-w); }
    .sidebar.collapsed .sidebar-brand,
    .sidebar.collapsed .nav-label,
    .sidebar.collapsed .nav-group-label,
    .sidebar.collapsed .nav-sub,
    .sidebar.collapsed .plan-mini { display: block; }
    .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 9px 12px; }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .5);
        z-index: 1035;
        animation: fadeIn 150ms ease;
    }

    .item-row { grid-template-columns: 1fr 76px 72px 84px 80px 32px; }
}

/* Mobile */
@media (max-width: 768px) {
    body { font-size: 14.5px; }
    .app-content { padding: 14px 13px 44px; }
    .topbar { padding: 0 13px; gap: 8px; }
    .topbar-search { display: none; }
    .topbar-search.mobile-open {
        display: block;
        position: absolute;
        top: 100%; left: 0; right: 0;
        max-width: none;
        padding: 10px 13px;
        background: #fff;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        z-index: 1021;
    }
    .topbar-search.mobile-open kbd { display: none; }

    h1 { font-size: 1.4rem; }
    .page-head { flex-direction: column; gap: 12px; }
    .page-head-actions { width: 100%; }
    .page-head-actions .btn { flex: 1; }

    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat { padding: 13px; gap: 10px; flex-direction: column; }
    .stat-icon { width: 34px; height: 34px; }
    .stat-value { font-size: 1.22rem; }
    .fin-summary { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .fin-value { font-size: 1.15rem; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }

    .field.col-2, .field.col-3, .field.col-4,
    .field.col-5, .field.col-6, .field.col-8, .field.col-9 { grid-column: span 12; }

    .table th, .table td { padding: 9px 10px; }
    .table { font-size: 13.5px; }
    .hide-mobile { display: none !important; }

    .filters { padding: 11px; gap: 8px; }
    .filter-item, .filter-item.wide { flex: 1; min-width: calc(50% - 5px); }
    .filter-actions { width: 100%; margin-left: 0; }
    .filter-actions .btn { flex: 1; }

    .item-row {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        padding: 11px;
    }
    .item-row > *:first-child { grid-column: span 2; }
    .item-row .item-total { grid-column: span 2; text-align: left; }

    .modal-backdrop { padding: 0; align-items: flex-end; }
    .modal { max-width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 94vh; display: flex; flex-direction: column; }
    .modal-body { max-height: none; flex: 1; }
    .modal-foot { border-radius: 0; }
    .modal-foot .btn { flex: 1; }

    .toast-host { left: 13px; right: 13px; max-width: none; top: 13px; }

    .time-slot { grid-template-columns: 56px 1fr; }
    .time-slot-label { font-size: 11px; padding: 7px 6px; }

    .week-grid, .month-grid { min-width: 720px; }
    .chart-container { padding: 14px; }
    .tooth { width: 38px; }
    .tooth-shape { width: 35px; height: 45px; }

    /* Auth */
    .auth-body { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { padding: 26px 18px; min-height: 100vh; }

    /* Publico */
    .public-header { height: 62px; padding: 0 15px; gap: 10px; }
    .public-nav { display: none; position: fixed; inset: 62px 0 auto; background: #fff; border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 10px 15px; box-shadow: var(--shadow-lg); z-index: 1029; }
    .public-nav.open { display: flex; }
    .public-nav-actions .btn-ghost { display: none; }
    .public-nav-toggle { display: grid !important; }

    .hero { padding: 46px 17px 42px; }
    .hero p { font-size: 1rem; }
    .hero-stats { gap: 22px; }
    .hero-stat strong { font-size: 1.35rem; }
    .section { padding: 44px 17px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
    .footer-about { grid-column: span 2; }
    .cta { padding: 34px 22px; }
    .demo-account { flex-wrap: wrap; }
    .demo-account .label { min-width: 100%; }
}

@media (max-width: 520px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-label { font-size: 10.5px; }
    .pagination-info { width: 100%; margin-bottom: 6px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-about { grid-column: span 1; }
    .user-meta { display: none; }
    .user-chip { padding: 4px; }
    .topbar-divider { display: none; }
}

/* Barra de rolagem de tabela no mobile */
@media (max-width: 768px) {
    .table thead th:nth-child(n+5), .table tbody td:nth-child(n+5) { display: none; }
    .table.keep-all thead th, .table.keep-all tbody td { display: table-cell; }
}

/* ---------------------------------------------------------------------
   8. IMPRESSAO
   --------------------------------------------------------------------- */
@media print {
    .sidebar, .topbar, .toast-host, .no-print,
    .page-head-actions, .filters, .pagination,
    .btn, .tabs { display: none !important; }

    .app-main { margin-left: 0 !important; }
    .app-content { padding: 0 !important; }
    body { background: #fff !important; font-size: 11pt; }

    .card, .stat, .table {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }

    .table th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: #000 !important; text-decoration: none !important; }
    h1, h2, h3 { break-after: avoid; }
}

/* ---------------------------------------------------------------------
   PREFERENCIAS DO USUARIO
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: more) {
    :root { --border: #94a3b8; --text-muted: #475569; }
}

/* =====================================================================
   AGENDA - VISAO DE DIA (timeline de consultas)
   ===================================================================== */

.agenda-item {
    display: grid;
    grid-template-columns: 74px 4px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .12s ease;
}

.agenda-item:last-child { border-bottom: 0; }
.agenda-item:hover { background: var(--bg-hover); }

.agenda-item-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.agenda-item-time strong { font-size: 14px; color: var(--gray-900); }

.agenda-item-bar {
    align-self: stretch;
    min-height: 34px;
    border-radius: 99px;
}

.agenda-item-body { min-width: 0; }
.agenda-item-body strong { font-size: 14.5px; }

.agenda-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.agenda-item-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.agenda-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .agenda-item { grid-template-columns: 58px 4px 1fr; gap: 9px; }
    .agenda-item-side {
        grid-column: 3 / -1;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding-left: 2px;
    }
}

/* =====================================================================
   AGENDA - VISAO DE SEMANA (grade)
   ===================================================================== */

.week-grid {
    display: grid;
    grid-template-columns: 58px repeat(7, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--bg-surface);
}

.week-head {
    display: contents;
}

.week-head > div {
    padding: 8px 6px;
    text-align: center;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.week-head > div:last-child { border-right: 0; }

.week-head-num {
    display: block;
    font-size: 16px;
    font-weight: 750;
    color: var(--gray-900);
    letter-spacing: -.02em;
    text-transform: none;
}

.week-cell {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    min-height: 42px;
    padding: 3px;
    vertical-align: top;
}

.week-cell:last-child { border-right: 0; }
.week-head > .week-cell { min-height: 0; padding: 0; }

.week-col.today-col { background: var(--brand-aqua-50, #eafaf8); }
.week-col.weekend { background: var(--gray-50); }

.week-time {
    padding: 6px 8px;
    font-size: 11.5px;
    font-weight: 620;
    color: var(--text-muted);
    text-align: right;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    background: var(--bg-soft);
}

.week-appt {
    display: block;
    padding: 5px 7px;
    margin-bottom: 3px;
    border-radius: 7px;
    font-size: 11.5px;
    line-height: 1.35;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
}

.week-appt:hover { filter: brightness(1.06); text-decoration: none; color: #fff; }
.week-appt strong { display: block; font-weight: 650; }
.week-appt span { opacity: .9; }

/* =====================================================================
   AGENDA - VISAO DE MES (calendario)
   ===================================================================== */

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--bg-surface);
}

.month-dow {
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.month-dow:last-child { border-right: 0; }

.month-day {
    min-height: 92px;
    padding: 5px 6px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.month-day:nth-child(7n) { border-right: 0; }
.month-day.outside { background: var(--gray-50); color: var(--gray-400); }
.month-day.today-col { background: var(--brand-aqua-50, #eafaf8); }

.month-day-num {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin-bottom: 3px;
    border-radius: 50%;
    font-size: 12.5px;
    font-weight: 680;
    font-variant-numeric: tabular-nums;
    color: var(--gray-700);
}

.month-day.today-col .month-day-num { background: var(--brand-ink, #17284F); color: #fff; }

.day-appt {
    display: block;
    padding: 2px 5px;
    margin-bottom: 2px;
    border-radius: 5px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--gray-800);
    background: var(--brand-50);
    border-left: 3px solid var(--brand-400);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.day-appt:hover { background: var(--brand-100); text-decoration: none; }
.day-appt.done { background: #dcfce7; border-left-color: #16a34a; }
.day-appt.canceled { background: #fee2e2; border-left-color: #dc2626; text-decoration: line-through; }
.day-appt.no_show { background: #fef3c7; border-left-color: #f59e0b; }

.day-more {
    display: block;
    font-size: 11px;
    font-weight: 650;
    color: var(--text-muted);
    padding: 1px 5px;
}

@media (max-width: 860px) {
    .week-grid { overflow-x: auto; grid-template-columns: 52px repeat(7, 118px); }
    .month-grid { grid-template-columns: repeat(7, minmax(76px, 1fr)); overflow-x: auto; }
    .month-day { min-height: 74px; }
}

/* ---------- Receitario ---------- */
.rx-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.rx-item:last-child { border-bottom: 0; padding-bottom: 0; }
.rx-item:first-child { padding-top: 0; }
.rx-item-num {
    width: 24px; height: 24px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 50%; background: var(--brand-50);
    color: var(--brand-600); font-size: 11.5px; font-weight: 700;
}
.rx-posology { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.rx-note {
    white-space: pre-line; font-size: 13px; line-height: 1.65; color: var(--text-muted);
}
/* ---------- Sair (sidebar) ---------- */
.nav-logout { color: var(--danger); }
.nav-logout:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.sidebar-foot + .sidebar-foot { border-top: 1px solid var(--border); }
/* =====================================================================
   HERO COM PREVIA DO SISTEMA
   Mesma composicao do projeto de financas: texto a esquerda, janela do
   sistema a direita e cartoes flutuantes. Cores: a paleta do Odentia
   (--brand-*, --brand-aqua-*), sem introduce nenhuma cor nova.
   ===================================================================== */

/* Faixas circulares ao fundo (discretas). */
.hero-orbit {
    position: absolute;
    border: 1px solid rgba(47, 123, 246, .08);
    border-radius: 50%;
    pointer-events: none;
}
.hero-orbit-a { width: 760px; height: 760px; top: -280px; right: -190px; }
.hero-orbit-b { width: 520px; height: 520px; top: -160px; right: -70px; border-color: rgba(43, 176, 160, .1); }

/* Grade do hero: coluna de texto + coluna da previa. */
.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(380px, .92fr) minmax(520px, 1.08fr);
    align-items: center;
    gap: 34px;
    max-width: 1240px;
    margin: 0 auto;
}

.hero-copy { text-align: left; }

.hero .hero-badge { margin-bottom: 20px; }

.hero .hero-actions {
    justify-content: flex-start;
    margin-bottom: 0;
}

.hero .hero-stats {
    justify-content: flex-start;
    gap: 34px;
    padding-top: 30px;
    margin-top: 30px;
}

/* ---------- Cena (previa) ---------- */
.od-scene {
    position: relative;
    min-height: 600px;
    display: grid;
    place-items: center;
    padding: 18px 0 62px;
    perspective: 1200px;
}

.od-scene-glow {
    position: absolute;
    width: 500px;
    height: 380px;
    border-radius: 50%;
    background: rgba(147, 197, 253, .34);
    filter: blur(46px);
    transform: rotate(-11deg);
}

/* Janela do navegador/sistema. */
.od-window {
    position: relative;
    z-index: 2;
    width: min(100%, 616px);
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, .94);
    border-radius: 22px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 30px 65px rgba(23, 40, 79, .18), 0 3px 11px rgba(23, 40, 79, .07);
    transform: rotate(2.2deg);
    animation: od-float 6s ease-in-out infinite;
}

.od-window::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 white;
    pointer-events: none;
}

@keyframes od-float {
    0%, 100% { transform: rotate(2.2deg) translateY(0); }
    50%      { transform: rotate(1.4deg) translateY(-9px); }
}

.od-window-bar {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 13px;
    border-bottom: 1px solid #e7ecf3;
}

.od-dots { display: flex; gap: 5px; }
.od-dots i {
    display: block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #dbe6f7;
}
.od-dots i:nth-child(2) { background: #e7ecf3; }
.od-dots i:nth-child(3) { background: #eff2f7; }

.od-window-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #74839b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
}

.od-live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brand-aqua);
    box-shadow: 0 0 0 3px rgba(43, 176, 160, .16);
}

.od-avatar {
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #fff;
    font-size: 8px;
    font-weight: 700;
}

.od-window-body {
    padding: 24px 27px 28px;
    border-radius: 13px;
    background: #fcfdff;
}

.od-win-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.od-eyebrow {
    margin-bottom: 5px;
    color: #93a1b5;
    font-size: 10px;
    font-weight: 700;
}

.od-win-head h3 {
    font-size: 20px;
    letter-spacing: -.04em;
    color: var(--gray-900);
}

.od-pill-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border: 1px solid #e2e9f3;
    border-radius: 7px;
    background: #fff;
    color: #6d7d95;
    font-size: 9px;
    font-weight: 700;
}
.od-pill-sm { padding: 6px 8px; font-size: 8px; }

/* Indicador principal (gradiente na marca). */
.od-kpi {
    position: relative;
    overflow: hidden;
    margin-top: 20px;
    padding: 19px 21px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(118deg, var(--brand-700), var(--brand-500) 58%, var(--brand-aqua));
    box-shadow: 0 11px 24px rgba(29, 99, 216, .2);
}

.od-kpi::before {
    content: '';
    position: absolute;
    width: 180px; height: 180px;
    top: -92px; right: -42px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
}

.od-kpi-top,
.od-kpi-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.od-kpi-top { color: #d3e5ff; font-size: 10px; font-weight: 600; }

.od-kpi-icon {
    display: grid;
    place-items: center;
    width: 26px; height: 26px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .18);
}
.od-kpi-icon svg { width: 14px; height: 14px; }

.od-kpi strong {
    position: relative;
    display: block;
    margin: 8px 0 10px;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.06em;
}

.od-kpi-bottom {
    justify-content: flex-start;
    gap: 8px;
    color: rgba(255, 255, 255, .68);
    font-size: 9px;
}

.od-up {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 800;
    color: #a7f3d0;
}
.od-up svg { transform: rotate(-45deg); }

/* Metricas secundarias. */
.od-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.od-metric {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px;
    border: 1px solid #e4eaf3;
    border-radius: 12px;
    background: #fff;
}

.od-metric small,
.od-chart small {
    display: block;
    margin-bottom: 4px;
    color: #93a1b5;
    font-size: 9px;
}

.od-metric strong {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--gray-900);
}

.od-metric-ico,
.od-float-ico {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 28px; height: 28px;
    border-radius: 8px;
}
.od-metric-ico svg,
.od-float-ico svg { width: 15px; height: 15px; }

.od-ico-ok     { color: var(--success); background: var(--success-bg); }
.od-ico-warn   { color: #b45309;      background: var(--warning-bg); }
.od-ico-info   { color: var(--brand-600); background: var(--brand-50); }
.od-ico-danger { color: var(--danger);  background: var(--danger-bg); }

/* Grafico de barras (CSS puro). */
.od-chart {
    margin-top: 12px;
    padding: 15px 15px 9px;
    border: 1px solid #e4eaf3;
    border-radius: 12px;
    background: #fff;
}

.od-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.od-chart-head strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--gray-900);
}

.od-chart-area {
    display: flex;
    height: 112px;
    margin-top: 15px;
}

.od-chart-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 15px;
    color: #a6b2c2;
    font-size: 8px;
}

.od-bars {
    position: relative;
    display: flex;
    flex: 1;
    align-items: flex-end;
    justify-content: space-around;
    gap: 9px;
    margin-left: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid #edf1f7;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 28px, #edf1f7 29px);
}

.od-bar-col {
    display: flex;
    flex: 1;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.od-bar {
    width: 64%;
    min-height: 10px;
    border-radius: 5px 5px 2px 2px;
    background: #bfdbfe;
}

.od-bar-hi {
    background: var(--brand-500);
    box-shadow: 0 5px 13px rgba(47, 123, 246, .24);
}

.od-bar-col small { margin: 0; font-size: 8px; }

/* Cartoes flutuantes. */
.od-float {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .92);
    border-radius: 12px;
    background: rgba(255, 255, 255, .93);
    box-shadow: 0 16px 33px rgba(23, 40, 79, .14);
    backdrop-filter: blur(8px);
}

.od-float small {
    display: block;
    margin-bottom: 3px;
    color: #7d8ba0;
    font-size: 9px;
}

.od-float strong {
    display: block;
    color: var(--gray-900);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.od-float-ico { width: 30px; height: 30px; border-radius: 9px; }

.od-float-alert { top: 74px; right: -10px; min-width: 214px; }
.od-float-chart { top: 210px; right: -18px; min-width: 196px; }
.od-float-plan  { bottom: 46px; left: -12px; min-width: 226px; }

.od-mini-progress {
    position: absolute;
    right: 14px; bottom: 9px; left: 56px;
    height: 3px;
    overflow: hidden;
    border-radius: 9px;
    background: #e8eef6;
}
.od-mini-progress span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-aqua));
}

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
    .hero-grid { grid-template-columns: 1fr; gap: 12px; }
    .hero-copy { max-width: 660px; }
    .od-scene { max-width: 700px; margin: 0 auto; min-height: 560px; }
}

@media (max-width: 760px) {
    .hero { padding: 52px 19px 46px; }
    .hero .hero-actions { flex-direction: column; align-items: stretch; gap: 11px; }
    .hero .hero-actions .btn { width: 100%; justify-content: center; }
    .hero .hero-stats { gap: 20px 26px; padding-top: 24px; margin-top: 24px; }
    .hero-stat strong { font-size: 1.35rem; }

    .od-scene { min-height: 400px; padding: 0 0 34px; }
    .od-window { transform: rotate(1.4deg) scale(.94); }
    .od-window-body { padding: 17px 16px 20px; }
    .od-win-head h3 { font-size: 17px; }
    .od-kpi { padding: 15px; }
    .od-kpi strong { font-size: 22px; }
    .od-metrics { gap: 7px; }
    .od-metric { padding: 9px; gap: 7px; }
    .od-metric strong { font-size: 11px; }
    .od-chart { padding: 12px 10px 5px; }
    .od-chart-area { height: 92px; }

    .od-float { transform: scale(.82); }
    .od-float-alert { top: 18px; right: -14px; transform-origin: top right; }
    .od-float-chart { top: 128px; right: -22px; transform-origin: top right; }
    .od-float-plan  { bottom: 8px; left: -16px; transform-origin: bottom left; }
}

@media (prefers-reduced-motion: reduce) {
    .od-window { animation: none; }
}
/* Ajustes de composicao: o .hero original e' centralizado (text-align
   center + auto nas margens). Na versao com previa ao lado, a coluna de
   texto e' alinhada a esquerda e o brilho do fundo vai para a direita. */
.hero { position: relative; overflow: hidden; }

.hero-copy h1 { margin: 0 0 18px; max-width: 560px; }
.hero-copy p  { margin: 0 0 30px; max-width: 540px; text-align: left; }

@media (min-width: 1081px) {
    .hero {
        background:
            radial-gradient(1000px 460px at 78% 8%, rgba(47, 123, 246, .1), transparent 62%),
            radial-gradient(820px 400px at 88% 26%, rgba(43, 176, 160, .09), transparent 60%),
            linear-gradient(180deg, #fff, var(--bg-soft));
    }
}

@media (max-width: 1080px) {
    .hero {
        background:
            radial-gradient(900px 420px at 50% -60px, var(--brand-50), transparent 70%),
            linear-gradient(180deg, #fff, var(--bg-soft));
    }
    .hero-copy { text-align: center; }
    .hero-copy h1, .hero-copy p { margin-left: auto; margin-right: auto; }
    .hero-copy p { text-align: center; }
    .hero .hero-actions, .hero .hero-stats { justify-content: center; }
}
/* =====================================================================
   QUADROS DA DASHBOARD (views/dashboard/partials/kpi.php)
   Desenho inspirado nos cards do HPSM: faixa colorida no topo com icone e
   titulo em caixa alta, corpo com o numero grande e uma linha de apoio.
   Cores: apenas a paleta do Odentia. Nao altera .stat, que continua
   igual nas demais telas.
   ===================================================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition), transform var(--transition);
}

.kpi-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

/* Faixa colorida do topo. */
.kpi-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 15px;
    color: #fff;
}

.kpi-head-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, .2);
}

.kpi-head-icon svg { width: 15px; height: 15px; }

.kpi-head-label {
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1.2;
}

/* Corpo: numero + apoio. */
.kpi-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px 16px 16px;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.12;
    color: var(--gray-900);
    /* Valores em reais podem ser longos: encolhe em vez de estourar o card. */
    overflow-wrap: anywhere;
}

/* Versao compacta para dinheiro (R$ 48.320,00). */
.kpi-value-sm { font-size: 1.28rem; letter-spacing: -.03em; }

.kpi-meta {
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text-muted);
}

.kpi-meta-up   { color: var(--success); font-weight: 600; }
.kpi-meta-down { color: var(--danger);  font-weight: 600; }

/* ---------- Tons (mesmos nomes do .stat-icon) ---------- */
.kpi-blue   .kpi-head { background: linear-gradient(135deg, var(--brand-600), var(--brand-500)); }
.kpi-teal   .kpi-head { background: linear-gradient(135deg, #0e7490, var(--info)); }
.kpi-green  .kpi-head { background: linear-gradient(135deg, #15803d, var(--success)); }
.kpi-amber  .kpi-head { background: linear-gradient(135deg, #d97706, var(--warning)); }
.kpi-red    .kpi-head { background: linear-gradient(135deg, #b91c1c, var(--danger)); }
.kpi-purple .kpi-head { background: linear-gradient(135deg, #6d28d9, var(--purple)); }

/* Sem faixa: leitura mais limpa para o card de resultado. */
.kpi-plain .kpi-head { background: var(--gray-900); }

@media (prefers-reduced-motion: reduce) {
    .kpi-link { transition: none; }
}
/* =====================================================================
   AGENDA - BARRA DE CONTROLES
   Substitui a antiga .agenda-toolbar: acao + filtros a esquerda,
   troca de visao e navegacao a direita.
   ===================================================================== */

/* Ficha de anamnese facial: grupos de checkbox. */
.facial-fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 4px;
}

.facial-fieldset legend {
    margin-bottom: var(--space-2);
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 6px 16px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    padding: 3px 0;
}

.check-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.detail-list {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 6px 16px;
    margin: 0;
    font-size: 13.5px;
}

.detail-list dt {
    color: var(--text-muted);
    font-weight: 600;
}

.detail-list dd {
    margin: 0;
}

/* Plano de tratamento facial: tabelas de regioes. */
.table-regions .col-check {
    width: 55%;
}

.table-regions tr.row-active {
    background: rgba(47, 123, 246, .07);
}

.table-regions tr.row-active .check-item span {
    font-weight: 600;
}

.table-regions .mark {
    display: inline-block;
    font-weight: 700;
    color: var(--primary);
}
/* Abas de modulo da agenda (odontologia / harmonizacao facial). */
.agenda-modulo-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-3);
    padding: 4px;
    background: var(--surface-muted);
    border-radius: var(--radius-lg);
}

.agenda-modulo-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    transition: background .15s ease, color .15s ease;
}

.agenda-modulo-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .6);
}

.agenda-modulo-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.agenda-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xs);
}

.agenda-bar-main {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.agenda-bar-filters {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.agenda-field { display: flex; flex-direction: column; gap: 5px; }
.agenda-field .select { min-width: 190px; min-height: 38px; }
.agenda-filter-go { min-height: 38px; }

.agenda-bar-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.agenda-views {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}

.agenda-view {
    padding: 8px 13px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-right: 1px solid var(--border);
    transition: background var(--transition), color var(--transition);
}
.agenda-view:last-child { border-right: 0; }
.agenda-view:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.agenda-view.is-active { background: var(--brand-500); color: #fff; }

.agenda-nav { display: flex; gap: 6px; }

/* =====================================================================
   AGENDA - GRADE DE TEMPO CONTINUO
   Eixo de tempo de meia hora em meia hora; cada consulta vira um bloco
   posicionado por top/height conforme a duracao real.
   ===================================================================== */

.cal {
    display: grid;
    grid-template-columns: 62px 1fr;
    grid-template-rows: auto auto;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    min-width: 860px;
}

.cal-corner { border-right: 1px solid var(--border); background: var(--bg-soft); }

.cal-heads {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border);
}

.cal-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 6px;
    border-right: 1px solid var(--border);
}
.cal-head:last-child { border-right: 0; }
.cal-head.is-weekend { background: var(--bg-soft); }
.cal-head.is-today   { background: var(--brand-50); }

.cal-head-dow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.cal-head-day { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.cal-head.is-today .cal-head-day { color: var(--brand-700); }

.cal-head-count {
    padding: 1px 7px;
    border-radius: var(--r-full);
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: 10.5px;
    font-weight: 700;
}

/* Eixo das horas. */
.cal-times { border-right: 1px solid var(--border); background: var(--bg-soft); }

.cal-time {
    height: 34px;
    padding-right: 9px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    transform: translateY(-7px);
}
.cal-time.is-hour  { font-weight: 600; color: var(--gray-600); }
.cal-time.is-half  { color: var(--text-subtle); }

/* Colunas e linhas. */
.cal-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-lines { position: absolute; inset: 0; display: flex; flex-direction: column; pointer-events: none; }
.cal-line { flex-shrink: 0; height: 34px; border-bottom: 1px solid var(--border); }
.cal-line.is-half { border-bottom-style: dotted; border-bottom-color: var(--gray-100); }

.cal-col {
    position: relative;
    border-right: 1px solid var(--border);
}
.cal-col:last-child { border-right: 0; }
.cal-col.is-weekend { background: rgba(148, 163, 184, .05); }
.cal-col.is-today   { background: rgba(47, 123, 246, .045); }

/* Bloco da consulta. */
.cal-appt {
    position: absolute;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 7px;
    border-radius: 6px;
    border-left: 3px solid var(--cal-color, var(--brand-500));
    background: color-mix(in srgb, var(--cal-color, #2F7BF6) 14%, #fff);
    color: var(--gray-900);
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(23, 40, 79, .06);
    transition: box-shadow var(--transition), transform var(--transition);
}

.cal-appt:hover {
    z-index: 5;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}

.cal-appt-time {
    font-size: 9.5px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-appt-name {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-appt-note,
.cal-appt-status {
    font-size: 10px;
    line-height: 1.3;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-appt-status { font-weight: 600; }

/* Cancelada / falta: riscada, para nao parecer horario occupied. */
.cal-appt.is-closed {
    opacity: .62;
    background: repeating-linear-gradient(
        135deg,
        var(--gray-100),
        var(--gray-100) 6px,
        var(--gray-50) 6px,
        var(--gray-50) 12px
    );
    border-left-color: var(--gray-400);
}
.cal-appt.is-closed .cal-appt-name { text-decoration: line-through; }

/* Legenda. */
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.cal-legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-muted); }
.cal-legend-swatch { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }

/* =====================================================================
   RESPONSIVO
   ===================================================================== */
@media (max-width: 1024px) {
    /* Ficha de anamnese facial: grupos de checkbox. */
.facial-fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 4px;
}

.facial-fieldset legend {
    margin-bottom: var(--space-2);
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 6px 16px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    padding: 3px 0;
}

.check-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.detail-list {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 6px 16px;
    margin: 0;
    font-size: 13.5px;
}

.detail-list dt {
    color: var(--text-muted);
    font-weight: 600;
}

.detail-list dd {
    margin: 0;
}

/* Plano de tratamento facial: tabelas de regioes. */
.table-regions .col-check {
    width: 55%;
}

.table-regions tr.row-active {
    background: rgba(47, 123, 246, .07);
}

.table-regions tr.row-active .check-item span {
    font-weight: 600;
}

.table-regions .mark {
    display: inline-block;
    font-weight: 700;
    color: var(--primary);
}
/* Abas de modulo da agenda (odontologia / harmonizacao facial). */
.agenda-modulo-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-3);
    padding: 4px;
    background: var(--surface-muted);
    border-radius: var(--radius-lg);
}

.agenda-modulo-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    transition: background .15s ease, color .15s ease;
}

.agenda-modulo-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .6);
}

.agenda-modulo-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.agenda-bar { align-items: stretch; }
    .agenda-bar-main, .agenda-bar-side { width: 100%; }
    .agenda-bar-side { justify-content: space-between; }
    .agenda-field { flex: 1 1 180px; }
    .agenda-field .select { min-width: 0; width: 100%; }
}

@media (max-width: 640px) {
    .agenda-bar-main { flex-direction: column; align-items: stretch; }
    .agenda-bar-main > .btn { justify-content: center; }
    .agenda-views { width: 100%; }
    .agenda-view { flex: 1; text-align: center; padding: 8px 4px; font-size: 11.5px; }
}

@media print {
    .agenda-bar, .cal-corner { display: none; }
    .cal { grid-template-columns: 46px 1fr; border: 0; box-shadow: none; }
}

/* ================= WHATSAPP ================= */
/* Verde do WhatsApp. Fica uma acao separada de .btn-secondary porque o
   botao e uma acao de contao com paciente, nao uma navegacao interna. */
.btn-whatsapp {
    background: #25d366;
    color: #0b3d1f;
    border-color: #1eb457;
    font-weight: 600;
}
.btn-whatsapp:hover { background: #1eb457; color: #08290f; border-color: #199a4a; }

.wa-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 6px 0 2px;
}

.wa-action { display: flex; flex-direction: column; gap: 8px; }

.wa-action__hint {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--gray-500);
    margin: 0;
}
.wa-action__hint--warn {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: var(--warning);
    background: var(--warning-bg, #fef3c7);
    border: 1px solid var(--warning-border, #fde68a);
    border-radius: var(--r-sm);
    padding: 8px 10px;
}
.wa-action__hint--warn .nav-icon { flex: 0 0 auto; margin-top: 1px; }

.wa-action__number {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--gray-500);
    margin: 0;
}
.wa-action__tag {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #1eb457;
    background: #dcfce7;
    border-radius: 999px;
    padding: 1px 7px;
}
.wa-action__tag--muted { color: var(--gray-500); background: var(--gray-100); }

.wa-templates {
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-surface);
}
.wa-templates__summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    list-style: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
    padding: 7px 10px;
    user-select: none;
}
.wa-templates__summary::-webkit-details-marker { display: none; }
.wa-templates__summary:hover { color: var(--gray-900); background: var(--gray-50); }
.wa-templates[open] .wa-templates__summary .nav-icon { transform: rotate(180deg); }
.wa-templates__summary .nav-icon { transition: transform .18s ease; }

.wa-templates__list {
    border-top: 1px solid var(--border);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wa-templates__item {
    display: block;
    font-size: 12.5px;
    color: var(--gray-700);
    text-decoration: none;
    padding: 7px 9px;
    border-radius: var(--r-sm);
}
.wa-templates__item:hover { background: var(--gray-50); color: var(--gray-900); }

.wa-action--empty { gap: 8px; }

/* ================= AGENDA EM DESTAQUE =================
   Fica logo abaixo dos KPIs, em largura total, com os dois blocos
   lado a lado. Os dois cartoes tem a mesma altura para nao ficar
   um "degrau" entre eles. */
.dash-agenda {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.dash-agenda__card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-strong);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px -12px rgba(15, 23, 42, .18);
    overflow: hidden;
}

.dash-agenda__head {
    padding: 13px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
}

.dash-agenda__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.dash-agenda__heading h2 { font-size: 15.5px; line-height: 1.25; }
.dash-agenda__heading p { font-size: 12px; color: var(--gray-500); margin: 0; }

.dash-agenda__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    flex: 0 0 auto;
}
.dash-agenda__icon--today { background: var(--brand-100); color: var(--brand-600); }
.dash-agenda__icon--next  { background: var(--info-bg, #eff6ff); color: var(--info, #2F7BF6); }

.dash-agenda__count {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.dash-agenda__count--total { background: var(--gray-900); color: #fff; }
.dash-agenda__count--ok    { background: var(--success-bg); color: var(--success); }
.dash-agenda__count--next  { background: var(--brand-100); color: var(--brand-700, var(--brand-600)); }

/* lista rolável: os dois cartoes crescem juntos */
.dash-agenda__list {
    flex: 1 1 auto;
    max-height: 384px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* linha da consulta */
.dash-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 13px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--slot-color, var(--brand-500, #2F7BF6));
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition);
}
.dash-slot:last-child { border-bottom: 0; }
.dash-slot:hover { background: var(--brand-50, #f8fafc); }

.dash-slot__time {
    flex: 0 0 auto;
    width: 52px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
}
.dash-slot__time--day {
    width: 74px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}
.dash-slot__time--day span { font-weight: 500; color: var(--gray-500); }

.dash-slot__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }

.dash-slot__name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-slot__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-slot__status {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    /* fundo suave na propria cor do status */
    color: var(--slot-color, var(--gray-600));
    background: color-mix(in srgb, var(--slot-color, #2F7BF6) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--slot-color, #2F7BF6) 26%, transparent);
    white-space: nowrap;
}

.dash-agenda__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 16px;
    color: var(--gray-400);
    font-size: 13px;
}

@media (max-width: 1180px) {
    .dash-agenda { grid-template-columns: 1fr; }
    .dash-agenda__list { max-height: 320px; }
}

/* ================= AVISOS DA DASHBOARD =================
   Cartoes de atencao em largura total, lado a lado. Antes ficavam
   empilhados na coluna estreita da direita e deixavam um buraco
   vazio do lado esquerdo. */
.dash-alerts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    align-items: start;
    margin-bottom: 18px;
}

/* Sem o container de avisos, nao deixa espacamento sobrando. */
.dash-alerts:empty { display: none; }

/* ---------- Aniversariantes com WhatsApp ---------- */
.dash-bday {
    align-items: center;
    gap: 8px;
    padding-right: 12px;
}

.dash-bday__link {
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 1 1 auto;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}
.dash-bday__link:hover .notif-title { color: var(--brand-600); }
.dash-bday__link:hover { background: transparent; }

.dash-bday__wa {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #0b3d1f;
    background: #25d366;
    border: 1px solid #1eb457;
    transition: background var(--transition);
}
.dash-bday__wa:hover { background: #1eb457; color: #08290f; }

.dash-bday__wa--off {
    color: var(--gray-400);
    background: transparent;
    border-color: var(--border);
    padding: 0 8px;
    cursor: default;
}
