/* ==============================================================================
   OrbeClinic — Executive Design System (Inspirado em Lovable & FleetFlow)
   Layout Corporativo: Sidebar Deep Navy (#131d36) + Área Clara Executiva (#f8fafc)
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    /* Tipografia */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, monospace;

    /* Superfícies Light Executive (Padrão FleetFlow / Stripe) */
    --background: #f8fafc;
    --foreground: #0f172a;
    --card: #ffffff;
    --card-foreground: #0f172a;
    --card-border: #e2e8f0;
    --subtle: #f1f5f9;
    --muted: #64748b;
    --muted-light: #94a3b8;

    /* Sidebar Deep Corporate Navy */
    --sidebar: #131d36;
    --sidebar-border: #202d4d;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: rgba(20, 184, 166, 0.16);
    --sidebar-text: #cbd5e1;
    --sidebar-text-active: #ffffff;

    /* Brand & Acentos */
    --primary: #0f766e;
    --primary-hover: #115e59;
    --primary-light: #14b8a6;
    --primary-subtle: rgba(15, 118, 110, 0.08);
    --accent-navy: #1e3a8a;
    --accent-amber: #d97706;

    /* Semântica */
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --info: #0284c7;
    --info-bg: #f0f9ff;
    --info-border: #bae6fd;

    /* Raios & Elevação */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-card: 0 1px 2px 0 rgba(15, 23, 42, 0.04), 0 4px 16px -4px rgba(15, 23, 42, 0.06);
    --shadow-dropdown: 0 12px 32px -4px rgba(15, 23, 42, 0.16), 0 4px 10px -2px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
    border-color: var(--card-border);
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
    color: var(--foreground);
    margin-top: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

svg.icon-svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ==============================================================================
   Layout Corporativo em 2 Colunas (Sidebar Fixa + Workspace Claro)
   ============================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--background);
}

/* Sidebar Deep Navy */
.app-sidebar {
    width: 264px;
    background: var(--sidebar);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    color: var(--sidebar-text);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 1.25rem 1.15rem 1rem 1.15rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.brand-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    /* Símbolo da OrbeClinic: o azul-escuro do símbolo some no menu escuro, por isso a base clara */
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.35);
}

.brand-icon-box img {
    width: 28px;
    height: 28px;
    display: block;
}

.brand-title-destaque {
    color: #2dd4bf; /* "clinic" da logo, clareado para contraste no menu escuro */
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}

.brand-tag {
    font-size: 0.68rem;
    color: #94a3b8;
    display: block;
    font-family: var(--font-sans);
    font-weight: 500;
}

/* Mini Card da Clínica na Sidebar */
.sidebar-company-card {
    margin-top: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.company-name-truncate {
    font-size: 0.76rem;
    font-weight: 600;
    color: #f1f5f9;
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem 0 1rem 0;
}

.nav-group-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #64748b;
    padding: 0.85rem 1.25rem 0.35rem 1.25rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.85rem;
    margin: 0.15rem 0.7rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    font-weight: 600;
    border-left: 3px solid #2dd4bf;
}

.sidebar-nav-item .icon-svg {
    width: 17px;
    height: 17px;
    opacity: 0.8;
}

.sidebar-nav-item.active .icon-svg {
    opacity: 1;
    color: #2dd4bf;
}

/* Rodapé da Sidebar (Perfil & Logout) */
.sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.22);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.user-avatar-pill {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #0284c7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.user-info-text {
    flex: 1;
    min-width: 0;
}

.user-name-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-subtitle {
    font-size: 0.68rem;
    color: #94a3b8;
}

.btn-sidebar-logout {
    background: transparent;
    border: 1px solid transparent;
    color: #f87171;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
}

/* ==============================================================================
   Área Principal (Main Content + Sticky Topbar)
   ============================================================================== */
.app-main {
    margin-left: 264px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    background: var(--background);
}

.app-topbar {
    height: 58px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.module-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.module-breadcrumbs strong {
    color: var(--foreground);
    font-weight: 600;
}

.status-indicator-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #047857;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-view-container,
.app-content-container {
    padding: 1.75rem 2rem 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ==============================================================================
   Cabeçalho das Telas & Cards Executivos (Padrão FleetFlow)
   ============================================================================== */
.content-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--foreground);
    letter-spacing: -0.025em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
}

.section-title {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0 0 0.75rem 0;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    border-color: #cbd5e1;
}

.bg-subtle {
    background: var(--subtle) !important;
    border-color: var(--card-border);
}

.bg-teresopolis {
    background: linear-gradient(90deg, #f0fdfa 0%, #eff6ff 100%) !important;
    border: 1px solid #99f6e4 !important;
}

/* ==============================================================================
   KPI StatCards Executivos
   ============================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.15rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    padding: 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.35rem;
    background: var(--card);
}

.kpi-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.kpi-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--primary-subtle);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon-box.success { color: #059669; background: #ecfdf5; }
.kpi-icon-box.warning { color: #d97706; background: #fffbeb; }
.kpi-icon-box.info { color: #0284c7; background: #f0f9ff; }
.kpi-icon-box.danger { color: #dc2626; background: #fef2f2; }
.kpi-icon-box.purple { color: #7c3aed; background: #f5f3ff; }

.kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: -0.01em;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--foreground);
    line-height: 1.15;
    margin: 0.15rem 0;
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--muted);
}

/* ==============================================================================
   Tabelas Executivas & Grids de Cards
   ============================================================================== */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.table-modern th {
    text-align: left;
    padding: 0.78rem 1.15rem;
    color: var(--muted);
    border-bottom: 1px solid var(--card-border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
    white-space: nowrap;
}

.table-modern td {
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.table-modern tbody tr:hover td {
    background: #f8fafc;
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* Grids de Pacientes, Pacotes & Serviços */
.patients-grid,
.pacotes-grid,
.catalogo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 1.15rem;
}

.patient-card,
.pacote-card,
.servico-card {
    padding: 1.25rem;
}

.patient-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--foreground);
    margin: 0 0 0.25rem 0;
}

.patient-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--muted);
}

/* ==============================================================================
   Botões & Ações
   ============================================================================== */
.btn {
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.84rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-decoration: none;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 118, 110, 0.25);
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}
.btn-success:hover {
    background: #047857;
    color: #ffffff;
}

.btn-secondary {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #1e293b;
}
.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-outline {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}
.btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-outline-primary {
    background: #ffffff;
    border-color: rgba(15, 118, 110, 0.45);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
}

.btn-outline-info {
    background: #ffffff;
    border-color: #7dd3fc;
    color: #0284c7;
}
.btn-outline-info:hover {
    background: #f0f9ff;
    border-color: #0284c7;
}

.btn-outline-danger {
    background: #ffffff;
    border-color: #fca5a5;
    color: #dc2626;
}
.btn-outline-danger:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

.btn-outline-success {
    background: #ffffff;
    border-color: #6ee7b7;
    color: #059669;
}
.btn-outline-success:hover {
    background: #ecfdf5;
    border-color: #059669;
}

