:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --dark-color: #1a1a2e;
    --light-color: #f4f7f6;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --text-color: #333;
    --sidebar-width: 250px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* ============================================
   ANIMAÇÕES E EFEITOS MODERNOS
   ============================================ */

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes bounce-dots {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(-10px); opacity: 1; }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    text-align: center;
    animation: slideIn 0.5s ease;
}

.login-logo {
    max-width: 150px;
    margin-bottom: 20px;
}

.login-box h2 {
    margin-bottom: 30px;
    color: var(--dark-color);
}

.login-box h2 small {
    display: block;
    font-size: 0.5em;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: all var(--transition-speed) ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
    background-color: #fafafa;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================
   CONTROLES DE FORMULÁRIO REUTILIZÁVEIS
   ============================================ */

/*
 * Alguns filtros usam a classe form-control fora de .form-group.
 * Mantemos aqui o mesmo padrão visual dos formulários principais
 * para evitar que o navegador aplique seu estilo padrão.
 */
.form-control,
.form-select {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #d7dce5;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    font: inherit;
    font-size: 16px;
    line-height: 1.35;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease, background-color var(--transition-speed) ease;
}

select.form-control,
select.form-select {
    cursor: pointer;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.12);
    background-color: #fff;
}

.form-control:disabled,
.form-select:disabled {
    background-color: #f1f3f5;
    cursor: not-allowed;
    opacity: .75;
}

/* Grade reutilizável para filtros de relatórios */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-grid .form-group {
    min-width: 0;
    margin-bottom: 0;
}

.filter-grid .btn {
    width: 100%;
    min-height: 46px;
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left var(--transition-speed) ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.3);
}

.btn-primary:hover {
    background-color: #5a0eb4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 17, 203, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Spinner no botão */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* ============================================
   LAYOUT
   ============================================ */

.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark-color) 0%, #2c2c44 100%);
    color: #fff;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
}

.sidebar-header {
    padding: 16px 20px;
    text-align: center;
    border-bottom: 3px solid rgba(106, 17, 203, 0.2);
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.sidebar-logo {
    max-width: 190px;
    max-height: 88px;
    height: auto;
    width: auto;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    object-fit: contain;
}

.sidebar-logo:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.15));
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.user-role {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6a11cb;
    font-weight: 700;
}

.user-name {
    font-size: 0.75rem;
    color: #333;
    font-weight: 600;
}

.sidebar-nav {
    padding: 15px 0;
    flex-grow: 1;
    overflow-y: auto;
}

/* Seção de Navegação Agrupada */
.nav-section {
    margin-bottom: 8px;
}

.nav-group {
    margin-bottom: 20px;
    padding: 0;
}

/* Cabeçalho do Grupo */
.nav-group-header {
    padding: 12px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    border-left: 3px solid transparent;
    transition: all var(--transition-speed) ease;
}

.nav-group-header i {
    font-size: 0.9rem;
    opacity: 0.6;
}

/* Itens do Grupo */
.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 8px;
}

/* Item de Navegação */
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    border-radius: 6px;
    margin: 0 4px;
    position: relative;
}

.nav-item i {
    margin-right: 12px;
    font-size: 1rem;
    opacity: 0.8;
    transition: all 0.25s ease;
}

.nav-item span {
    transition: all 0.25s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding-left: 22px;
    border-left-color: var(--secondary-color);
}

.nav-item:hover i {
    opacity: 1;
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(37, 117, 252, 0.15);
    color: #fff;
    border-left-color: var(--secondary-color);
    font-weight: 600;
}

.nav-item.active i {
    opacity: 1;
}

/* Dashboard Link - Destaque Especial */
.dashboard-link {
    background: rgba(37, 117, 252, 0.08);
    margin: 0 8px 12px 8px;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
    color: #fff;
    font-weight: 600;
}

.dashboard-link:hover {
    background: rgba(37, 117, 252, 0.15);
}

.dashboard-link.active {
    background: rgba(37, 117, 252, 0.2);
}

/* Link de Logout - Destaque em Vermelho */
.logout-link {
    color: rgba(255, 107, 107, 0.8);
    margin-top: 8px;
}

.logout-link:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border-left-color: #ff6b6b;
}

.logout-link i {
    color: rgba(255, 107, 107, 0.8);
}

