/* =================================
   1. VARIÁVEIS GLOBAIS (Consolidado)
   ================================= */
:root {
    /* Cores Principais */
    --primary-red: #AF0000;
    --primary-red-hover: #850000;
    --white: #ffffff;
    
    /* Textos */
    --text-main: #1f2937;
    --text-secondary: #6b7280;
    --text-placeholder: #d1d5db;

    /* Backgrounds */
    --bg-body: #ffffff;
    --bg-light: #F7F7F7;
    --border-color: #e5e7eb;

    /* Gradients */
    --gradient-red: linear-gradient(180deg, var(--primary-red) 64%, #4A0000 100%);
    --gradient-dark-red: linear-gradient(180deg, var(--primary-red) 10%, #4A0000 100%);
    --gradient-active: linear-gradient(135deg, var(--primary-red) 0%, #750000 100%);

    /* Shadows */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-active: 0 8px 15px rgba(175, 0, 0, 0.15);

    /* Borders Radius */
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-xl: 50px;
}

/* =================================
   2. CONFIGURAÇÕES GERAIS
   ================================= */
html, body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    font-family: "Roboto Condensed", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
}

/* Scrollbar Hide */
body::-webkit-scrollbar, html::-webkit-scrollbar { display: none; }

/* Helpers */
.roboto-condensed-semibold { font-family: "Roboto Condensed", sans-serif; font-weight: 700; }
.allow-select { -webkit-user-select: text; user-select: text; }

/* Turbo Progress Bar Hide */
.turbo-progress-bar {
    visibility: hidden;
    height: 0;
    opacity: 0;
}

/* =================================
   3. COMPONENTES UI GERAIS
   ================================= */

/* Page Loader */
#page-loader {
    display: none; opacity: 0;
    justify-content: center; align-items: center;
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 99999;
    transition: opacity 0.5s ease; 
}
#page-loader.is-loading { display: flex !important; opacity: 1 !important; visibility: visible !important; }
#page-loader img { width: 100px; animation: bounce 1s infinite; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Device Switch */
.mobile-screen { display: none; }
@media (max-width: 768px) {
    .desktop-screen { display: none; }
    .mobile-screen { display: block; }
}

/* Backgrounds & Containers */
.bg-red-gradient { background: var(--gradient-red); width: 100%; min-height: 100vh; display: flex; justify-content: center; align-items: center; }
.bg-darker-red-gradient { background: var(--gradient-dark-red); width: 100%; min-height: 100vh; display: flex; justify-content: center; align-items: center; }

.content-container { width: 100%; margin: 0 auto; max-width: 1100px; }
@media (max-width: 768px) { .content-container { max-width: 450px; } }

.form-card {
    width: 100%; max-width: 450px;
    border: none; border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    background-color: var(--white);
}
.form-card img { width: 10vh; height: auto; }

/* Buttons */
.btn-submit {
    background-color: var(--primary-red);
    color: var(--white);
    font-weight: 700; border: none;
    border-radius: 10px; padding: 12px;
    font-size: 1.1rem; transition: all 0.3s ease;
}
.btn-submit:hover, .btn-submit:active {
    background-color: var(--primary-red-hover);
    color: var(--white);
    transform: translateY(-1px);
}

/* Reusable circular back button */
.btn-back-circle {
    width: 45px;
    height: 45px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--white);
    color: var(--text-main);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-back-circle:link,
.btn-back-circle:visited,
.btn-back-circle:active {
    color: var(--text-main);
}

.btn-back-circle:hover,
.btn-back-circle:focus-visible {
    background: #fff5f5;
}

.btn-back-circle i {
    width: 1em;
    height: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
    transform: translateX(-0.5px);
}

.link-simple {
    color: var(--text-main) !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    font-size: 0.95rem; cursor: pointer;
}
.link-simple:hover { color: var(--primary-red) !important; }

.info-text {
    color: #444; font-size: 0.95rem; font-weight: 600;
    line-height: 1.4; margin-bottom: 20px;
    padding: 0 10px; text-align: center;
}

/* Mobile Header (Login/Splash) */
.mobile-header {
    background: var(--gradient-red);
    height: 260px; width: 100%;
    border-bottom-right-radius: 100% 60px; 
    border-bottom-left-radius: 0;
    display: flex; justify-content: center; align-items: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
}
.mobile-logo-container img { width: 110px; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.2)); }
.mobile-content { padding: 0 30px; }