/* Sincronização com o governo (NFS-e): cor própria, distinta do verde de "Emitir" */
.btn-sync {
    background: var(--info);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(2, 132, 199, 0.3);
}
.btn-sync:hover {
    background: #0369a1;
    color: #ffffff;
}
.btn-sync:disabled {
    opacity: 0.75;
    cursor: wait;
}

.aviso-sync {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--info-border);
    background: var(--info-bg);
    color: #075985;
    font-size: 0.84rem;
    margin-bottom: 1rem;
}
.aviso-sync strong { color: #0c4a6e; }
.aviso-sync.erro {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}
.aviso-sync.erro strong { color: #7f1d1d; }
.aviso-sync.ok {
    padding: 0.4rem 0;
    border: none;
    background: transparent;
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
}

.btn-icon {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 0.35rem 0.6rem;
}
.btn-icon:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-sm {
    padding: 0.38rem 0.72rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.75rem 1.35rem;
    font-size: 0.95rem;
    border-radius: 10px;
}

.btn-group-toggle {
    display: inline-flex;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

/* ==============================================================================
   Badges & Pills Semânticas
   ============================================================================== */
.badge {
    font-size: 0.72rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.badge-primary { background: #ccfbf1; color: #0f766e; border: 1px solid #99f6e4; }
.badge-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-info { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.badge-neutral,
.badge-subtle { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* Progress Bar */
.progress-bar-bg {
    background: #e2e8f0;
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, #0f766e, #14b8a6);
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ==============================================================================
   Modais & Formulários Corporativos
   ============================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1.5rem;
}

.modal-overlay.modal-stacked {
    z-index: 3100 !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(5px) !important;
}

.modal-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 580px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-dropdown);
    color: var(--foreground);
}

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1100px; width: 95vw; }
.modal-2xl { max-width: 1280px; width: 96vw; }

/* Grid de duas colunas balanceadas para modais amplos sem barra de rolagem */
.modal-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 900px) {
    .modal-split-grid {
        grid-template-columns: 1fr;
    }
}

/* Campos de serviço fiscal expandidos e legíveis */
#nfCodigoLc116, #nfCodigoNbs {
    font-size: 0.88rem;
    min-width: 100%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--foreground);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
}

.modal-close:hover {
    background: #f1f5f9;
    color: var(--foreground);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 0.58rem 0.85rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ==============================================================================
   Classes Utilitárias Completas (Spacing, Flex, Typography)
   ============================================================================== */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.85rem; }
.p-4 { padding: 1.25rem; }
.p-5 { padding: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.85rem; }
.pb-4 { padding-bottom: 1.25rem; }
.pt-3 { padding-top: 0.85rem; }
.pt-5 { padding-top: 2rem; }

.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.85rem; }
.mb-4 { margin-bottom: 1.25rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.85rem; }
.mt-4 { margin-top: 1.25rem; }
.mt-5 { margin-top: 2rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-3 { margin-top: 0.85rem; margin-bottom: 0.85rem; }
.my-4 { margin-top: 1.25rem; margin-bottom: 1.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.85rem; }
.ml-1 { margin-left: 0.25rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.block { display: block; }
.w-full, .w-100 { width: 100%; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-between { display: flex; justify-content: space-between; }
.align-center { align-items: center; }
.flex-gap { display: flex; gap: 0.5rem; }
.justify-end { justify-content: flex-end; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-base { font-size: 0.95rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.35rem; }
.text-2xl { font-size: 1.65rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-justify { text-align: justify; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.04em; }
.text-decoration-none { text-decoration: none; }
.leading-relaxed { line-height: 1.65; }

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }

.text-muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-info { color: var(--info); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-white { color: #0f172a; } /* Proteção dentro de cards claros */
.app-sidebar .text-white { color: #ffffff; }

.border-b { border-bottom: 1px solid #e2e8f0; }
.border-t { border-top: 1px solid #e2e8f0; }
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.search-box-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.card-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.pacote-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--foreground);
    margin: 0 0 0.25rem 0;
}

.pacote-paciente { color: var(--muted); margin: 0; }
.pacote-valor { letter-spacing: -0.02em; }
.responsavel-box {
    background: var(--subtle);
    border: 1px solid var(--card-border);
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
}

.espelho-nfse-box, .recibo-papel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--muted);
}

/* Dashboard Columns & Timeline */
.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.25rem;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    margin-top: 6px;
    flex-shrink: 0;
}

.timeline-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0 0 0.15rem 0;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(15, 23, 42, 0.45);
    }
    .app-main {
        margin-left: 0;
    }
    #btnToggleSidebar {
        display: inline-flex !important;
    }
    .app-view-container,
    .app-content-container {
        padding: 1.25rem 1rem 3rem 1rem;
    }
}

/* Impressão de Espelho NFS-e / Recibos A4 */
@media print {
    .app-sidebar, .app-topbar, .espelho-actions, .no-print {
        display: none !important;
    }
    .app-main {
        margin-left: 0 !important;
    }
    .app-content {
        padding: 0 !important;
    }
    body, .app-layout, .app-main {
        background: #ffffff !important;
    }
    .modal-overlay {
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
    }
    .modal-box {
        box-shadow: none !important;
        border: none !important;
        max-height: none !important;
    }
    .pep-print-sheet {
        display: block !important;
    }
}


/* ============================================================================
   MÓDULO FINANCEIRO COMPLETO — EXECUTIVE LIGHT EXTENSIONS
   ============================================================================ */
.kpi-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1280px) {
    .kpi-grid-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .kpi-grid-5 {
        grid-template-columns: 1fr;
    }
}

.exec-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    background: #e2e8f0;
    padding: 0.25rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
}

.exec-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.48rem 0.95rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.exec-tab-btn:hover {
    color: #0f172a;
}

.exec-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.exec-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #cbd5e1;
    color: #1e293b;
}

.exec-tab-btn.active .exec-tab-badge {
    background: #ccfbf1;
    color: #0f766e;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    background: #ffffff;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.25rem;
}

.filter-bar .filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 135px;
    flex: 1 1 155px;
}

.filter-bar .filter-item label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.account-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.account-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.account-card.selected {
    border-color: #0f766e;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
}

.account-card.inactive {
    opacity: 0.65;
    background: #f8fafc;
}

.plano-row-grupo {
    background: #f8fafc;
    font-weight: 700;
}

.plano-row-analitica td:first-child {
    padding-left: 1.85rem;
}

.badge-purple {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon-sm:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-icon-sm.btn-pay {
    border-color: #99f6e4;
    color: #0f766e;
    background: #f0fdfa;
}

.btn-icon-sm.btn-pay:hover {
    background: #ccfbf1;
    border-color: #0f766e;
}

.btn-icon-sm.btn-del:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.quick-actions-row {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    align-items: center;
}

.text-danger {
    color: #b91c1c !important;
}

.text-warning {
    color: #b45309 !important;
}

.text-info {
    color: #0369a1 !important;
}

/* ============================================================================
   CONTAS A RECEBER & CONTAS A PAGAR — AGING, QUICK CHIPS, LOTE & BADGES
   ============================================================================ */
.sidebar-nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    line-height: 1.3;
}