.sidebar-footer {
    padding: 20px;
    border-top: 2px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.15);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
    line-height: 1.6;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-content strong {
    color: rgba(255,255,255,0.7);
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* ============================================
   DASHBOARD CARDS
   ============================================ */

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all var(--transition-speed) ease;
}

.card:hover {
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 14px;
    color: #777;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ============================================
   TABS
   ============================================ */

.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
    gap: 0;
    flex-wrap: wrap;
}

.tab-link {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: #666;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
}

.tab-link:hover {
    color: var(--primary-color);
}

.tab-link.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ============================================
   TABLES
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.table tbody tr {
    transition: background-color var(--transition-speed) ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsividade para tabelas em mobile */
@media (max-width: 768px) {
    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 8px;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 6px;
        overflow: hidden;
    }

    .table tbody td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #eee;
    }

    .table tbody td:before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.7rem;
        color: #666;
    }

    .table tbody td:last-child {
        border-bottom: none;
    }
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: #e9ecef;
    color: #495057;
    white-space: nowrap;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ============================================
   MODALS E TOASTS
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 16px 24px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    z-index: 2000;
    max-width: 400px;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
    color: #333;
}

/* ============================================
   LOADING STATES
   ============================================ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@keyframes shimmer {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes bounce-dots {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(-10px); opacity: 1; }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

.loading-overlay .loading-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 280px;
}

.loading-overlay .loader-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.loading-overlay .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    animation: bounce-dots 1.4s infinite;
}

.loading-overlay .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-overlay .dot:nth-child(3) {
    animation-delay: 0.4s;
}

.loading-overlay .loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.loading-overlay .loading-subtext {
    font-size: 0.9rem;
    color: #666;
    animation: shimmer 2s ease-in-out infinite;
}

.loading-overlay.hidden {
    display: none;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 1024px) {
    .main-content {
        padding: 20px;
    }

    .cards-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .card {
        padding: 15px;
    }
}

.mobile-topbar-brand {
    display: none;
}

@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        flex-direction: column;
        align-items: stretch;
        overflow-y: auto;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        background: linear-gradient(180deg, var(--dark-color) 0%, #2c2c44 100%);
        box-shadow: 2px 0 15px rgba(0,0,0,0.3);
    }

    .sidebar.open {
        left: 0;
        animation: slideInLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .sidebar-header {
        padding: 12px 14px;
        border-bottom: 3px solid rgba(106, 17, 203, 0.2);
        border-right: none;
        min-width: auto;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .sidebar-logo {
        max-width: 120px;
        max-height: 68px;
        height: auto;
        width: auto;
        margin-right: 12px;
        margin-bottom: 0;
        filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
        object-fit: contain;
    }

    .user-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin-top: 0;
    }

    .user-role {
        font-size: 0.6rem;
        color: #6a11cb;
    }

    .user-name {
        font-size: 0.7rem;
        color: #333;
    }

    .sidebar-nav {
        padding: 20px 0;
        flex-grow: 1;
        width: 100%;
        overflow-y: auto;
    }

    .sidebar-nav ul {
        display: flex;
        flex-direction: column;
    }

    .sidebar-nav ul li {
        margin-bottom: 5px;
        flex: none;
        min-width: auto;
    }

    .nav-group-header {
        padding: 14px 20px;
        font-size: 0.7rem;
        letter-spacing: 1.1px;
    }

    .nav-group-header i {
        font-size: 1rem;
        display: inline-block;
        min-width: 18px;
        text-align: center;
    }

    .nav-item {
        padding: 13px 16px;
        font-size: 0.93rem;
    }

    .nav-item i {
        margin-right: 10px;
        font-size: 1.1rem;
        display: inline-block;
        min-width: 20px;
        text-align: center;
    }

    .nav-item:hover {
        padding-left: 20px;
    }

    .dashboard-link {
        margin: 0 6px 10px 6px;
    }

    .sidebar-footer {
        display: block;
        padding: 18px;
        border-top: 2px solid rgba(255,255,255,0.1);
        background: rgba(0,0,0,0.1);
        text-align: center;
        margin-top: auto;
    }

    .footer-content {
        font-size: 0.7rem;
    }

.mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 60px;
        height: 60px;
        background: #ffffff;
        color: #4b5563;
        border: none;
        border-right: 1px solid #eef2f7;
        cursor: pointer;
        font-size: 1.8rem;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1001;
        box-shadow: none;
        transition: color 0.2s ease, background-color 0.2s ease;
        border-radius: 0;
        font-weight: bold;
        letter-spacing: 2px;
    }

    /* Garantir que o menu não apareça na tela de login */
    body.login-page .mobile-menu-toggle,
    body.login-page .mobile-menu-overlay,
    body.login-page .wrapper::before {
        display: none !important;
    }

    .mobile-menu-toggle:hover {
        color: #312e81;
        background: #f8fafc;
    }

    .mobile-menu-toggle:active {
        background: #f1f5f9;
    }

    /* Logo sempre visível na barra superior, ao lado do menu hamburguer */
    .mobile-topbar-brand {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        width: auto;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 12px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        pointer-events: none;
    }

    body.mobile-menu-open .mobile-topbar-brand {
        display: none;
    }

    .mobile-topbar-brand img {
        display: block;
        width: 140px;
        max-width: calc(100vw - 88px);
        max-height: none;
        height: auto;
        object-fit: contain;
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        display: none;
        z-index: 999;
        animation: fadeIn 0.3s ease;
        backdrop-filter: blur(2px);
        transition: all 0.3s ease;
    }

    .mobile-menu-overlay.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    .main-content {
        margin-left: 0;
        padding-top: 0;
    }

    .wrapper {
        position: relative;
    }

    .wrapper::before {
        content: '';
        display: block;
        height: 60px;
        background: #ffffff;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    }



    .cards-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card {
        padding: 15px;
    }

    .card h3 {
        font-size: 12px;
    }

    .card .value {
        font-size: 24px;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .btn-block {
        width: 100%;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }

    .alert {
        padding: 12px;
        margin-bottom: 15px;
    }

    .modal {
        width: 95%;
        padding: 20px;
    }

    .toast {
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .mobile-topbar-brand img {
        width: 140px;
        max-width: calc(100vw - 88px);
        max-height: none;
    }
    .sidebar-header {
        min-width: 150px;
        padding: 12px 15px;
    }

    .sidebar-nav ul li {
        min-width: 120px;
    }

    .sidebar-nav ul li a {
        padding: 10px 12px;
    }

    .main-content {
        padding: 12px;
    }

    .card {
        padding: 12px;
    }

    .card h3 {
        font-size: 11px;
    }

    .card .value {
        font-size: 20px;
    }

    .tabs {
        gap: 0;
    }

    .tab-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .table th,
    .table td {
        padding: 6px;
    }

    .modal {
        width: 98%;
        padding: 15px;
    }
}

/* ============================================
   UTILITÁRIOS
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-muted {
    color: #6c757d;
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

/* WhatsApp Icon */
.whatsapp-link {
    color: #25d366;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-speed) ease;
}

.whatsapp-link:hover {
    transform: scale(1.1);
}

.whatsapp-link::before {
    content: '📱';
    margin-right: 5px;
}

/* Estilos para Mensagens Não Lidas na Sidebar */
.nav-item.has-unread i {
    color: #f59e0b !important; /* Cor de destaque (âmbar) */
    animation: pulse-unread 2s infinite;
}

.unread-badge {
    background-color: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
}

@keyframes pulse-unread {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ============================================
   WHATSAPP INTEGRATION
   ============================================ */



@media (max-width: 768px) {
    .whatsapp-drawer {
        width: 100%;
        right: -100%;
    }
}

/* ============================================
   ANNOUNCEMENT POPUP (MANDATORY)
   ============================================ */

.announcement-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.announcement-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 600px;
    max-height: 95vh;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.announcement-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    text-align: center;
    flex-shrink: 0;
}

.announcement-body {
    padding: 20px 30px;
    text-align: center;
    overflow-y: auto;
    flex: 1;
}

.announcement-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.announcement-image {
    max-width: 100%;
    max-height: 350px;
    border-radius: 8px;
    margin-bottom: 20px;
    object-fit: contain;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.btn-respond {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-respond:hover {
    filter: brightness(0.9);
    transform: translateY(-2px);
}

.btn-dismiss {
    background: white;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-dismiss:hover {
    background: #eee;
}