/* =================================
   4. POLL & CANDIDATES
   ================================= */
.candidate-card {
    position: relative;
    background-color: var(--primary-red);
    border-radius: 18px; padding: 6px;        
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 4px solid transparent;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.candidate-card:active { transform: scale(0.98); }
.candidate-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.25); }

.candidate-photo {
    width: 100%; aspect-ratio: 1 / 1; 
    object-fit: cover; border-radius: 14px;
    display: block; background-color: #800000;
}
.candidate-card.selected .candidate-photo { opacity: 0.85; }

.candidate-name {
    margin: 10px 0 5px 0;
    font-size: 1.1rem; font-weight: 800;
    text-align: center; color: white;
    text-transform: uppercase; letter-spacing: 0.5px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.4);
}
@media (max-width: 768px) { .candidate-name { font-size: 1rem; } }

.check-badge {
    position: absolute; top: 15px; right: 15px;
    background-color: #28a745; color: white;
    border-radius: 50%; width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; opacity: 0;
    transform: scale(0) rotate(-45deg);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); border: 3px solid white;
}
.candidate-card.selected .check-badge { opacity: 1; transform: scale(1) rotate(0deg); }

#vote-action-area {
    max-height: 0; overflow: hidden; opacity: 0;
    transition: all 0.4s ease-out;
}
#vote-action-area.visible { max-height: 120px; opacity: 1; margin-top: 30px; }

/* =================================
   5. DASHBOARD STRUCTURE
   ================================= */
body.dashboard-page { background-color: var(--bg-body); }

@media (max-width: 767px) {
    body.dashboard-page { padding-bottom: 80px; }
}

.container-fluid { background: var(--bg-body); }

/* === SIDEBAR FIXA (Desktop) === */
@media (min-width: 768px) {
    .col-md-2 {
        position: fixed;
        left: 0;
        top: 0;
        width: 260px;
        max-width: 260px;
        flex: 0 0 260px;
        height: 100vh;
        padding: 0.9rem 0.2rem 0.9rem 0.9rem;
        z-index: 100;
    }
}

/* === COLUNA PRINCIPAL (Desktop) === */
@media (min-width: 768px) {
    .col-md-10 {
        margin-left: 260px;
        width: calc(100% - 260px);
        max-width: calc(100% - 260px);
        padding: 0.9rem 0.9rem 0.9rem 0.05rem;
    }

    /* Tighten visual gap between sidebar and main panel */
    .col-md-2 .sidebar-wrapper {
        margin-right: 0 !important;
    }

    .col-md-10 .content-box-header,
    .col-md-10 .content-box-main {
        margin-left: 0.35rem !important;
        margin-right: 0.35rem !important;
    }
}

/* Content Boxes */
.content-box-header {
    background: transparent; 
    width: 100%; 
    height: auto;
    padding: 10px 10px; 
    border-radius: 20px;
}

.content-box-main {
    background: var(--bg-body);
    min-height: calc(100vh - 120px);
    border-radius: 0; 
    padding: 15px !important;
    box-shadow: none !important;
}

/* DESKTOP: Esconder header completamente */
@media (min-width: 768px) {
    .content-box-header {
        display: none !important;
    }

    .content-box-main {
        background: var(--bg-light);
        border-radius: var(--radius-lg);
        padding: 30px !important;
        box-shadow: none !important;
    }
}

/* MOBILE: Mostrar header fixo no topo */
@media (max-width: 767px) {
    .content-box-header {
        background: var(--bg-light);
        position: sticky;
        top: 0;
        z-index: 50;
        padding: 15px 20px !important;
        margin: 0 !important;
        box-shadow: var(--shadow-sm);
    }
}