.sidebar-nav-badge.danger {
    background: #ef4444;
    color: #ffffff;
}

.sidebar-nav-badge.info {
    background: #0284c7;
    color: #ffffff;
}

.quick-chips-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.quick-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-chip-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.quick-chip-btn.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
}

.quick-chip-btn.danger-chip.active {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff;
}

.quick-chip-count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.quick-chip-btn.active .quick-chip-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.batch-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.15rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    color: #134e4a;
}

.aging-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.08rem 0.4rem;
    border-radius: 4px;
    margin-top: 0.15rem;
}

.aging-tag.overdue {
    background: #fee2e2;
    color: #b91c1c;
}

.aging-tag.today {
    background: #fef3c7;
    color: #b45309;
}

.aging-tag.soon {
    background: #e0f2fe;
    color: #0369a1;
}

.btn-settle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 30px;
    padding: 0 0.65rem;
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #99f6e4;
    background: #f0fdfa;
    color: #0f766e;
    transition: all 0.15s;
}

.btn-settle:hover {
    background: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
}

.btn-settle.pay-mode {
    border-color: #fde68a;
    background: #fffbeb;
    color: #b45309;
}

.btn-settle.pay-mode:hover {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

/* ==========================================================================
   PROFISSIONAIS, COMISSOES & AGENDA INTELIGENTE (FASE 1 SEUFISIO PARITY)
   ========================================================================== */

.prof-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

.prof-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.agenda-week-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 0.75rem;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.agenda-day-col {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    min-height: 260px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.agenda-day-col.is-today {
    background: #f0fdfa;
    border-color: #5eead4;
    box-shadow: 0 4px 14px -4px rgba(15, 118, 110, 0.14);
}

.agenda-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.7rem 0.75rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

.agenda-day-col.is-today .agenda-day-header {
    background: linear-gradient(180deg, #ccfbf1 0%, #f0fdfa 100%);
    border-bottom-color: #99f6e4;
}

.agenda-day-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.25;
}

.agenda-turmas-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.5rem 0.6rem;
    background: rgba(255, 255, 255, 0.72);
    border-bottom: 1px dashed var(--border-color);
}

.turma-capacity-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f766e;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.turma-capacity-pill:hover {
    border-color: var(--primary);
    background: #f0fdfa;
    transform: translateY(-1px);
}

.turma-capacity-pill strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: #0f172a;
}

.turma-capacity-pill.full {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
}

.turma-capacity-pill.full strong {
    color: #b91c1c;
}

.agenda-day-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem;
    flex: 1;
}

.agenda-slot-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    padding: 0.6rem 0.65rem;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.agenda-slot-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -4px rgba(15, 23, 42, 0.12);
    border-color: #cbd5e1;
}

.agenda-slot-card.status-realizado {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.agenda-slot-card.status-falta {
    background: #fffbeb;
    border-color: #fde68a;
}

.agenda-slot-card.status-cancelado {
    background: #f8fafc;
    border-color: #e2e8f0;
    opacity: 0.72;
}

.agenda-card-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-top: 0.4rem;
    border-top: 1px dashed #e2e8f0;
}

@media (max-width: 1280px) {
    .agenda-week-grid {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .agenda-week-grid {
        grid-template-columns: 1fr;
    }
    .agenda-day-col {
        min-height: auto;
    }
}

/* ============================================================================
   FASE 2 — PRONTUÁRIO ELETRÔNICO (PEP), SOAP, EVA & MENSALIDADES RECORRENTES
   ============================================================================ */

.pep-patient-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
    border: 1px solid #99f6e4;
    border-radius: 14px;
    margin-bottom: 1rem;
}

.pep-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 10px;
    color: #991b1b;
    margin-bottom: 1rem;
}

.pep-allergy-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #d97706;
    border-radius: 10px;
    color: #92400e;
    margin-bottom: 1rem;
}

.pep-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.pep-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.pep-tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pep-tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.22);
}

.soap-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.soap-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
}

.soap-box-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    margin-bottom: 0.4rem;
}

.soap-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
}

.eva-scale-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.eva-pill {
    min-width: 32px;
    height: 32px;
    padding: 0 0.45rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.12s ease;
}

.eva-pill:hover {
    transform: translateY(-1px);
}

.eva-pill.active-low {
    background: #10b981;
    border-color: #059669;
    color: #ffffff;
}

.eva-pill.active-mid {
    background: #f59e0b;
    border-color: #d97706;
    color: #ffffff;
}

.eva-pill.active-high {
    background: #ef4444;
    border-color: #dc2626;
    color: #ffffff;
}

.eva-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.eva-badge.eva-low {
    background: #dcfce7;
    color: #166534;
}

.eva-badge.eva-mid {
    background: #fef3c7;
    color: #92400e;
}

.eva-badge.eva-high {
    background: #fee2e2;
    color: #991b1b;
}

.eva-chart-wrap {
    width: 100%;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.pep-timeline-item {
    position: relative;
    padding: 1rem 1.15rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    margin-bottom: 0.85rem;
}

.pep-condicoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 0.5rem;
}

.pep-cond-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.83rem;
    cursor: pointer;
}

.pep-cond-chip.checked {
    background: #f0fdfa;
    border-color: var(--primary);
    color: #0f766e;
    font-weight: 600;
}

.pep-print-sheet {
    display: none;
    background: #ffffff;
    color: #0f172a;
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.45;
}

@media (max-width: 768px) {
    .soap-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   FASE 2B — DOCUMENTOS/ANEXOS, CRM KANBAN, RETENÇÃO & PORTAL DE CONTRATOS
   ============================================================================ */
.anexo-grid,
.retencao-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 0.9rem;
}

.anexo-card,
.retencao-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.95rem 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.retencao-highlight {
    border-color: #10b981;
    background: #f0fdf4;
}

.crm-kanban-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(235px, 1fr));
    gap: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.65rem;
    align-items: start;
}

.crm-kanban-col {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 360px;
    display: flex;
    flex-direction: column;
}

.crm-kanban-header {
    padding: 0.75rem 0.85rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}

.crm-kanban-body {
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.crm-lead-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.7rem 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.contrato-a4-preview {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 1.5rem;
    color: #0f172a;
}

.public-contract-shell {
    max-width: 760px;
    margin: 1.5rem auto;
    padding: 0 1rem 2rem 1rem;
}

body.public-portal-mode .app-sidebar,
body.public-portal-mode .app-topbar,
body.auth-required-mode .app-sidebar,
body.auth-required-mode .app-topbar {
    display: none !important;
}

body.public-portal-mode .app-layout,
body.auth-required-mode .app-layout {
    display: block !important;
}

body.public-portal-mode .app-main,
body.auth-required-mode .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh;
}

