:root {
    --bg-main: #F4F6F9;
    --primary-brand: #E53935;
    --primary-gradient: linear-gradient(135deg, #EF5350 0%, #C62828 100%);
    --ios-gray: #E0E0E0;
    --text-dark: #2C3E50;
    --text-gray: #607D8B;
    --white: #FFFFFF;
    --dark-menu-bg: #1E293B;
    --dark-menu-text: #CBD5E1;
    --dark-menu-hover: #334155;
    --radius-card: 16px;
    --radius-input: 8px;
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.05);
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;

    /* Paleta semântica — usada pelos variantes .btn-sm.btn-*,
       pelas badges de status e pelos ícones de ação. Centralizar aqui
       evita que cada módulo reinvente a cor. */
    --color-danger:   #dc2626;
    --color-success:  #22c55e;
    --color-info:     #0ea5e9;
    --color-warning:  #f97316;
    --color-dark:     #1e293b;
    --color-neutral:  #94a3b8;
    --color-purple:   #8b5cf6;
    --color-blue:     #3b82f6;

    /* Design tokens — tipografia, raio, sombra e superfície */
    --text-xs:      11px;   /* badges, timestamps */
    --text-sm:      13px;   /* labels, corpo padrão */
    --text-base:    15px;   /* títulos de seção */
    --radius-sm:     6px;   /* badges, botões, inputs */
    --radius-md:    10px;   /* cards, modais */
    --shadow-card:  0 1px 4px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.10);
    --border:       #e2e8f0;
    --border-light: #f1f5f9;
    --bg-page:      #f4f6f9;
    --bg-card:      #ffffff;
    --bg-subtle:    #f8fafc;
    --text-body:    #475569;
    --text-muted:   #94a3b8;
    --text-light:   #cbd5e1;
}

/* ────────────────────────────────────────────────────────────
   BOTÕES SEMÂNTICOS — padrão compartilhado por todos os módulos.
   Usar SEMPRE em vez de estilos inline.

   Tamanhos:
     .btn-lg  → botão hero (hub, CTA principal)
     .btn-sm  → botão de ação em linha/card
     .btn-icon → botão só de ícone dentro de tabela/linha

   Cores (combinar com .btn-sm ou .btn-lg):
     .btn-primary   → vermelho da marca
     .btn-danger    → vermelho destrutivo
     .btn-success   → verde
     .btn-info      → azul claro
     .btn-warning   → laranja
     .btn-dark      → navy (imprimir/cancelar forte)
     .btn-neutral   → cinza
     .btn-purple    → roxo
     .btn-blue      → azul (edição)
   ──────────────────────────────────────────────────────────── */
.btn-lg, .btn-sm {
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: filter .2s, transform .1s;
    white-space: nowrap;
    font-family: inherit;
}
.btn-lg {
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 15px;
    min-width: 200px;
}
.btn-sm {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
}
.btn-lg i, .btn-sm i { font-size: 16px; }
.btn-lg:hover, .btn-sm:hover { filter: brightness(1.06); }
.btn-lg:active, .btn-sm:active { transform: scale(0.98); }
.btn-lg:disabled, .btn-sm:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--primary-brand); }
.btn-danger  { background: var(--color-danger); }
.btn-success { background: var(--color-success); }
.btn-info    { background: var(--color-info); }
.btn-warning { background: var(--color-warning); }
.btn-dark    { background: var(--color-dark); }
.btn-neutral { background: var(--color-neutral); }
.btn-purple  { background: var(--color-purple); }
.btn-blue    { background: var(--color-blue); }

/* Botão de ação em linha de tabela (ícone só). Complementa as classes
   .action-edit / .action-delete já existentes, garantindo padding e
   alinhamento consistentes. */