/* =================================
   6. DASHBOARD COMPONENTS
   ================================= */

/* Botão Redondo (Ação Rápida) */
.btn-dash-red {
    background-color: transparent;
    color: #333;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 10px 24px; font-weight: 500;
    transition: all 0.2s;
}
.btn-dash-red:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
    background-color: var(--white);
}
.btn-dash-red:active, .btn-dash-red.active, .show > .btn-dash-red.dropdown-toggle {
    background-color: var(--primary-red-hover) !important;
    color: white !important;
    border-color: var(--primary-red-hover) !important;
}

/* Stat Cards */
.stat-card {
    border: none; border-radius: 20px;
    padding: 16px; height: 100%;
    display: flex; flex-direction: column; justify-content: space-between;
    transition: transform 0.2s ease;
    text-decoration: none !important;
}
.stat-card:hover { transform: translateY(-3px); }

.stat-card.active {
    background: var(--gradient-active);
    color: white !important;
    box-shadow: var(--shadow-active);
}
.stat-card.white {
    background-color: var(--white);
    color: #111;
    box-shadow: var(--shadow-sm);
}

.icon-circle {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
}
.stat-card.active .icon-circle { background-color: rgba(255, 255, 255, 0.2); }
.stat-card.white .icon-circle { background-color: #f8f9fa; color: #333; }

.stat-number { font-size: 2.2rem; font-weight: 700; line-height: 1; margin: 12px 0; }
.stat-label { font-size: 0.9rem; font-weight: 600; }
@media (min-width: 992px) { .stat-label { font-size: 1.2rem; } }

.trend-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 600;
}
.stat-card.active .trend-badge { background-color: rgba(255, 255, 255, 0.15); color: #fff; }
.stat-card.white .trend-badge { background-color: #fff0f0; color: var(--primary-red); }

@media (max-width: 767px) {
    .trend-badge, .stat-card small { display: none !important; }
    .stat-number { margin-bottom: 0; }
}

/* Sidebar */
.sidebar-wrapper {
    background: var(--bg-light);
    height: calc(100vh - 2rem);
    width: 100%;
    border-radius: var(--radius-lg);
    display: flex; flex-direction: column; justify-content: space-between;
    overflow-y: auto;
}

.sidebar-logo img {
    max-width: 100%;
    height: auto;
    max-height: 70px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.sb-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; color: var(--text-secondary);
    text-decoration: none; border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500; transition: all 0.2s;
    position: relative; margin-bottom: 6px;
    white-space: nowrap;
}
.sb-link:link,
.sb-link:visited {
    color: var(--text-secondary);
}
.sb-link:hover { background-color: #fff5f5; color: var(--primary-red); }
.sb-link:focus-visible {
    background-color: #fff5f5;
    color: var(--primary-red);
    outline: 2px solid rgba(175, 0, 0, 0.2);
    outline-offset: 2px;
}

.sb-link.active {
    background: white; color: var(--primary-red);
    font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.sb-link.active:link,
.sb-link.active:visited,
.sb-link.active:hover,
.sb-link.active:focus,
.sb-link.active:focus-visible {
    color: var(--primary-red);
}
.sb-link.active::before {
    content: ""; position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 6px; height: 26px;
    background-color: var(--primary-red);
    border-radius: 0 4px 4px 0;
}
.sb-badge {
    background: var(--primary-red); color: white;
    font-size: 0.7rem; padding: 2px 6px;
    border-radius: 6px; margin-left: auto;
}

/* Keep sidebar profile typography stable across pages with local CSS overrides */
.sidebar-wrapper .profile-info {
    line-height: 1.2;
    min-width: 0;
    flex: 1;
}

.sidebar-wrapper .profile-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-wrapper .profile-email {
    font-size: 0.82rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-wrapper .header-profile {
    width: 100%;
}

/* Header (Top Bar) */
.custom-header-wrapper { display: flex; justify-content: space-between; align-items: center; width: 100%; border-radius: 20px;}

.header-search {
    display: flex; align-items: center; gap: 10px;
    background: white; border-radius: var(--radius-xl);
    padding: 10px 20px; width: 100%; max-width: 400px;
}
.header-search i { color: #9ca3af; font-size: 1.1rem; }
.header-search input {
    border: none; outline: none; background: transparent;
    width: 100%; font-size: 0.95rem; color: var(--text-main);
}
.header-search input::placeholder { color: var(--text-placeholder); }

.mobile-title { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: var(--text-main); 
    margin: 0;
    display: flex;
    align-items: center;
}

.mobile-title img {
    height: 35px;
    width: auto;
}

.header-actions { display: flex; align-items: center; gap: 15px; }

.btn-action {
    width: 45px; height: 45px; border-radius: 50%;
    background: white; border: none;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s; position: relative;
}
.btn-action:hover { background: #f3f4f6; }
.btn-action,
.btn-action:link,
.btn-action:visited,
.btn-action:hover,
.btn-action:focus,
.btn-action:active {
    text-decoration: none !important;
}
.btn-action .notification-dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px;
    background: #ef4444; border-radius: 50%; border: 2px solid white;
}
.btn-action i { font-size: 1.3rem; }

.header-cart-action i {
    font-size: 1.55rem;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.profile-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    text-align: left;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333333;
}

.profile-email {
    font-size: 0.9rem;
    color: #6c757d;
}

.header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .header-actions { gap: 10px; }
    .btn-action, .header-avatar { width: 45px; height: 45px; }
    .btn-action i { font-size: 1.3rem; }
}

/* Mobile Dock (Bottom Bar) */
.mobile-dock {
    position: fixed; bottom: 20px; left: 50%;
    transform: translateX(-50%);
    width: 90%; max-width: 400px; height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 35px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 15px; z-index: 9999;
}

/* Esconder bottom bar quando um modal está aberto */
body.modal-open .mobile-dock,
body.modal-open .mobile-dock-spacer {
    display: none !important;
}

/* Garantir que modais ficam acima da bottom bar */
.modal { z-index: 10000 !important; }
.modal-backdrop { z-index: 9999 !important; }

/* Reserve scroll space so fixed dock does not cover last content block */
.mobile-dock-spacer {
    height: 70px;
}

@media (max-width: 767.98px) {
    .mobile-dock-spacer {
        height: 110px;
    }
}

.dock-item {
    width: 45px; height: 45px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    text-decoration: none; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #9e9e9e;
}
.dock-item.active {
    background: var(--primary-red); color: white;
    box-shadow: 0 5px 15px rgba(175, 0, 0, 0.3);
    transform: translateY(-5px) scale(1.1);
}
.dock-item i { font-size: 1.25rem; }
.dock-item:active { transform: scale(0.9); }

/* Barra com 6 ícones (admin/direção) */
.mobile-dock-6 {
    padding: 0 10px;
}
.mobile-dock-6 .dock-item {
    width: 38px; height: 38px;
}
.mobile-dock-6 .dock-item i { font-size: 1.1rem; }

/* Ícone de switch entre contextos */
.dock-switch {
    color: #bbb;
    border-left: 1px solid #f0f0f0;
    border-radius: 0 50% 50% 0;
    padding-left: 6px;
    margin-left: 2px;
    width: 40px;
}
.dock-switch:hover { color: var(--primary-red); }

/* =================================
   AUTH PAGES - Single Form Layout
   ================================= */

/* Desktop: Background vermelho + card branco */
@media (min-width: 769px) {
    .auth-container {
        background: var(--gradient-red);
        width: 100%;
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .mobile-header {
        display: none;
    }

    .auth-content {
        width: 100%;
        max-width: 450px;
        background-color: var(--white);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-lg);
        padding: 2.5rem;
    }

    .desktop-logo {
        display: block;
        text-align: center;
        margin-bottom: 2rem;
    }

    .desktop-logo img {
        width: 10vh;
        height: auto;
    }
}

/* Mobile: Header vermelho no topo + conteúdo abaixo */
@media (max-width: 768px) {
    .auth-container {
        background-color: var(--bg-body);
        width: 100%;
        min-height: 100vh;
    }

    .mobile-header {
        display: flex;
        background: var(--gradient-red);
        height: 260px;
        width: 100%;
        border-bottom-right-radius: 100% 60px;
        border-bottom-left-radius: 0;
        justify-content: center;
        align-items: center;
        box-shadow: var(--shadow-md);
        margin-bottom: 40px;
    }

    .mobile-logo-container img {
        width: 110px;
        filter: drop-shadow(0 4px 4px rgba(0,0,0,0.2));
    }

    .desktop-logo {
        display: none;
    }

    .auth-content {
        padding: 0 30px;
    }
}

/* =================================
   USER DROPDOWN MENU
   ================================= */

/* Container relativo para posicionar o menu */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Ajuste na área de clique do perfil */
.user-profile-trigger {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    border-radius: var(--radius-md);
    padding: 6px 10px;
    margin-right: -10px;
}

.user-profile-trigger:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* O Menu Flutuante (base) */
.dropdown-content {
    display: none;
    position: absolute;
    
    min-width: 220px;
    background-color: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    
    padding: 8px 0;
    z-index: 1000;
}

.dropdown-content.show {
    display: block;
}

/* DESKTOP: Menu na sidebar (abre para cima) */
@media (min-width: 768px) {
    .sidebar-wrapper .dropdown-content {
        bottom: 110%;
        top: auto;
        right: 0;
        transform-origin: bottom right;
        animation: dropUp 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    }
}

/* MOBILE: Menu no header (abre para baixo) */
@media (max-width: 767px) {
    .content-box-header .dropdown-content {
        bottom: auto;
        top: 110%;
        right: 0;
        transform-origin: top right;
        animation: dropDown 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    }
}

/* Cabeçalho do Menu */
.dropdown-header {
    padding: 8px 20px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Links do Menu */
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-item:link,
.dropdown-item:visited,
.dropdown-item:focus,
.dropdown-item:active {
    color: var(--text-main);
}

.dropdown-item:hover {
    background-color: var(--bg-light);
    color: var(--text-main);
}

.dropdown-item:focus-visible {
    background-color: var(--bg-light);
    color: var(--text-main);
    outline: 2px solid rgba(175, 0, 0, 0.2);
    outline-offset: -2px;
}

.dropdown-item i {
    font-size: 1.2rem;
    margin-right: 12px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.dropdown-item:hover i {
    color: var(--text-secondary);
}

/* Separador */
.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 6px 0;
}

/* Estilo específico para o Logout */
.dropdown-item.text-danger {
    color: #ef4444 !important;
}

.dropdown-item.text-danger:hover {
    background-color: #fef2f2;
}

.dropdown-item.text-danger i {
    color: #ef4444;
}

/* Animação Desktop (SOBE) */
@keyframes dropUp {
    from { 
        opacity: 0; 
        transform: translateY(10px) scale(0.98);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Animação Mobile (DESCE) */
@keyframes dropDown {
    from { 
        opacity: 0; 
        transform: translateY(-10px) scale(0.98);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* =================================
   7. WIZARD MODAL (NOTIFICATIONS & LOCATION)
   ================================= */

/* --- Overlay Global --- */
.pwa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-family: "Roboto Condensed", sans-serif;
}

.pwa-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- O Cartão --- */
.pwa-modal-card {
    background: var(--white);
    width: 90%;
    max-width: 400px;
    padding: 30px 0;
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.pwa-modal-overlay.active .pwa-modal-card {
    transform: scale(1);
}

/* --- Slider --- */
.slider-viewport { width: 100%; overflow: hidden; }
.slider-wrapper {
    display: flex;
    width: 200%;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.step-slide {
    width: 50%;
    padding: 0 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* --- Ícones --- */
.modal-icon-wrapper {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    background-color: #FEF2F2;
    color: var(--primary-red);
}

.bell-icon { width: 32px; height: 32px; }

/* --- Textos --- */
.modal-title {
    margin: 0 0 10px 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.modal-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 25px;
    font-weight: 400;
}

/* --- BOTÕES --- */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Botão Principal */
.btn-wizard-submit {
    background-color: var(--primary-red);
    color: var(--white);
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 1.1rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-wizard-submit:hover, 
.btn-wizard-submit:active {
    background-color: var(--primary-red-hover);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-wizard-submit:disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: wait;
    transform: none !important;
    box-shadow: none;
    opacity: 0.7;
}

/* Botão Secundário */
.btn-wizard-cancel {
    background: transparent;
    border: none;
    color: var(--text-placeholder);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    transition: color 0.2s;
}
.btn-wizard-cancel:hover {
    color: var(--text-secondary);
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .pwa-modal-overlay { align-items: flex-end; }
    .pwa-modal-card {
        width: 100%; max-width: none;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
        transform: translateY(100%);
    }
    .pwa-modal-overlay.active .pwa-modal-card { transform: translateY(0); }
    .modal-handle {
        display: block; width: 40px; height: 5px;
        background-color: var(--border-color); border-radius: 10px;
        margin: -15px auto 20px auto; position: absolute;
        top: 20px; left: 50%; transform: translateX(-50%);
    }
}

/* =========================================
   DATATABLE THEME - REUTILIZÁVEL
   Consistente com o design da aplicação
========================================= */

.datatable-container {
    background: #ffffff; border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* Wrapper do DataTable */
.datatable-wrapper {
    padding: 16px;
}

/* Controles do DataTable */
.dt-layout-row {
    display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
    margin-bottom: 16px; justify-content: space-between;
}

.dt-search {
    flex: 1; min-width: 250px;
}

.dt-search input {
    width: 100%; padding: 10px 14px 10px 40px;
    border: 1px solid #e0e0e0; border-radius: 12px;
    font-size: 0.95rem; background: #f5f6f8;
    transition: all 0.2s ease; position: relative;
}

.dt-search input:focus {
    outline: none; border-color: var(--primary-red);
    background: #fff; box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.dt-search::before {
    content: "🔍"; position: absolute; left: 12px;
    color: #888; font-size: 1rem;
}

/* Info do DataTable */
.dt-info {
    font-size: 0.9rem; color: #666;
}

/* Paginação */
.dataTables_paginate {
    margin-top: 16px; text-align: center;
}

.paginate_button {
    display: inline-block; padding: 8px 12px;
    margin: 0 2px; border: 1px solid #e0e0e0;
    border-radius: 8px; background: #f5f6f8;
    color: #1a1a1a; cursor: pointer; font-size: 0.9rem;
    font-weight: 600; transition: all 0.2s ease;
    text-decoration: none;
}

.paginate_button:hover:not(.disabled) {
    background: #e0e0e0; transform: translateY(-1px);
}

.paginate_button.current {
    background: var(--primary-red); color: #fff;
    border-color: var(--primary-red);
}

.paginate_button.disabled {
    opacity: 0.5; cursor: not-allowed;
}

/* Tabela */
.datatable-table {
    width: 100%; border-collapse: collapse;
}

.datatable-table thead {
    background: #f5f6f8; border-bottom: 2px solid #e0e0e0;
}

.datatable-table th {
    padding: 14px; text-align: left; font-weight: 700;
    color: #1a1a1a; font-size: 0.9rem;
    user-select: none; cursor: pointer;
    transition: all 0.2s ease;
}

.datatable-table th:hover {
    background: #eff0f2;
}

.datatable-table th.dt-orderable-asc::after {
    content: " ▲"; color: var(--primary-red); font-size: 0.7rem;
}

.datatable-table th.dt-orderable-desc::after {
    content: " ▼"; color: var(--primary-red); font-size: 0.7rem;
}

.datatable-table tbody tr {
    border-bottom: 1px solid #f5f6f8; transition: all 0.2s ease;
}

.datatable-table tbody tr:hover {
    background: rgba(230, 57, 70, 0.03);
}

.datatable-table td {
    padding: 14px; font-size: 0.9rem; color: #1a1a1a;
}

/* Status Badge */
.status-badge {
    display: inline-block; padding: 6px 12px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; white-space: nowrap;
}

.status-badge.active {
    background: rgba(46, 204, 113, 0.15); color: #27ae60;
}

.status-badge.inactive {
    background: rgba(149, 165, 166, 0.15); color: #7f8c8d;
}

.status-badge.suspended {
    background: rgba(230, 57, 70, 0.15); color: #e63946;
}

/* Type Badge */
.type-badge {
    display: inline-block; padding: 4px 10px;
    border-radius: 20px; font-size: 0.7rem; font-weight: 600;
    background: #f5f6f8; color: #666; text-transform: uppercase;
}

/* Ações */
.datatable-actions {
    display: flex; gap: 8px; align-items: center;
}

.btn-action {
    padding: 6px 10px; border: none; border-radius: 6px;
    cursor: pointer; font-size: 0.8rem; font-weight: 600;
    transition: all 0.2s ease; display: inline-flex;
    align-items: center; gap: 4px; text-decoration: none;
}

.btn-action-edit {
    background: #f5f6f8; color: #1a1a1a;
}

.btn-action-edit:hover {
    background: #e0e0e0;
}

.btn-action-delete {
    background: rgba(230, 57, 70, 0.1); color: #e63946;
}

.btn-action-delete:hover {
    background: rgba(230, 57, 70, 0.2);
}

.btn-action-status {
    background: rgba(42, 132, 222, 0.1); color: #2a84de;
}

.btn-action-status:hover {
    background: rgba(42, 132, 222, 0.2);
}

/* Empty state */
.datatable-empty {
    text-align: center; padding: 60px 20px;
}

.datatable-empty i {
    font-size: 3.5rem; color: #ddd; display: block;
    margin-bottom: 16px;
}

.datatable-empty p {
    color: #888; font-size: 1rem; margin: 0;
}

/* Responsivo */
@media (max-width: 768px) {
    .dt-layout-row {
        flex-direction: column;
    }

    .dt-search {
        min-width: 100%;
    }

    .datatable-table {
        font-size: 0.85rem;
    }

    .datatable-table th,
    .datatable-table td {
        padding: 10px;
    }

    .datatable-actions {
        flex-wrap: wrap;
    }
}

/* =================================
   TOAST NOTIFICATIONS
   ================================= */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-notif {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-lg);
    font-family: "Roboto Condensed", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    min-width: 280px;
    max-width: 360px;
    pointer-events: all;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid transparent;
}

.toast-notif.show {
    transform: translateX(0);
}

.toast-notif.hide {
    transform: translateX(120%);
    transition: transform 0.25s ease-in;
}

.toast-notif.toast-err  { border-left-color: var(--primary-red); }
.toast-notif.toast-ok   { border-left-color: #27ae60; }
.toast-notif.toast-info { border-left-color: #2a84de; }
.toast-notif.toast-warn { border-left-color: #f39c12; }

.toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
}

.toast-notif.toast-err  .toast-icon { color: var(--primary-red); }
.toast-notif.toast-ok   .toast-icon { color: #27ae60; }
.toast-notif.toast-info .toast-icon { color: #2a84de; }
.toast-notif.toast-warn .toast-icon { color: #f39c12; }

.toast-msg { flex: 1; line-height: 1.4; }

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-placeholder);
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}
.toast-close:hover { color: var(--text-secondary); }

@media (max-width: 480px) {
    #toast-container {
        top: auto;
        bottom: 90px; /* acima da bottom nav */
        right: 12px;
        left: 12px;
    }
    .toast-notif {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }
}