/* Auth Gate Fullscreen */
body.auth-required-mode {
    background: linear-gradient(135deg, #0f172a 0%, #134e4a 55%, #0f172a 100%);
}

body.auth-required-mode .app-view-container {
    padding: 1.5rem 1rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-gate-shell {
    width: 100%;
    max-width: 540px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.38);
    overflow: hidden;
}

.auth-gate-shell.register-wide {
    max-width: 720px;
}

.auth-gate-header {
    background: #ffffff;
    color: #0f2742;
    padding: 1.5rem 1.75rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.auth-gate-logo {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
}

.auth-gate-sub {
    font-size: 0.84rem;
    color: #475569;
    margin-top: 0.6rem;
}

.auth-gate-selo {
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.auth-gate-body {
    padding: 1.5rem 1.75rem 1.75rem;
}

/* Separação estrita Painel Admin SaaS vs Clínica Operacional */
body.admin-saas-mode .sidebar-nav-item:not(.nav-admin-only),
body.admin-saas-mode .nav-group-label:not(.nav-group-admin),
body.admin-saas-mode .topbar-clinic-only {
    display: none !important;
}

body.admin-saas-mode .nav-admin-only {
    display: flex !important;
}

body.admin-saas-mode .nav-group-label.nav-group-admin {
    display: block !important;
}

/* ============================================================================
   FASE 3 (PWA) — STATUS CONEXÃO, ASSINATURA DIGITAL & MODO TABLET
   ============================================================================ */
.pwa-net-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 0.76rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
}

.pwa-net-pill .pwa-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.pwa-net-pill.offline {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.pwa-net-pill.offline .pwa-dot {
    background: #dc2626;
}

.pwa-net-pill.syncing {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.pwa-net-pill.syncing .pwa-dot {
    background: #f59e0b;
}

.tablet-input {
    font-size: 0.96rem;
    padding: 0.65rem 0.8rem;
}

.tablet-chip {
    min-height: 46px;
    padding: 0.65rem 0.85rem;
}

.eva-pill-lg {
    min-width: 40px;
    height: 40px;
    font-size: 0.92rem;
}

.sig-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.sig-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem;
}

.signature-canvas {
    width: 100%;
    height: 155px;
    display: block;
    background: #ffffff;
    border: 2px dashed #94a3b8;
    border-radius: 10px;
    cursor: crosshair;
    touch-action: none;
}

@media (max-width: 768px) {
    .sig-grid {
        grid-template-columns: 1fr;
    }
    .topbar-right .status-indicator-badge {
        display: none;
    }
}

/* ============================================================================
   CHECKLIST FISCAL & ROTEIRO DE VALIDAÇÃO CONTÁBIL (RESPONSABILIDADE COMPARTILHADA)
   ============================================================================ */
.checklist-fiscal-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.checklist-fiscal-card.pendente {
    background: linear-gradient(135deg, #f8fafc 0%, #fffbeb 100%);
    border-color: #fde68a;
}

.checklist-progress-container {
    background: #e2e8f0;
    border-radius: 9999px;
    height: 10px;
    overflow: hidden;
    margin: 0.75rem 0;
}

.checklist-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

@media (max-width: 992px) {
    .checklist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .checklist-grid {
        grid-template-columns: 1fr;
    }
}

.checklist-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 90px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.checklist-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.checklist-item.ok {
    border-left: 4px solid #10b981;
}

.checklist-item.warning {
    border-left: 4px solid #f59e0b;
}

.checklist-item.danger {
    border-left: 4px solid #ef4444;
}

.roteiro-paper {
    background: #ffffff;
    color: #0f172a;
    padding: 2.25rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.45;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.roteiro-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f766e;
    border-bottom: 2px solid #ccfbf1;
    padding-bottom: 0.3rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.roteiro-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.85rem;
    font-size: 0.85rem;
}

.roteiro-table th, .roteiro-table td {
    border: 1px solid #cbd5e1;
    padding: 0.45rem 0.6rem;
    text-align: left;
}

.roteiro-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #334155;
}

.roteiro-check-box {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 1.5px solid #475569;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
}

.roteiro-signature-line {
    border-top: 1px solid #334155;
    margin-top: 2.5rem;
    padding-top: 0.35rem;
    text-align: center;
    font-size: 0.82rem;
    color: #1e293b;
}

@media print {
    .roteiro-paper {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        font-size: 9.5pt !important;
        line-height: 1.35 !important;
    }
    .roteiro-section-title {
        color: #000000 !important;
        border-bottom-color: #000000 !important;
        font-size: 10pt !important;
        margin-top: 0.9rem !important;
        margin-bottom: 0.4rem !important;
    }
    .roteiro-table th {
        background: #e2e8f0 !important;
        color: #000000 !important;
    }
    .roteiro-table th, .roteiro-table td {
        border-color: #64748b !important;
        padding: 0.35rem 0.45rem !important;
    }
    .roteiro-signature-line {
        margin-top: 2rem !important;
    }
}

/* ==========================================================================
   Impressão Isolada do Roteiro Contábil (Somente a folha técnica oficial A4)
   ========================================================================== */
@media print {
    body.printing-roteiro-active .app-sidebar,
    body.printing-roteiro-active .app-topbar,
    body.printing-roteiro-active .content-header,
    body.printing-roteiro-active .checklist-fiscal-card,
    body.printing-roteiro-active .checklist-progress-container,
    body.printing-roteiro-active .checklist-grid,
    body.printing-roteiro-active #formPerfilEmpresa,
    body.printing-roteiro-active #modalAvalContabil,
    body.printing-roteiro-active .toast-container,
    body.printing-roteiro-active .no-print {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    body.printing-roteiro-active .app-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    body.printing-roteiro-active .app-view-container {
        padding: 0 !important;
    }
    body.printing-roteiro-active #modalRoteiroContabil {
        position: static !important;
        display: block !important;
        background: transparent !important;
        padding: 0 !important;
    }
    body.printing-roteiro-active #modalRoteiroContabil .modal-box {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }
    body.printing-roteiro-active .roteiro-paper {
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        font-size: 7.2pt !important;
        line-height: 1.25 !important;
        color: #000 !important;
    }
    body.printing-roteiro-active .roteiro-section-title {
        font-size: 7.8pt !important;
        margin-top: 0.35rem !important;
        margin-bottom: 0.2rem !important;
        padding-bottom: 0.1rem !important;
        color: #000 !important;
        border-bottom: 1px solid #000 !important;
    }
    body.printing-roteiro-active .roteiro-table {
        font-size: 6.8pt !important;
        margin-bottom: 0.35rem !important;
        border-collapse: collapse !important;
        width: 100% !important;
    }
    body.printing-roteiro-active .roteiro-table th,
    body.printing-roteiro-active .roteiro-table td {
        padding: 0.18rem 0.3rem !important;
        border: 1px solid #475569 !important;
    }
    body.printing-roteiro-active .roteiro-signature-line {
        margin-top: 0.8rem !important;
        font-size: 6.8pt !important;
        border-top: 1px solid #000 !important;
        padding-top: 0.25rem !important;
    }
    @page {
        size: A4 portrait;
        margin: 8mm 10mm;
    }
}

/* ==========================================================================
   Menu Lateral Recolhível (Sidebar Collapse)
   ========================================================================== */
#btnToggleSidebar {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.55rem;
    background: transparent;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}
#btnToggleSidebar:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Faixa de ícones só acima de 900 px: abaixo disso o menu é gaveta (evita as duas regras ao mesmo tempo) */
@media (min-width: 901px) {
    .app-sidebar {
        transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .app-main {
        transition: margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body.sidebar-collapsed .app-sidebar {
        width: 68px;
    }
    body.sidebar-collapsed .app-main {
        margin-left: 68px;
    }

    body.sidebar-collapsed .brand-title,
    body.sidebar-collapsed .brand-tag,
    body.sidebar-collapsed .sidebar-company-card,
    body.sidebar-collapsed .nav-group-label,
    body.sidebar-collapsed .user-profile-info,
    body.sidebar-collapsed .sidebar-nav-item span:not(.sidebar-nav-badge) {
        display: none !important;
    }

    body.sidebar-collapsed .sidebar-header {
        padding: 1rem 0.4rem;
        display: flex;
        justify-content: center;
    }
    body.sidebar-collapsed .brand-wrapper {
        justify-content: center;
    }
    body.sidebar-collapsed .sidebar-nav-item {
        justify-content: center;
        padding: 0.65rem 0;
        margin: 0.2rem 0.4rem;
        position: relative;
        border-left: none;
        border-radius: 8px;
    }
    body.sidebar-collapsed .sidebar-nav-item.active {
        background: var(--sidebar-active);
        box-shadow: inset 0 0 0 1.5px #2dd4bf;
    }
    body.sidebar-collapsed .sidebar-nav-item .icon-svg {
        margin: 0;
        width: 20px;
        height: 20px;
    }
    body.sidebar-collapsed .sidebar-nav-badge {
        position: absolute;
        top: 2px;
        right: 6px;
        font-size: 0.6rem;
        padding: 1px 4px;
    }
    body.sidebar-collapsed .sidebar-footer {
        padding: 0.75rem 0.4rem;
    }
    body.sidebar-collapsed .user-profile-widget {
        justify-content: center;
    }
}

/* ==========================================================================
   Modo Consultório Clínico (Profissional de Saúde / PWA)
   ========================================================================== */
body.modo-consultorio-pwa .nav-item-gestor,
body.modo-consultorio-pwa .nav-group-gestor,
body.modo-consultorio-pwa [data-nav-scope="gestor"],
body.modo-consultorio-pwa .topbar-clinic-only {
    display: none !important;
}

body.modo-consultorio-pwa #navBadgeReceber,
body.modo-consultorio-pwa #navBadgePagar {
    display: none !important;
}

.badge-consultorio {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.btn-toggle-modo {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle-modo:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-toggle-modo.active {
    background: #0f766e;
    color: #ffffff;
    border-color: #0d9488;
}

/* ==========================================================================
   Impressão do Comprovante de Fechamento de Caixa
   ========================================================================== */
@media print {
    body.printing-fechamento-caixa .app-sidebar,
    body.printing-fechamento-caixa .app-topbar,
    body.printing-fechamento-caixa .content-header,
    body.printing-fechamento-caixa .exec-tabs-nav,
    body.printing-fechamento-caixa .kpi-grid,
    body.printing-fechamento-caixa .modal-header,
    body.printing-fechamento-caixa .flex-between.mt-4,
    body.printing-fechamento-caixa .toast-container,
    body.printing-fechamento-caixa .no-print,
    body.printing-fechamento-caixa > :not(.app-layout),
    body.printing-fechamento-caixa .card:not(#modalComprovanteTurno *) {
        display: none !important;
        visibility: hidden !important;
    }
    body.printing-fechamento-caixa .app-main {
        margin: 0 !important;
        padding: 0 !important;
    }
    body.printing-fechamento-caixa .app-view-container {
        padding: 0 !important;
    }
    body.printing-fechamento-caixa #modalComprovanteTurno {
        position: static !important;
        display: block !important;
        background: transparent !important;
        padding: 0 !important;
    }
    body.printing-fechamento-caixa #modalComprovanteTurno .modal-box {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }
    body.printing-fechamento-caixa #cupomFechamentoArea {
        border: 1px dashed #000 !important;
        box-shadow: none !important;
        padding: 10mm !important;
        font-size: 11pt !important;
        color: #000 !important;
        max-width: 140mm;
        margin: 0 auto;
    }
}


/* ==========================================================================
   Menu lateral em gaveta (telas até 900 px)
   ========================================================================== */
@media (max-width: 900px) {
    .app-sidebar {
        transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1200;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1100;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    body.sidebar-gaveta-aberta .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}
@media (min-width: 901px) {
    .sidebar-backdrop { display: none; }
}

/* ==========================================================================
   Menu de ações "⋯" (linhas de tabela)
   ========================================================================== */
.btn-acoes {
    width: 30px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #475569;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    letter-spacing: 1px;
}
.btn-acoes:hover,
.btn-acoes[aria-expanded="true"] {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}
.btn-acoes:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.menu-acoes-pop {
    position: fixed;
    z-index: 3000;
    min-width: 210px;
    max-width: 280px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    padding: 0.3rem;
}
.menu-acoes-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #1e293b;
    font-size: 0.83rem;
    font-family: var(--font-sans);
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}
.menu-acoes-item:hover,
.menu-acoes-item:focus-visible { background: #f1f5f9; outline: none; }
.menu-acoes-item[disabled] { color: #94a3b8; cursor: not-allowed; background: transparent; }
.menu-acoes-item .menu-acoes-ico { width: 1.1rem; text-align: center; flex-shrink: 0; }
.menu-acoes-item.perigo { color: #b91c1c; }
.menu-acoes-item.perigo:hover { background: #fef2f2; }
.menu-acoes-item.destaque { font-weight: 600; color: var(--primary); }
.menu-acoes-sep { height: 1px; background: #e2e8f0; margin: 0.3rem 0.2rem; }

/* ==========================================================================
   Tabela compacta (uma linha por registro, detalhes ao clicar)
   ========================================================================== */
.tabela-compacta td,
.tabela-compacta th { white-space: nowrap; vertical-align: middle; }
.tabela-compacta td { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.tabela-compacta .col-texto {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tabela-compacta .col-texto-curta {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tabela-compacta tr.linha-clicavel { cursor: pointer; }
.tabela-compacta tr.linha-clicavel:hover > td { background: #f8fafc; }
.tabela-compacta tr.linha-aberta > td { background: #f0fdfa; }
.tabela-compacta tr.linha-detalhe > td {
    background: #f8fafc;
    white-space: normal;
    padding: 0.75rem 1rem 0.9rem;
    border-top: none;
}
.tabela-compacta .seta-linha {
    display: inline-block;
    width: 0.9rem;
    color: #94a3b8;
    transition: transform 0.15s ease;
}
.tabela-compacta tr.linha-aberta .seta-linha { transform: rotate(90deg); color: var(--primary); }
.detalhe-grade {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.55rem 1.25rem;
    font-size: 0.8rem;
}
.detalhe-grade .rotulo { display: block; color: #64748b; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; }
.detalhe-grade .valor { color: #0f172a; font-weight: 500; overflow-wrap: anywhere; }
.detalhe-historico { grid-column: 1 / -1; }
.chip-doc {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    color: #334155;
}
.chip-nfse {
    display: inline-block;
    margin-left: 0.3rem;
    padding: 0.05rem 0.4rem;
    border-radius: 6px;
    border: 1px solid #86efac;
    background: #dcfce7;
    color: #166534;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
}
.chip-nfse:hover { background: #bbf7d0; }

/* Rodapé do menu recolhido: o markup usa .user-info-text (a regra antiga mirava .user-profile-info) */
@media (min-width: 901px) {
    body.sidebar-collapsed .user-info-text { display: none !important; }
    body.sidebar-collapsed .user-profile-widget {
        flex-direction: column;
        gap: 0.45rem;
    }
}

/* ==========================================================================
   Faixa de resumo (substitui cards nas telas operacionais) e filtros recolhíveis
   ========================================================================== */
.faixa-resumo {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    margin-bottom: 1rem;
    overflow: hidden;
}
.faixa-item {
    flex: 1 1 160px;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.55rem 0.9rem;
    border: none;
    border-right: 1px solid #eef2f6;
    background: transparent;
    text-align: left;
    font-family: var(--font-sans);
}
.faixa-item:last-child { border-right: none; }
.faixa-clicavel { cursor: pointer; }
.faixa-clicavel:hover { background: #f8fafc; }
.faixa-rotulo { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.faixa-valor { font-size: 1rem; color: #0f172a; white-space: nowrap; }
.faixa-sucesso .faixa-valor { color: #047857; }
.faixa-perigo .faixa-valor { color: #b91c1c; }
.faixa-alerta .faixa-valor { color: #b45309; }
.faixa-info .faixa-valor { color: #0369a1; }

.quick-chip-valor { font-size: 0.72rem; font-weight: 600; opacity: 0.85; margin-left: 0.15rem; }

.btn-filtros-toggle .contador-filtros {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

.tabela-compacta tfoot td {
    background: #f8fafc;
    font-size: 0.8rem;
    color: #334155;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

/* NFS-e: sincronização discreta no cabeçalho da lista */
.sync-inline { display: inline-flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.sync-inline .sync-status { font-size: 0.75rem; color: #64748b; white-space: nowrap; }
.sync-inline .sync-status.erro { color: #b91c1c; font-weight: 600; cursor: help; }

/* ==========================================================================
   Toasts e janelas de diálogo (ui-base.js)
   ========================================================================== */
.toast-area {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(420px, calc(100vw - 2rem));
}
.toast-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.85rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
    animation: toastEntra 0.18s ease-out;
}
.toast-item.saindo { opacity: 0; transform: translateY(6px); transition: all 0.2s ease; }
.toast-ico {
    flex-shrink: 0;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
}
.toast-success .toast-ico { background: #10b981; }
.toast-error .toast-ico { background: #ef4444; }
.toast-warning .toast-ico { background: #f59e0b; }
.toast-info .toast-ico { background: #0ea5e9; }
.toast-texto { flex: 1; line-height: 1.4; }
.toast-fechar { background: none; border: none; color: #94a3b8; font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 0 0.15rem; }
.toast-fechar:hover { color: #fff; }
@keyframes toastEntra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.dialogo-fundo {
    position: fixed;
    inset: 0;
    z-index: 3500;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: toastEntra 0.15s ease-out;
}
.dialogo {
    width: min(460px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    padding: 1.25rem 1.35rem 1rem;
}
.dialogo-titulo { margin: 0 0 0.6rem; font-size: 1.05rem; color: #0f172a; }
.dialogo-texto { display: block; margin: 0 0 0.75rem; color: #334155; font-size: 0.9rem; line-height: 1.5; white-space: normal; }
.dialogo-ajuda { font-size: 0.75rem; color: #64748b; margin-top: 0.35rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.dialogo-erro { font-size: 0.78rem; color: #b91c1c; min-height: 1rem; margin-top: 0.25rem; }
.dialogo-acoes { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.9rem; }
.dialogo-opcoes { display: flex; flex-direction: column; gap: 0.45rem; }
.dialogo-opcao {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: left;
    padding: 0.65rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-family: var(--font-sans);
    color: #0f172a;
}
.dialogo-opcao span { font-size: 0.78rem; color: #64748b; }
.dialogo-opcao:hover, .dialogo-opcao:focus-visible { border-color: var(--primary); background: #f0fdfa; outline: none; }

/* Barra do topo: só o que pede atenção.
   Conexão aparece apenas offline ou sincronizando; o estado normal (online) não ocupa espaço. */
.pwa-net-pill.online { display: none; }
#btnInstallPwa { padding: 0.35rem 0.55rem; font-size: 1rem; line-height: 1; }

/* Botão de ação destrutiva (era usado — ex.: "Fechar Caixa do Turno" — mas nunca tinha sido definido) */
.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #ffffff; }
.btn-danger:focus-visible { outline: 2px solid #fca5a5; outline-offset: 2px; }

/* Grade de indicadores (usada no CRM). A regra original ficava em components.css, que o app.html não carrega. */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}
.stats-grid > .card { margin: 0; }

/* ==========================================================================
   Grupos de acesso & tela Usuários e Acessos
   ========================================================================== */
.nav-sem-acesso { display: none !important; }
.dialogo.dialogo-largo { width: min(680px, 100%); }
.aviso-faixa { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; border-radius: 10px; padding: 0.6rem 0.85rem; font-size: 0.85rem; }
.aviso-faixa.aviso-erro { background: #fef2f2; border-color: #fecaca; color: #991b1b; margin-bottom: 0.75rem; }
.linha-inativa td { color: #94a3b8; }
.campo-compacto { padding: 0.3rem 0.5rem; font-size: 0.85rem; height: auto; }
.chips-modulos { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chip-mod { display: inline-block; font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; white-space: nowrap; }
.chip-mod-total { background: #ecfdf5; color: #047857; border-color: #a7f3d0; font-weight: 600; }
.modulo-total { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.6rem 0.75rem; border: 1px solid #a7f3d0; background: #f0fdf4; border-radius: 10px; margin: 0.25rem 0 0.75rem; font-size: 0.85rem; cursor: pointer; }
.modulo-total input { margin-top: 0.2rem; }
.grade-modulos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.5rem 1rem; transition: opacity .15s; }
.grade-modulos.desativada { opacity: 0.45; pointer-events: none; }
.grade-modulos fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.grade-modulos legend { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; margin-bottom: 0.25rem; }
.modulo-opcao { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.3rem 0.25rem; border-radius: 6px; font-size: 0.86rem; color: #1e293b; cursor: pointer; }
.modulo-opcao:hover { background: #f8fafc; }
.modulo-opcao input { margin-top: 0.2rem; }
.modulo-opcao small { display: block; font-size: 0.72rem; color: #64748b; }

/* Agenda: ações rápidas compactas no cartão da grade semanal */
.agenda-card-quick-actions { margin-top: 0.4rem; }
.agenda-acao-rapida { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; height: 26px; min-width: 26px; padding: 0 0.45rem;
    border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; color: #475569; font-size: 0.72rem; font-weight: 600; cursor: pointer; }
.agenda-acao-rapida:hover { border-color: #94a3b8; color: #0f172a; }
.agenda-acao-rapida.presenca { color: #047857; border-color: #a7f3d0; background: #ecfdf5; flex: 1; }
.agenda-acao-rapida.presenca:hover { background: #d1fae5; }
.agenda-acao-rapida svg { width: 14px; height: 14px; }

/* NFS-e: notas ainda não emitidas (rascunho, rejeitada, aguardando governo) no topo da lista */
.linha-nota-aberta td { background: #fffbeb; }
.linha-nota-aberta:hover td { background: #fef3c7; }

/* Manual: busca e situações da NFS-e */
.manual-trecho mark { background: #fef08a; color: inherit; padding: 0 1px; border-radius: 2px; }
.manual-resultado:hover { border-color: #5eead4; }
.manual-tabela-situacoes { display: grid; gap: 0.45rem; margin: 0.5rem 0 0.75rem; }
.manual-tabela-situacoes > div { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.9rem; color: #334155; }
.manual-tabela-situacoes .badge { flex: none; min-width: 150px; text-align: center; }
@media (max-width: 640px) {
    .topbar-manual-btn span { display: none; }
    .manual-tabela-situacoes > div { flex-direction: column; gap: 0.2rem; }
    .manual-tabela-situacoes .badge { min-width: 0; }
}

/* Topo no celular: botões só com ícone (o nome fica na dica) e cabeçalhos das telas quebram linha */
@media (max-width: 640px) {
    .topbar-right { gap: 0.35rem; min-width: 0; }
    .topbar-right .topbar-clinic-only span { display: none; }
    .topbar-right .btn-sm, .topbar-right .topbar-manual-btn { padding-left: 0.5rem; padding-right: 0.5rem; }
    .topbar-right .btn-toggle-modo { max-width: 2.4rem; overflow: hidden; white-space: nowrap; text-overflow: clip; padding-left: 0.5rem; padding-right: 0.5rem; }
    .content-header .flex-gap, .content-header .quick-actions-row { flex-wrap: wrap; }
    .exec-tabs, .exec-tabs-nav { max-width: 100%; overflow-x: auto; }
    .topbar-left, .module-breadcrumbs { min-width: 0; flex: 1 1 auto; }
    .module-breadcrumbs { font-size: 0.78rem; line-height: 1.2; }
    .module-breadcrumbs > span { display: none; } /* "OrbeClinic /" some no celular; fica só o nome da tela */
}

/* Emissão de NFS-e: janela mais larga em telas grandes; CEP e valor com largura própria */
.modal-box.modal-nfse { max-width: min(1320px, 96vw); width: 96vw; }
.nfse-campo-cep { flex: 0 0 150px; min-width: 150px; }
.nfse-campo-cep input { min-width: 0; }
.nfse-campo-valor { flex: 0 1 260px; }
.nfse-campo-nasc { flex: 0 0 150px; }

/* Cadastro de paciente em duas colunas (cabe sem rolagem em notebook) */
.modal-box.modal-paciente { max-width: min(1240px, 96vw); width: 96vw; }
.pac-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; align-items: start; }
.pac-col { min-width: 0; }
.pac-campo-cep { flex: 0 0 160px; min-width: 160px; }
@media (max-width: 900px) { .pac-modal-grid { grid-template-columns: 1fr; } }

/* Frente de Caixa: receber título em aberto */
.titulos-receber-lista { max-height: 46vh; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 10px; }
.titulo-receber { display: grid; grid-template-columns: auto 1fr auto auto; gap: 0.75rem; align-items: center; padding: 0.55rem 0.75rem; border-bottom: 1px solid #f1f5f9; cursor: pointer; font-size: 0.88rem; }
.titulo-receber:hover { background: #f8fafc; }
.titulo-receber:has(input:checked) { background: #ecfdf5; }
.titulo-receber-info { display: flex; flex-direction: column; min-width: 0; }
.titulo-receber-info small { color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titulo-receber-venc { font-size: 0.75rem; color: #475569; white-space: nowrap; }
.titulo-receber-venc.vencido { color: #b91c1c; font-weight: 600; }
.titulo-receber-valor { white-space: nowrap; }

/* ==========================================================================
   Prontuário por especialidade (modelos de área, anotações privadas)
   ========================================================================== */
.pep-seletor-area { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.8rem; color: var(--text-muted, #64748b); }
.pep-seletor-area select { min-width: 190px; font-weight: 600; }
.pep-campos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1rem; }
.pep-campos-grid .pep-campo-largo { grid-column: 1 / -1; }
.pep-subtitulo { margin: 1rem 0 0.5rem; font-size: 0.95rem; color: var(--primary, #0f766e); border-bottom: 1px solid var(--border-color, #e2e8f0); padding-bottom: 0.3rem; }
.pep-campos-leitura { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem 1rem; margin: 0.4rem 0 0; }
.pep-campos-leitura > div { background: #f8fafc; border-radius: 8px; padding: 0.5rem 0.7rem; min-width: 0; }
.pep-campos-leitura .pep-campo-largo { grid-column: 1 / -1; }
.pep-campos-leitura dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b; font-weight: 600; }
.pep-campos-leitura dd { margin: 0.15rem 0 0; font-size: 0.88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.pep-nota-privada { margin-top: 0.6rem; border: 1px dashed #a78bfa; background: #faf5ff; border-radius: 8px; padding: 0.55rem 0.75rem; }
.pep-nota-privada-topo { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.75rem; font-weight: 700; color: #6d28d9; margin-bottom: 0.3rem; }
.pep-nota-privada-form label { color: #6d28d9; }
.pep-nota-privada-form textarea { border-color: #c4b5fd; background: #faf5ff; }
@media (max-width: 640px) {
    .pep-seletor-area { width: 100%; }
    .pep-seletor-area select { flex: 1; min-width: 0; }
}

/* ==========================================================================
   Ícones de botões (gerado por emoji_para_icone.py) — <i class=ico-NOME></i>
   Traço Lucide, herda a cor do texto do botão (currentColor)
   ========================================================================== */
[class^="ico-"], [class*=" ico-"] { display:inline-block; width:1.05em; height:1.05em; flex:none;
    vertical-align:-0.15em; background-color:currentColor; -webkit-mask:var(--ico) center/contain no-repeat;
    mask:var(--ico) center/contain no-repeat; }
.ico-arrow-left-right { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='17 11 21 7 17 3'/%3E%3Cline x1='21' y1='7' x2='9' y2='7'/%3E%3Cpolyline points='7 21 3 17 7 13'/%3E%3Cline x1='15' y1='17' x2='3' y2='17'/%3E%3C/svg%3E"); }
.ico-arrow-right { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3Cpolyline points='12 5 19 12 12 19'%3E%3C/polyline%3E%3C/svg%3E"); }
.ico-ban { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m4.9 4.9 14.2 14.2'/%3E%3C/svg%3E"); }
.ico-banknote { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='12' x='2' y='6' rx='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Cpath d='M6 12h.01M18 12h.01'/%3E%3C/svg%3E"); }
.ico-bell { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E"); }
.ico-briefcase { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='14' x='2' y='7' rx='2' ry='2'/%3E%3Cpath d='M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16'/%3E%3C/svg%3E"); }
.ico-calendar { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); }
.ico-cart { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12'/%3E%3C/svg%3E"); }
.ico-check { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); }
.ico-check-circle { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E"); }
.ico-code { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E"); }
.ico-copy { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E"); }
.ico-credit-card { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='4' width='22' height='16' rx='2' ry='2'/%3E%3Cline x1='1' y1='10' x2='23' y2='10'/%3E%3C/svg%3E"); }
.ico-edit { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'%3E%3C/path%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'%3E%3C/path%3E%3C/svg%3E"); }
.ico-eye { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.ico-file-text { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3Cpath d='M10 9H8'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3C/svg%3E"); }
.ico-flask { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2v7.31'/%3E%3Cpath d='M14 9.3V1.99'/%3E%3Cpath d='M8.5 2h7'/%3E%3Cpath d='M14 9.3a6.5 6.5 0 1 1-4 0'/%3E%3Cpath d='M5.52 16h12.96'/%3E%3C/svg%3E"); }
.ico-heart-pulse { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3Cpath d='M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27'/%3E%3C/svg%3E"); }
.ico-history { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E"); }
.ico-kanban { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 5v11'/%3E%3Cpath d='M12 5v6'/%3E%3Cpath d='M18 5v14'/%3E%3C/svg%3E"); }
.ico-landmark { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='22' x2='21' y2='22'/%3E%3Cline x1='6' y1='18' x2='6' y2='11'/%3E%3Cline x1='10' y1='18' x2='10' y2='11'/%3E%3Cline x1='14' y1='18' x2='14' y2='11'/%3E%3Cline x1='18' y1='18' x2='18' y2='11'/%3E%3Cpolygon points='12 2 20 7 4 7'/%3E%3C/svg%3E"); }
.ico-link { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E"); }
.ico-lock { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.ico-mail { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E"); }
.ico-message-square { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.ico-package { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7.5 4.27 9 5.15'/%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E"); }
.ico-paperclip { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E"); }
.ico-pen { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z'/%3E%3C/svg%3E"); }
.ico-plus { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E"); }
.ico-printer { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 6 2 18 2 18 9'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect width='12' height='8' x='6' y='14'/%3E%3C/svg%3E"); }
.ico-receipt { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z'/%3E%3Cpath d='M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8'/%3E%3Cpath d='M12 17.5v-11'/%3E%3C/svg%3E"); }
.ico-refresh-cw { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M3 21v-5h5'/%3E%3C/svg%3E"); }
.ico-rotate-ccw { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 4 1 10 7 10'/%3E%3Cpath d='M3.51 15a9 9 0 1 0 2.13-9.36L1 10'/%3E%3C/svg%3E"); }
.ico-save { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z'/%3E%3Cpolyline points='17 21 17 13 7 13 7 21'/%3E%3Cpolyline points='7 3 7 8 15 8'/%3E%3C/svg%3E"); }
.ico-search { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); }
.ico-send { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E"); }
.ico-sliders { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' x2='4' y1='21' y2='14'/%3E%3Cline x1='4' x2='4' y1='10' y2='3'/%3E%3Cline x1='12' x2='12' y1='21' y2='12'/%3E%3Cline x1='12' x2='12' y1='8' y2='3'/%3E%3Cline x1='20' x2='20' y1='21' y2='16'/%3E%3Cline x1='20' x2='20' y1='12' y2='3'/%3E%3Cline x1='2' x2='6' y1='14' y2='14'/%3E%3Cline x1='10' x2='14' y1='8' y2='8'/%3E%3Cline x1='18' x2='22' y1='16' y2='16'/%3E%3C/svg%3E"); }
.ico-smartphone { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='20' x='5' y='2' rx='2' ry='2'/%3E%3Cpath d='M12 18h.01'/%3E%3C/svg%3E"); }
.ico-stethoscope { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.8 2.3A.3.3 0 1 0 5 2H4a2 2 0 0 0-2 2v5a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6V4a2 2 0 0 0-2-2h-1a.2.2 0 1 0 .3.3'/%3E%3Cpath d='M8 15v1a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6v-4'/%3E%3Ccircle cx='20' cy='10' r='2'/%3E%3C/svg%3E"); }
.ico-target { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E"); }
.ico-trash { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'%3E%3C/polyline%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3C/svg%3E"); }
.ico-unlock { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 9.9-1'/%3E%3C/svg%3E"); }
.ico-upload { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' x2='12' y1='3' y2='15'/%3E%3C/svg%3E"); }
.ico-x { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); }
.ico-x-circle { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E"); }
.ico-zap { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E"); }
.ico-book { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
.ico-help-circle { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E"); }

/* ==============================================================================
   OrbeClinic — Manual Oficial & Central de Ajuda
   ============================================================================== */
.manual-page-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

.manual-layout-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 991px) {
    .manual-layout-grid {
        grid-template-columns: 1fr;
    }
}

.manual-sidebar-nav {
    position: sticky;
    top: 75px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
}

.manual-sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.manual-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.manual-nav-btn {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.manual-nav-btn:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.manual-nav-btn.active {
    background: #f0fdfa;
    border-color: #99f6e4;
}

.manual-nav-ico {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.manual-nav-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.25;
}

.manual-nav-btn.active .manual-nav-name {
    color: #0f766e;
    font-weight: 700;
}

.manual-nav-sub {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.2rem;
    line-height: 1.3;
}

.manual-content-body {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-card);
    min-height: 600px;
}

.manual-article-header {
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 1.25rem;
    margin-bottom: 2rem;
}

.manual-article-header h2 {
    font-size: 1.6rem;
    color: #0f172a;
    margin: 0.5rem 0 0.5rem 0;
    font-weight: 700;
}

.manual-article-header .lead {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.manual-section {
    margin-bottom: 2.5rem;
}

.manual-section h3 {
    font-size: 1.15rem;
    color: #0f172a;
    margin-bottom: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.manual-section p {
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.manual-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.manual-step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
}

.manual-step-item .step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #0f766e;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 1px;
}

.manual-step-item .step-content {
    font-size: 0.85rem;
    color: #1e293b;
    line-height: 1.5;
}

.manual-callout {
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    font-size: 0.83rem;
    line-height: 1.55;
    margin: 1.25rem 0;
}

.manual-callout.callout-tip {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    color: #115e59;
}

.manual-callout.callout-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.manual-bullet-list {
    margin: 0.5rem 0 1rem 1.25rem;
    padding: 0;
    font-size: 0.86rem;
    color: #334155;
    line-height: 1.6;
}

.manual-bullet-list li {
    margin-bottom: 0.4rem;
}

.manual-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .manual-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Impressão do Manual (Modo Cartilha PDF) */
@media print {
    .app-sidebar, .app-topbar, .no-print, .manual-sidebar-nav {
        display: none !important;
    }
    .app-layout {
        display: block !important;
    }
    .app-main {
        margin: 0 !important;
        padding: 0 !important;
    }
    .manual-layout-grid {
        display: block !important;
    }
    .manual-content-body {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .manual-page-wrapper {
        max-width: 100% !important;
    }
}