.btn-icon-row {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.btn-icon-row:hover { background: rgba(0,0,0,0.05); }

/* Botão de registrar presença do Portal do Parceiro. Mantém o visual
   verde do card de "Pendente Agora" mas usando a classe semântica. */
.btn-portal-registrar {
    background: var(--color-success);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.20);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.btn-portal-registrar:hover { filter: brightness(1.05); }
.btn-portal-registrar i { font-size: 18px; }

/* Botão médio — ações principais na tela de detalhe (Concluir, Finalizar, etc.) */
.btn-md, .btn-lg, .btn-sm, .btn-md {
    font-family: inherit;
}
.btn-md {
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: filter .2s, transform .1s;
    white-space: nowrap;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
}
.btn-md i { font-size: 16px; }
.btn-md:hover { filter: brightness(1.06); }
.btn-md:active { transform: scale(0.98); }
.btn-md:disabled { opacity: .55; cursor: not-allowed; }

/* Botões ghost (outline) — barras de ação compactas nas listas.
   Usar: class="btn-ghost btn-ghost-success" etc. */
.btn-ghost {
    background: transparent;
    border: 1px solid;
    border-radius: var(--radius-sm, 6px);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.btn-ghost i { font-size: 16px; }
.btn-ghost:disabled { opacity: .55; cursor: not-allowed; }

.btn-ghost-info    { color: #2563eb; border-color: #bfdbfe; }
.btn-ghost-info:hover    { background: #eff6ff; border-color: #2563eb; }

.btn-ghost-warning { color: #b45309; border-color: #fde68a; }
.btn-ghost-warning:hover { background: #fffbeb; border-color: #d97706; }

.btn-ghost-success { color: #16a34a; border-color: #bbf7d0; }
.btn-ghost-success:hover { background: #f0fdf4; border-color: #16a34a; }

.btn-ghost-danger  { color: #ef4444; border-color: #fecaca; }
.btn-ghost-danger:hover  { background: #fef2f2; border-color: #ef4444; }

.btn-ghost-dark    { color: #1e293b; border-color: #cbd5e1; }
.btn-ghost-dark:hover    { background: #f1f5f9; border-color: #1e293b; }

/* Tamanhos de ícone padronizados — usar em vez de font-size inline. */
.icon-xs { font-size: 14px !important; }
.icon-sm { font-size: 16px !important; }
.icon-md { font-size: 18px !important; }
.icon-lg { font-size: 20px !important; }
.icon-xl { font-size: 28px !important; }
.icon-2xl{ font-size: 40px !important; }

* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    padding-bottom: 120px;
    transition: background-color 0.3s ease;
}

body.logged-out {
    background-color: #000000 !important;
    padding: 20px !important;
    align-items: center;
}
body.logged-out .bottom-nav, body.logged-out .header { display: none !important; }

#login-screen.active {
    display: flex; flex-direction: column; flex-shrink: 0; justify-content: center; align-items: center; width: 100%; min-height: 80vh;
}

/* ── Login Card com Abas ── */
.login-card {
    border-radius: var(--radius-card) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10) !important;
}

.login-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.login-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 0;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.login-tab i {
    font-size: 17px;
}

.login-tab:hover {
    color: #475569;
    background: #f1f5f9;
}

.login-tab.active {
    color: var(--primary-brand);
    background: #fff;
}

.login-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-brand);
    border-radius: 2px 2px 0 0;
}

.login-tab-content {
    display: none;
}

.login-tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

.app-container { width: 100%; max-width: 700px; position: relative; }
.screen { display: none; animation: fadeIn 0.4s ease-out; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Rodapé Institucional Fixo */
.dashboard-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1E293B;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 20px;
    z-index: 90;
    border-radius: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}
.dashboard-footer img { flex-shrink: 0; }
body.logged-out .dashboard-footer { display: none !important; }

.header { text-align: center; background-color: var(--dark-menu-bg); margin: -20px -20px 25px -20px; padding: 30px 20px 20px 20px; border-bottom-left-radius: 24px; border-bottom-right-radius: 24px; }
.logo-container { display: block; flex-shrink: 0; align-items: center; justify-content: center; }
.logo-img { max-height: 120px; max-width: 250px; object-fit: contain; }
.user-greeting { color: var(--dark-menu-text); font-size: 15px; font-weight: 700; margin-top: 8px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text-dark); margin-bottom: 20px; }

.card { background: var(--white); border-radius: var(--radius-card); padding: 18px; box-shadow: var(--shadow-soft); margin-bottom: 15px; border: none; max-width: 900px; margin-left: auto; margin-right: auto; width: 100%; }
.card-title { font-size: 15px; font-weight: 700; color: var(--primary-brand); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.btn-main {
    background: var(--primary-brand);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    width: fit-content;
    min-width: 160px;
    margin: 10px auto;
}

.badge-retroativa {
    background: #7c3aed;
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 4px;
}

.deadline-highlight {
    font-size: 10px;
    color: #7c3aed;
    font-weight: 700;
    display: block;
    margin-top: 2px;
}

.row-retroativa {
    border-left: 4px solid #7c3aed !important;
}

.badge-assinatura-liberada {
    background: #0ea5e9;
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 4px;
}

.signature-deadline-highlight {
    font-size: 10px;
    color: #0ea5e9;
    font-weight: 700;
    display: block;
    margin-top: 2px;
}

.btn-main:active { transform: scale(0.98); }
.btn-main i { font-size: 18px; }
.btn-add { width: auto; min-width: auto; padding: 10px 22px; border-radius: 50px; margin: 0; }
.btn-secondary { background: var(--ios-gray); color: var(--text-dark); }
.btn-voltar { background: #E2E8F0; color: #334155; border: none; padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 15px; transition: 0.2s; }
.btn-voltar:hover { background: #CBD5E1; }

.row { display: flex; gap: 10px; margin-bottom: 8px; }
.col { flex: 1; }
.col-20 { width: 20%; }
.form-group { margin-bottom: 8px; } 
label { display: block; font-size: 12px; font-weight: 700; color: var(--text-gray); margin-bottom: 3px; padding-left: 2px; }

input, select, textarea { width: 100%; background-color: var(--ios-gray); border: none; border-radius: var(--radius-input); padding: 10px 12px; font-size: 14px; color: var(--text-dark); outline: none; }
input[type="file"] { background: transparent; padding: 5px; font-size: 12px; }
input:focus, select:focus, textarea:focus { background: white; box-shadow: 0 0 0 2px var(--primary-brand); }

.search-bar { display: flex; align-items: center; background: white; border-radius: 12px; padding: 5px 15px; box-shadow: var(--shadow-soft); margin-bottom: 15px; border: 1px solid #eee; max-width: 900px; margin-left: auto; margin-right: auto; width: 100%; }
.search-bar i { font-size: 20px; color: var(--text-gray); }
.search-bar input { background: transparent; padding: 10px; flex: 1; margin: 0; box-shadow: none !important; border:none; outline:none; }

.badge { font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 700; display: inline-block; margin-top: 4px; }
.badge.ativo { background: #E8F5E9; color: #2E7D32; }
.badge.desligado { background: #FFEBEE; color: #C62828; }
.badge.flutuante { background: #FFF3E0; color: #EF6C00; }
.badge.finalizado { background: #E0E0E0; color: #616161; }

.bottom-nav { position: fixed; bottom: 15px; left: 50%; transform: translateX(-50%); background: rgba(30, 41, 59, 0.98); backdrop-filter: blur(10px); padding: 6px 10px; border-radius: 50px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); display: flex; gap: 8px; z-index: 100; width: 95%; max-width: 600px; align-items: center; overflow-x: auto; white-space: nowrap; }
.bottom-nav::-webkit-scrollbar { display: none; }
.nav-item { color: var(--dark-menu-text); cursor: pointer; transition: all 0.3s; display: block; flex-shrink: 0; align-items: center; font-weight: 700; flex: 0 0 auto; min-width: 55px; padding: 2px; }
.nav-item i { font-size: 28px; margin-bottom: 0px; } 
.nav-item .nav-text { font-size: 11px; text-align: center; }
.nav-item.active { color: #FFFFFF; }
.nav-item.active::after { content: ''; width: 4px; height: 4px; background: var(--primary-brand); border-radius: 50%; margin-top: 2px; }

.list-actions { display: flex; gap: 12px; align-items: center; }
.action-btn { background: none; border: none; cursor: pointer; font-size: 22px; transition: transform 0.2s; display: inline-flex; align-items: center; justify-content: center; outline: none; }
.action-btn:hover { transform: scale(1.15); }
.action-view { color: #0EA5E9; }
.action-edit { color: #F59E0B; }
.action-print { color: #8B5CF6; }
.action-delete { color: #EF4444; }
.action-approve { color: #22C55E; }

.tab-container { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; white-space: nowrap; }
.tab-container::-webkit-scrollbar { display: none; }
.tab-btn { flex: 1; padding: 12px; border-radius: 12px; border: none; font-weight: 700; cursor: pointer; transition: 0.3s; background: var(--ios-gray); color: var(--text-gray); display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 100px; }
.tab-btn i { font-size: 18px; }
.tab-btn.active { background: var(--primary-brand); color: white; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash-grid .card { max-width: 100%; margin-left: 0; margin-right: 0; }

.config-grid { display: flex; flex-direction: row; gap: 15px; overflow-x: auto; padding-bottom: 15px; }
.config-grid::-webkit-scrollbar { height: 6px; }
.config-grid::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
.config-card { flex: 0 0 auto; width: 120px; height: 120px; background: var(--white); border-radius: var(--radius-card); padding: 10px; box-shadow: var(--shadow-soft); display: block; flex-shrink: 0; align-items: center; justify-content: center; text-align: center; cursor: pointer; transition: 0.2s; }
.config-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }

/* Dashboard Quick Access - Grid de Colunas Categorizadas */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: start;
    gap: 24px;
}
.shortcut-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.shortcut-column-title {
    font-size: 13px;
    font-weight: 800;
    color: #334155;
    padding: 8px 12px;
    border-left: 3px solid #94A3B8;
    border-radius: 0 6px 6px 0;
    background: rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}
.shortcut-column-title i { font-size: 16px; }

.dash-shortcut {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}
.dash-shortcut::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}
.dash-shortcut:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    background: #FAFBFC;
}
.dash-shortcut:hover::before { opacity: 1; }
.dash-shortcut:active { transform: scale(0.97); }
.dash-shortcut i { font-size: 20px; flex-shrink: 0; }
.dash-shortcut span { font-size: 13px; font-weight: 600; color: var(--text-dark); text-align: left; }

/* Mobile Menu Toggle Button (Hamburger) */
.mobile-menu-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--dark-menu-bg);
    color: #94A3B8;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}
.mobile-menu-toggle:active { transform: scale(0.92); }
.mobile-menu-toggle.menu-open { color: white; background: var(--primary-brand); }

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 768px) {
    body { padding-left: calc(var(--sidebar-width) + 40px); padding-top: 40px; padding-bottom: 30px; transition: padding-left 0.3s ease; }
    body.sidebar-collapsed { padding-left: calc(var(--sidebar-collapsed-width) + 40px); }
    body.logged-out { padding: 20px !important; }
    body.logged-out .dynamic-header { display: none; }

    .dynamic-header {
        position: sticky;
        top: -40px;
        left: 0;
        right: 0;
        background: var(--bg-main);
        z-index: 100;
        padding: 15px 0;
        margin-bottom: 20px;
        border-bottom: 1px solid var(--ios-gray);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .dynamic-header h1 {
        font-size: 24px;
        color: var(--text-dark);
        margin: 0;
        font-weight: 800;
        letter-spacing: -0.5px;
    }

    .bottom-nav { 
        flex-direction: column; 
        top: 0; 
        left: 0; 
        bottom: 0; 
        width: var(--sidebar-width); 
        transform: none; 
        border-radius: 0; 
        padding: 0; 
        align-items: stretch; 
        background: var(--dark-menu-bg); 
        justify-content: flex-start; 
        gap: 0;
        overflow-y: auto; 
        overflow-x: hidden;
        transition: width 0.3s ease;
    }

    .bottom-nav.collapsed { width: var(--sidebar-collapsed-width); }
    
    .sidebar-logo { 
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        padding: 15px 15px 4px 15px; 
        border-bottom: 1px solid rgba(255,255,255,0.05); 
        margin-bottom: 2px;
        transition: padding 0.3s ease;
    }
    .bottom-nav.collapsed .sidebar-logo { padding: 15px 10px; }
    .sidebar-logo img { max-width: 100%; max-height: 120px; transition: transform 0.3s ease; }
    .bottom-nav.collapsed .sidebar-logo img { transform: scale(0.6); }
    .bottom-nav.collapsed .user-greeting { display: none; }

    .nav-item { 
        flex-direction: row; 
        font-size: 14px; 
        padding: 5px 15px; 
        margin: 0px 8px; 
        border-radius: 8px; 
        gap: 10px; 
        align-items: center;
        width: calc(100% - 16px);
        transition: padding 0.3s ease, margin 0.3s ease;
    }
    .bottom-nav.collapsed .nav-item { padding: 8px; justify-content: center; }
    .nav-item .nav-text { font-size: 14px; transition: opacity 0.2s ease; }
    .bottom-nav.collapsed .nav-item .nav-text { display: none; }
    
    .nav-item i { font-size: 22px; }
    .nav-item:hover { background: var(--dark-menu-hover); }
    .nav-item.active { background: var(--primary-brand); }
    .nav-item.active::after { display: none; }
    .mobile-only { display: none; }
    .page-title { display: none; }
    .spacer { flex-grow: 1; }
    .config-grid { flex-wrap: wrap; justify-content: flex-start; }
    
    .app-container { max-width: 900px; transition: max-width 0.3s ease; }
    body.sidebar-collapsed .app-container { max-width: 1100px; }
    .dash-grid { grid-template-columns: 1fr 1fr 1fr; }

    /* Botão Toggle Desktop - SVG Hamburger Circle */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: transparent;
        color: #94A3B8;
        border-radius: 50%;
        position: absolute;
        top: 12px;
        right: 10px;
        cursor: pointer;
        z-index: 101;
        border: none;
        transition: all 0.3s ease;
    }
    .menu-toggle:hover { color: white; }
    .menu-toggle i { transition: transform 0.3s ease; font-size: 24px; color: #94A3B8; }
    .bottom-nav.collapsed .menu-toggle { right: 50%; transform: translateX(50%); }
    .bottom-nav.collapsed .menu-toggle i { transform: rotate(180deg); color: white; }

    /* Ocultar botão hamburger no desktop */
    .mobile-menu-toggle { display: none !important; }

    /* Rodapé fixo - respeitar sidebar */
    .dashboard-footer {
        left: var(--sidebar-width);
        transition: left 0.3s ease;
    }
    body.sidebar-collapsed .dashboard-footer {
        left: var(--sidebar-collapsed-width);
    }
}

/* Mobile: sidebar como overlay lateral */
@media (max-width: 767px) {
    .mobile-menu-toggle { display: flex; }
    
    .bottom-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        flex-direction: column;
        border-radius: 0;
        padding: 0;
        align-items: stretch;
        background: var(--dark-menu-bg);
        justify-content: flex-start;
        gap: 0;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 110;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        max-width: none;
        box-shadow: none;
    }
    
    .bottom-nav.mobile-open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0,0,0,0.3);
    }
    
    .bottom-nav.mobile-open .sidebar-logo { display: flex; flex-direction: column; align-items: center; padding: 15px 15px 4px 15px; border-bottom: 1px solid rgba(255,255,255,0.05); margin-bottom: 2px; }
    .bottom-nav.mobile-open .sidebar-logo img { max-width: 100%; max-height: 100px; }
    
    .bottom-nav.mobile-open .nav-item {
        flex-direction: row;
        font-size: 14px;
        padding: 6px 15px;
        margin: 0px 8px;
        border-radius: 8px;
        gap: 10px;
        align-items: center;
        width: calc(100% - 16px);
    }
    .bottom-nav.mobile-open .nav-item .nav-text { font-size: 14px; display: inline; }
    .bottom-nav.mobile-open .nav-item i { font-size: 22px; }
    .bottom-nav.mobile-open .spacer { flex-grow: 1; }

    /* Ocultar botão toggle desktop no mobile */
    .menu-toggle { display: none !important; }

    body { padding-bottom: 30px; }
    body.logged-out .mobile-menu-toggle { display: none !important; }
}

/* Padronização do Botão Voltar */
.btn-voltar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ios-gray);
    color: var(--text-dark);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: fit-content;
    margin-bottom: 15px;
}

.btn-voltar:hover {
    background: #d0d0d0;
    transform: translateX(-3px);
}

.btn-voltar i {
    font-size: 18px;
}

/* Ajustes de Botões - Garantir que não estiquem */
.btn-main {
    width: fit-content;
    min-width: 160px;
    margin: 10px auto;
}
@media (max-width: 600px) {
    .btn-main { width: 100%; max-width: 300px; }
}

/* Telas Grandes (Desktop High-Density) */
@media (min-width: 1200px) {
    .app-container { max-width: 1200px; }
    .dash-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
    
    /* Layout de Tabela para Desktop em Folhas e Notas */
    .desktop-table-header { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 10px; padding: 10px 15px; background: #e2e8f0; border-radius: 8px; font-weight: bold; font-size: 13px; color: #475569; margin-bottom: 10px; }
    .desktop-table-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 10px; align-items: center; }
}

.log-item { font-size: 12px; padding: 8px 0; border-bottom: 1px solid #eee; color: #444; }
.log-item strong { color: var(--primary-brand); }

/* Dropdown Submenu Config */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    margin: 0 10px;
    display: block;
    flex-shrink: 0;
}

/* Mobile styles for submenu - dentro do sidebar lateral */
@media (max-width: 767px) {
    .submenu {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        max-width: none;
        background: rgba(0, 0, 0, 0.15);
        box-shadow: none;
        z-index: auto;
        border: none;
        margin: 0 10px;
    }
}

.submenu.open {
    max-height: 200px; /* Suficiente para as opções */
    margin-bottom: 5px;
}

.submenu-item {
    color: var(--dark-menu-text);
    padding: 6px 15px 6px 45px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.submenu-item:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

.submenu-item.active {
    background: #FFFFFF !important;
    color: var(--primary-brand) !important;
    font-weight: 800;
    border-radius: 6px;
    margin: 2px 10px;
}

.dropdown-icon {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-item.submenu-active {
    background: var(--primary-brand) !important;
    color: white !important;
}

.nav-item.submenu-active .dropdown-icon {
    transform: rotate(180deg);
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.desktop-only { display: none; }
@media (min-width: 768px) { .desktop-only { display: block; } .dynamic-header.desktop-only { display: flex; } }
.rich-editor { min-height: 80px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: var(--ios-card); font-size: 14px; line-height: 1.6; outline: none; transition: border-color 0.2s; }
.rich-editor:focus { border-color: var(--primary-brand); box-shadow: 0 0 0 3px rgba(25,118,210,0.1); }
.rich-editor-lg { min-height: 160px; }
.rich-editor:empty::before { content: attr(data-placeholder); color: #94a3b8; pointer-events: none; }

/* Form Actions Padronizados */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}
.form-actions .btn-action {
    flex: none;
    min-width: 150px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.form-actions .btn-action:active { transform: scale(0.98); }
.form-actions .btn-cancel {
    background: #EF4444;
}
.form-actions .btn-cancel:hover {
    background: #DC2626;
}
.form-actions .btn-save {
    background: #10B981;
}
.form-actions .btn-save:hover {
    background: #059669;
}
/* Action Cards & Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.action-card {
    background: white;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.action-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}
.action-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}
.action-card:hover::before {
    opacity: 1;
}
.action-card i {
    font-size: 40px;
    margin-bottom: 5px;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.action-card.secondary i {
    background: linear-gradient(135deg, #42A5F5 0%, #1976D2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.action-card.secondary::before {
    background: linear-gradient(135deg, #42A5F5 0%, #1976D2 100%);
}
.action-card h4 {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}
.action-card p {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.5;
    margin: 0;
}

/* --- PORTAL DO PARCEIRO PREMIUM --- */
.portal-parceiro-layout {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw !important;
    height: 100vh !important;
    background: #f0f2f5 !important;
    z-index: 9999;
    overflow-y: auto;
    overflow-x: hidden;
    flex-direction: column;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}
/* Quando ativo: flex; quando inativo: hidden (respeita .screen toggle) */
.portal-parceiro-layout.active {
    display: flex !important;
}
.portal-parceiro-layout:not(.active) {
    display: none !important;
}
.portal-header {
    background: #111111;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}
.portal-header-logo {
    height: 100px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
}
.portal-btn-sair {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 28px;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: background 0.2s;
}
.portal-btn-sair:hover { background: rgba(220,38,38,0.1); }
.portal-body {
    padding: 20px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
    flex: 1;
}
.portal-card-saudacao {
    background: #f1f5f9;
    border-radius: var(--radius-card, 16px);
    padding: 24px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    text-align: center;
    border: 1px solid #e2e8f0;
}
.portal-titulo {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 900;
    color: #7f1d1d;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.portal-nome {
    margin: 0;
    font-size: 15px;
    color: #334155;
    font-weight: 400;
}
.portal-nome strong {
    font-size: 18px;
    color: #1e293b;
    display: block;
    margin-top: 2px;
}
/* Card Resumo de Plantões (aplicado via JS) */
.portal-card-resumo {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%) !important;
    border-radius: var(--radius-card, 16px);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(15,23,42,0.25);
    color: #fff;
}
.portal-card-resumo h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.portal-card-resumo h3 i { color: #4ade80; margin-right: 6px; }
.portal-card-resumo .resumo-linha {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.portal-card-resumo .resumo-linha .resumo-cliente {
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
    flex: 1;
    margin-right: 12px;
}
.portal-card-resumo .resumo-badge {
    background: rgba(74,222,128,0.15);
    color: #4ade80;
    font-weight: 800;
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    border: 1px solid rgba(74,222,128,0.25);
}
.portal-card-resumo .resumo-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 0;
}
.portal-card-resumo .resumo-total-label {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}
.portal-card-resumo .resumo-total-valor {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
}
.portal-card-resumo .resumo-vazio {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    margin: 0;
    text-align: center;
    padding: 10px 0;
}

/* ── Portal Parceiro: Breakpoints Responsivos ── */
@media (min-width: 768px) {
    .portal-body { max-width: 640px; padding: 28px; }
    .portal-card-saudacao { padding: 28px 24px; }
    .portal-card-resumo { padding: 26px; }
    .portal-titulo { font-size: 16px; letter-spacing: 2px; }
    .portal-nome strong { font-size: 20px; }
    .portal-card-resumo h3 { font-size: 17px; }
    .portal-card-resumo .resumo-linha .resumo-cliente { font-size: 15px; }
    .portal-card-resumo .resumo-badge { font-size: 13px; padding: 5px 16px; }
    .portal-card-resumo .resumo-total-valor { font-size: 24px; }
}
@media (min-width: 1024px) {
    .portal-body { max-width: 720px; padding: 32px; }
    .portal-header { padding: 16px 32px; }
    .portal-header-logo { height: 110px; }
    .portal-btn-sair { font-size: 30px; padding: 12px; }
}
@media (max-width: 400px) {
    .portal-header { padding: 10px 14px; }
    .portal-header-logo { height: 70px; max-width: 200px; }
    .portal-body { padding: 12px; }
    .portal-card-saudacao { padding: 18px 14px; }
    .portal-titulo { font-size: 13px; letter-spacing: 1px; }
    .portal-nome strong { font-size: 16px; }
    .portal-card-resumo { padding: 16px; }
    .portal-card-resumo h3 { font-size: 14px; }
    .portal-card-resumo .resumo-linha .resumo-cliente { font-size: 13px; }
    .portal-card-resumo .resumo-badge { font-size: 11px; padding: 3px 10px; }
}
#portal-parceiro-screen .card {
    transition: all 0.3s ease;
    border-radius: 12px;
}
#portal-parceiro-screen .card:active {
    transform: scale(0.98);
}
.badge-portal-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}
.btn-presence-confirm {
    background: #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.btn-presence-confirm:active {
    box-shadow: none;
}

/* --- ESTILOS PARA RELATÓRIOS --- */
.badge-success { background: #10B981 !important; color: white !important; }
.badge-warning { background: #F59E0B !important; color: white !important; }
.badge-danger { background: #EF4444 !important; color: white !important; }
.badge-info { background: #6366F1 !important; color: white !important; }

.loader {
    border: 4px solid #f1f5f9;
    border-top: 4px solid var(--primary-brand);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-block;
    animation: spinRel 1s linear infinite;
}
@keyframes spinRel {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 280px;
    padding: 16px 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
    animation: toastIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 6px solid #cbd5e1;
}

.toast.success { border-left-color: #10B981; }
.toast.error { border-left-color: #EF4444; }
.toast.warning { border-left-color: #F59E0B; }

.toast i { font-size: 20px; }
.toast.success i { color: #10B981; }
.toast.error i { color: #EF4444; }
.toast.warning i { color: #F59E0B; }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
    animation: toastOut 0.3s forwards;
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* --- REGRAS DE IMPRESSÃO --- */
@media print {
    /* Oculta menus laterais, botões e barras no topo */
    .no-print, 
    .desktop-header, 
    .bottom-nav, 
    .sidebar-logo, 
    .user-greeting,
    #main-page-title {
        display: none !important;
    }

    /* Reseta margens para a página inteira ser aproveitada */
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Remove sombras e bordas de containers para a impressão limpa */
    .card {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    body {
        background: #fff !important;
    }
    
    .page-break {
        page-break-before: always;
        height: 0;
        margin: 0;
        border: none;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    /* Ajuste de densidade para caber 16 linhas por página com info extra */
    .print-header img { height: 60px !important; }
    .print-header h2 { font-size: 16px !important; }
    table td, table th { padding: 4px 8px !important; font-size: 11px !important; }
}

/* ======================================== */
/* === RESPONSIVIDADE MOBILE (< 768px) === */
/* ======================================== */
@media (max-width: 767px) {

    /* --- Dashboard KPIs: 2 por linha no mobile --- */
    .dash-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* --- Atalhos do Dashboard: colunas empilhadas --- */
    .shortcuts-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    .shortcut-column {
        width: 100%;
    }
    .dash-shortcut {
        width: 100%;
    }

    /* --- Rodapé fixo: compacto no mobile --- */
    .dashboard-footer {
        flex-direction: row;
        gap: 10px;
        padding: 8px 14px;
    }
    .dashboard-footer img { height: 22px; }
    .dashboard-footer span {
        font-size: 11px !important;
    }
    .dashboard-footer span + span {
        font-size: 9px !important;
        margin-left: 0 !important;
        display: block;
    }

    /* --- Formulários: inputs empilhados, 100% largura --- */
    .row {
        flex-direction: column !important;
        gap: 0 !important;
    }
    .col, .col-20 {
        width: 100% !important;
        flex: none !important;
    }

    /* --- Ações de formulário: empilhar botões --- */
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    .form-actions .btn-action {
        width: 100%;
        min-width: auto;
    }

    /* --- Cards de ação: grid 1 coluna --- */
    .action-grid {
        grid-template-columns: 1fr !important;
    }

    /* --- Tabs: permitir scroll horizontal --- */
    .tab-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn {
        min-width: 110px;
        flex-shrink: 0;
    }

    /* --- Título de página --- */
    .page-title {
        font-size: 18px !important;
    }

    /* --- Cards genéricos: padding menor --- */
    .card {
        padding: 12px;
    }

    /* --- Config grid --- */
    .config-grid {
        justify-content: flex-start;
    }
    .config-card {
        width: 100px;
        height: 100px;
    }

    /* --- Lista de ações (botões editar/excluir): gap menor --- */
    .list-actions {
        gap: 6px;
    }
    .action-btn {
        font-size: 18px;
    }

    /* --- Botão principal --- */
    .btn-main {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        font-size: 14px;
    }

    /* --- Toast notifications: largura total --- */
    .toast-container {
        right: 10px;
        left: 10px;
    }
    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* Telas extra pequenas (< 420px): KPIs empilhados */
@media (max-width: 420px) {
    .dash-grid {
        grid-template-columns: 1fr !important;
    }
    .dashboard-footer div {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
}

/* === TABELAS RESPONSIVAS (global) === */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
}
.table-responsive::-webkit-scrollbar { height: 6px; }
.table-responsive::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
.table-responsive table {
    min-width: 600px;
}

/* ================================================================
   BUSCA UNIVERSAL / GLOBAL SEARCH
   ================================================================ */
.global-search-wrapper {
    position: relative;
    width: 320px;
    flex-shrink: 0;
}

.global-search-box {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1.5px solid var(--ios-gray);
    border-radius: var(--radius-input);
    padding: 0 12px;
    height: 40px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.global-search-box:focus-within {
    border-color: var(--ios-gray);
    box-shadow: none;
}

.global-search-icon {
    font-size: 16px;
    color: #94a3b8;
    flex-shrink: 0;
    margin-right: 8px;
}

.global-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-dark);
    padding: 0;
    min-width: 0;
}

.global-search-input::placeholder {
    color: #94a3b8;
    font-size: 13px;
}

.global-search-input:focus {
    background: transparent;
    box-shadow: none;
    outline: none;
}

.global-search-kbd {
    font-size: 10px;
    font-family: inherit;
    color: #94a3b8;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 8px;
    pointer-events: none;
    user-select: none;
}

/* Dropdown de resultados */
.global-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--ios-gray);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    max-height: 380px;
    overflow-y: auto;
    z-index: 999;
    padding: 6px;
}

.global-search-results.active {
    display: block;
    animation: searchDropIn 0.15s ease-out;
}

@keyframes searchDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.global-search-results::-webkit-scrollbar { width: 5px; }
.global-search-results::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }

/* Categoria/grupo */
.search-result-group {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    padding: 8px 10px 4px;
}

/* Item de resultado */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 13px;
    color: var(--text-dark);
}

.search-result-item:hover,
.search-result-item.active {
    background: #f1f5f9;
}

.search-result-item .sri-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.search-result-item .sri-info {
    flex: 1;
    min-width: 0;
}

.search-result-item .sri-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .sri-path {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .sri-arrow {
    font-size: 14px;
    color: #cbd5e1;
    flex-shrink: 0;
}

/* Estado vazio */
.search-no-results {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.search-no-results i {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Highlight match */
.search-highlight {
    background: rgba(229, 57, 53, 0.12);
    color: var(--primary-brand);
    border-radius: 2px;
    padding: 0 1px;
    font-weight: 700;
}

/* ── Mobile ── */
.global-search-mobile {
    width: 100%;
    padding: 0 12px 10px;
}

.global-search-mobile .global-search-box {
    height: 36px;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
}

.global-search-mobile .global-search-icon {
    color: rgba(255,255,255,0.7);
}

.global-search-mobile .global-search-input {
    color: #fff;
    font-size: 12px;
}

.global-search-mobile .global-search-input::placeholder {
    color: rgba(255,255,255,0.5);
}

.global-search-mobile .global-search-results {
    left: 12px;
    right: 12px;
    border-radius: 12px;
}

/* Esconder busca quando deslogado */
body.logged-out .global-search-wrapper { display: none; }

@media print {
    .global-search-wrapper { display: none !important; }
}

/* ================================================================
   PAGINAÇÃO UNIVERSAL
   ================================================================ */
.paginacao-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 0 4px;
    margin-top: 8px;
}

.paginacao-info,
.paginacao-info-unica span {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.paginacao-info-unica {
    text-align: center;
    padding: 10px 0 2px;
}

.paginacao-controles {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    gap: 4px;
    user-select: none;
}

.pag-btn:hover:not(:disabled):not(.pag-active) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.pag-btn.pag-active {
    background: var(--primary-brand);
    color: #fff;
    border-color: var(--primary-brand);
    pointer-events: none;
}

.pag-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pag-btn.pag-nav {
    padding: 0 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pag-ellipsis {
    color: #94a3b8;
    font-size: 14px;
    padding: 0 2px;
    user-select: none;
}

@media (max-width: 600px) {
    .pag-btn.pag-nav span { display: none; }
    .pag-btn.pag-nav { padding: 0 10px; }
    .paginacao-controles { gap: 3px; }
    .pag-btn { min-width: 30px; height: 30px; font-size: 12px; }
}

@media print {
    .paginacao-wrapper, .paginacao-info-unica { display: none !important; }
}

/* ════════════════════════════════════════════════════════════
   INFO RELATÓRIOS — Editor de conteúdo por unidade
   ════════════════════════════════════════════════════════════ */
.ir-card { max-width: 900px; margin-left: auto; margin-right: auto; }

.ir-secao-titulo {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-brand);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.ir-sub-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

/* Toolbar do rich text editor */
.ir-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 5px 8px;
    flex-wrap: wrap;
}

.ir-tb-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 5px 7px;
    cursor: pointer;
    color: #475569;
    font-size: 14px;
    line-height: 1;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}
.ir-tb-btn:hover { background: #e2e8f0; border-color: #cbd5e1; color: #1e293b; }
.ir-tb-btn:active { transform: scale(0.92); }

.ir-tb-sep {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 4px;
    display: inline-block;
    flex-shrink: 0;
}

/* Editor contenteditable */
.ir-editor {
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    background: #fff;
    font-size: 14px;
    line-height: 1.7;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #1e293b;
}
.ir-editor:focus {
    border-color: var(--primary-brand);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}
.ir-editor:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
    font-style: italic;
}
.ir-editor ul, .ir-editor ol { padding-left: 20px; margin: 6px 0; }
.ir-editor li { margin-bottom: 4px; }
.ir-editor p  { margin: 0 0 8px; }

.ir-sub-secao + .ir-sub-secao { margin-top: 18px; padding-top: 14px; border-top: 1px solid #f1f5f9; }

@media (max-width: 600px) {
    .ir-tb-btn { padding: 4px 5px; min-width: 24px; height: 24px; font-size: 13px; }
    .ir-editor { font-size: 13px; }
}

/* ── Grade de cards das Unidades em Inf. Relatórios ───────── */
.ir-unidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin-top: 4px;
}
.ir-unidade-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary-brand, #DC2626);
    border-radius: 12px;
    padding: 16px 16px 14px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    display: flex;
    flex-direction: column;
    min-height: 110px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.ir-unidade-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
    border-color: var(--primary-brand, #DC2626);
}
.ir-unidade-card--preenchido {
    border-left-color: #2563eb;
}
.ir-unidade-card--preenchido:hover {
    border-color: #2563eb;
}
.ir-unidade-card--preenchido .ir-unidade-cta {
    color: #2563eb;
}
.ir-unidade-nome {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    flex: 1;
    word-break: break-word;
}
.ir-unidade-cta {
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-brand, #DC2626);
    display: flex;
    align-items: center;
    gap: 5px;
}
@media (max-width: 480px) {
    .ir-unidades-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ir-unidade-card { min-height: 90px; padding: 12px; }
    .ir-unidade-nome { font-size: 12px; }
}

/* Botões de ação por linha — Extintores Registrados (Portal Parceiro) */
.p-ext-acao {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 7px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
    margin: 0 1px;
}
.p-ext-acao:hover { transform: scale(1.08); }
.p-ext-acao-edit { color: #3b82f6; }
.p-ext-acao-edit:hover { background: #dbeafe; }
.p-ext-acao-del { color: #dc2626; }
.p-ext-acao-del:hover { background: #fee2e2; }
