/* ========================================
   CENTRAL DO CLIENTE - NEW TECNOLOGIA
   Cores: Azul #001781 | Laranja #ed6d11
   ======================================== */

:root {
    --azul: #001781;
    --azul-escuro: #000d4d;
    --azul-claro: #002bb8;
    --laranja: #ed6d11;
    --laranja-escuro: #c75a0d;
    --laranja-claro: #ff7e29;
    --sidebar-width: 280px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* ========================================
   LAYOUT PRINCIPAL (Sidebar + Content)
   ======================================== */

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

/* ========================================
   SIDEBAR (Menu Lateral)
   ======================================== */

.central-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--azul) 0%, var(--azul-escuro) 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
}

/* Estado colapsado do sidebar */
.central-sidebar.collapsed {
    width: 80px;
}

.central-sidebar.collapsed .sidebar-user-details,
.central-sidebar.collapsed .sidebar-nav-item span,
.central-sidebar.collapsed .logout-btn span,
.central-sidebar.collapsed .sidebar-nav-title,
.central-sidebar.collapsed .nav-badge {
    display: none;
}

.central-sidebar.collapsed .sidebar-user-info {
    justify-content: center;
}

.central-sidebar.collapsed .sidebar-user-avatar {
    margin: 0;
}

.central-sidebar.collapsed .sidebar-nav-item a {
    justify-content: center;
    gap: 0;
}

.central-sidebar.collapsed .sidebar-nav-item a i {
    margin: 0;
}

.central-sidebar.collapsed .logout-btn {
    justify-content: center;
}

.central-sidebar.collapsed .logout-btn i {
    margin: 0;
}

.central-sidebar::-webkit-scrollbar {
    width: 6px;
}

.central-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.central-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.central-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Botão Toggle Sidebar Desktop — fica fora da <aside> (nenhum overflow/transform da sidebar o afeta) e acima
   de todo o conteúdo. Área de clique de 52px (::before) com o círculo visual de 36px; sem escala no hover, para
   o alvo não "fugir" do cursor. */
.sidebar-toggle-btn {
    position: fixed;
    top: 50%;
    left: calc(var(--sidebar-width) - 18px);
    width: 36px;
    height: 36px;
    margin-top: -18px;
    padding: 0;
    background: linear-gradient(135deg, var(--laranja) 0%, var(--laranja-escuro) 100%);
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: left 0.3s ease, background 0.3s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(237, 109, 17, 0.4);
}

.sidebar-toggle-btn::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
}

@media (max-width: 1024px) {
    .sidebar-toggle-btn,
    #sidebarToggleBtn {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

.sidebar-toggle-btn:hover {
    background: linear-gradient(135deg, var(--laranja-claro) 0%, var(--laranja) 100%);
    box-shadow: 0 6px 20px rgba(237, 109, 17, 0.6);
}

.sidebar-toggle-btn:active {
    box-shadow: 0 2px 8px rgba(237, 109, 17, 0.5);
}

.sidebar-toggle-btn:focus-visible {
    outline: 3px solid rgba(237, 109, 17, 0.45);
    outline-offset: 2px;
}

.sidebar-toggle-btn i {
    color: white;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    pointer-events: none;
}

body.sidebar-collapsed .sidebar-toggle-btn {
    left: 62px;
}

body.sidebar-collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

/* Logo Sidebar */
.sidebar-logo {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-logo-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 50px;
    height: 50px;
    background: var(--laranja);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(237, 109, 17, 0.4);
}

.sidebar-logo-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.3;
}

.sidebar-logo-text p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Perfil do Usuário na Sidebar */
.sidebar-user {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sidebar-user-avatar {
    width: 50px;
    height: 50px;
    background: var(--laranja);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-user-details h3 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin: 0 0 0.25rem 0;
}

.sidebar-user-details p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.sidebar-user-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.user-stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
}

.user-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--laranja);
    margin-bottom: 0.25rem;
}

.user-stat-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Menu de Navegação Sidebar */
.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-nav-title {
    padding: 0 1.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav-list {
    list-style: none;
}

.sidebar-nav-item {
    margin: 0.25rem 0;
}

.sidebar-nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    position: relative;
}

.sidebar-nav-item a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--laranja);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.sidebar-nav-item a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav-item a:hover::before {
    transform: scaleY(1);
}

.sidebar-nav-item.active a {
    background: rgba(237, 109, 17, 0.2);
    color: white;
    font-weight: 600;
}

.sidebar-nav-item.active a::before {
    transform: scaleY(1);
}

.sidebar-nav-item a i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-nav-item a .nav-badge {
    margin-left: auto;
    background: var(--laranja);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Botão de Notificações na Sidebar */
.sidebar-notifications {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-btn-sidebar {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.notification-btn-sidebar:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notification-btn-sidebar .notification-badge {
    background: var(--laranja);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 24px;
}

/* Botão Logout */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.logout-btn {
    width: 100%;
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff6b6b;
    padding: 0.75rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-decoration: none;
}

.logout-btn:hover {
    background: rgba(255, 0, 0, 0.25);
    border-color: rgba(255, 0, 0, 0.5);
}

/* ========================================
   HEADER (Topo fixo)
   ======================================== */

.central-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: left 0.3s ease;
}

.header-left h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--azul);
    margin: 0;
}

.header-left p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-search {
    position: relative;
}

.header-search input {
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    width: 300px;
    transition: all 0.3s;
}

.header-search input:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(0, 23, 129, 0.1);
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.mobile-menu-toggle {
    display: none;
    background: var(--azul);
    color: white;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: var(--azul-claro);
}

/* ========================================
   CONTEÚDO PRINCIPAL
   ======================================== */

.central-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Ajuste do conteúdo quando sidebar está colapsado */
body.sidebar-collapsed .central-content {
    margin-left: 80px;
    width: calc(100% - 80px);
}

body.sidebar-collapsed .central-header {
    left: 80px;
}

/* ========================================
   MOBILE OFF-CANVAS
   ======================================== */

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.3s;
    z-index: 998;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle.active {
    background: var(--laranja);
    border-color: var(--laranja);
    box-shadow: 0 4px 15px rgba(237, 109, 17, 0.4);
    transform: rotate(90deg);
}

/* ========================================
   BARRA SUPERIOR MOBILE
   ======================================== */

.mobile-top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--azul) 0%, var(--azul-escuro) 100%);
    padding: 1rem;
    z-index: 997;
    box-shadow: 0 4px 20px rgba(0, 23, 129, 0.3);
    backdrop-filter: blur(10px);
}

.mobile-top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.mobile-user-avatar {
    width: 42px;
    height: 42px;
    background: var(--laranja);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(237, 109, 17, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.mobile-user-details h3 {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-user-details p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.mobile-logout-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.65rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    position: relative;
    z-index: 1;
    margin-left: auto;
}

.mobile-logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.mobile-logout-btn i {
    font-size: 1rem;
}

@media (max-width: 1024px) {
    .central-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
    }

    .central-sidebar.active {
        transform: translateX(0);
        animation: slideInLeft 0.3s ease;
    }

    .central-content {
        margin-left: 0;
        width: 100%;
        padding-top: 90px;
    }

    .mobile-menu-toggle {
        display: flex;
        top: 0.85rem;
    }

    .mobile-top-bar {
        display: block;
    }

    /* Esconder botão toggle desktop no mobile */
    .sidebar-toggle-btn,
    #sidebarToggleBtn,
    .central-sidebar .sidebar-toggle-btn {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Resetar estados colapsados no mobile */
    body.sidebar-collapsed .central-content,
    body.sidebar-collapsed .central-header {
        margin-left: 0;
        width: 100%;
        left: 0;
    }
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

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

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


/* ========================================
   RESPONSIVE
   ======================================== */

/* ========================================
   TABS DE FATURAS
   ======================================== */

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--azul);
    background: rgba(0, 23, 129, 0.05);
}

.tab-btn.active {
    color: var(--azul);
    border-bottom-color: var(--laranja);
    background: rgba(0, 23, 129, 0.05);
}

.tab-btn i {
    font-size: 1.1rem;
}

.tab-count {
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.tab-btn.active .tab-count {
    background: var(--laranja);
    color: white;
}

.tab-content {
    display: none;
}

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

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .central-content {
        padding: 1.5rem 1rem;
        padding-top: 90px;
    }

    .sidebar-user-stats {
        grid-template-columns: 1fr;
    }

    .mobile-logout-btn span {
        display: none;
    }

    .mobile-logout-btn {
        padding: 0.65rem;
        width: 44px;
        height: 44px;
        justify-content: center;
        border-radius: 50%;
    }

    .mobile-user-details h3 {
        font-size: 0.9rem;
    }

    .mobile-user-details p {
        font-size: 0.7rem;
    }

    .mobile-user-avatar {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.25rem;
    }

    .tab-btn i {
        font-size: 1rem;
    }

    .tab-count {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }

    /* Remover card externo branco no mobile */
    #faturasPendentes > div,
    #faturasPagas > div {
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }

    /* Container dos cards mobile sem padding extra */
    #cardsPendentes,
    #cardsPagas {
        padding: 0 !important;
    }

    /* Cards de faturas individuais no mobile */
    #cardsPendentes > div,
    #cardsPagas > div {
        background: white !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 12px !important;
        padding: 1rem !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        margin-bottom: 1rem !important;
        max-width: 100%;
        overflow: hidden;
    }

    /* Primeiro card com margin-top */
    #cardsPendentes > div:first-child,
    #cardsPagas > div:first-child {
        margin-top: 1.5rem !important;
    }

    /* Último card sem margin-bottom */
    #cardsPendentes > div:last-child,
    #cardsPagas > div:last-child {
        margin-bottom: 0 !important;
    }

    /* Garantir que o conteúdo interno não extrapole */
    #cardsPendentes > div > *,
    #cardsPagas > div > * {
        max-width: 100%;
        word-wrap: break-word;
    }

    /* Garantir que botões não quebrem o layout */
    #cardsPendentes button,
    #cardsPagas button {
        min-width: 0;
        flex-shrink: 1;
    }

    /* Diminuir margin-top da seção de tabs */
    .mb-8.md\:mb-8 {
        margin-bottom: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    .central-content {
        padding: 1rem;
        padding-top: 85px;
    }

    .header-left h2 {
        font-size: 1.1rem;
    }

    .mobile-user-details h3 {
        font-size: 0.85rem;
    }

    .mobile-user-details p {
        font-size: 0.65rem;
    }

    .mobile-user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .mobile-logout-btn {
        width: 40px;
        height: 40px;
    }

    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* ========================================
   UTILITIES
   ======================================== */

.container-central {
    max-width: 1400px;
    margin: 0 auto;
}

/* Animações */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.central-sidebar.active {
    animation: slideIn 0.3s ease;
}

/* ========================================
   MODAL OVERRIDES
   ======================================== */

/* Prevenir scroll quando modal está ativo */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Garantir que modais fiquem acima de tudo */
#pdfModal,
#comprovanteModal,
#faturaModal {
    z-index: 9999 !important;
}

#pixModal {
    z-index: 9998 !important;
}

/* Accordion: a altura é animada pelo JavaScript (de/para px e, ao terminar, auto) */
.accordion-corpo {
    height: 0;
    overflow: hidden;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modais: entrada e saída suaves (o fechamento depende do suporte a transition de display) */
.fixed.inset-0.bg-black {
    opacity: 1;
    transition: opacity 0.25s ease, display 0.25s allow-discrete;
}

.fixed.inset-0.bg-black.hidden {
    opacity: 0;
}

.fixed.inset-0.bg-black > div {
    transform: none;
    opacity: 1;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.fixed.inset-0.bg-black.hidden > div {
    transform: translateY(12px) scale(0.97);
    opacity: 0;
}

@starting-style {
    .fixed.inset-0.bg-black:not(.hidden) {
        opacity: 0;
    }

    .fixed.inset-0.bg-black:not(.hidden) > div {
        transform: translateY(12px) scale(0.97);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .accordion-corpo,
    .fixed.inset-0.bg-black,
    .fixed.inset-0.bg-black > div {
        transition: none;
    }
}

/* ========================================
   ÍCONE FLUTUANTE DO WHATSAPP (menu.php)
   O estilo vivia só no CSS do site; sem ele o bloco entrava no fluxo
   e abria uma faixa de ~24px no topo de toda página da Central.
   ======================================== */
.floating-whatsapp {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
}

.floating-whatsapp a {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
}

.floating-whatsapp a:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.7);
}

@media (max-width: 768px) {
    .floating-whatsapp {
        right: 10px;
        bottom: 10px;
    }

    .floating-whatsapp a {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }
}

/* ========================================
   REVISÃO 06/11/2026 — TOASTS, TOOLTIP, TRANSIÇÕES, ACESSIBILIDADE
   ======================================== */

/* Toasts (no lugar dos alert) */
.toast-container {
    position: fixed;
    right: 16px;
    bottom: 96px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #1e293b;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.35;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border-left: 4px solid #64748b;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-visivel { opacity: 1; transform: translateY(0); }
.toast.toast-saindo { opacity: 0; transform: translateY(8px); }
.toast i { font-size: 1.1rem; margin-top: 1px; flex-shrink: 0; }
.toast span { flex: 1; word-break: break-word; }
.toast-sucesso { border-left-color: #22c55e; }
.toast-sucesso i { color: #4ade80; }
.toast-erro { border-left-color: #ef4444; }
.toast-erro i { color: #f87171; }
.toast-aviso { border-left-color: var(--laranja); }
.toast-aviso i { color: #fb923c; }
.toast-info { border-left-color: #3b82f6; }
.toast-info i { color: #60a5fa; }

.toast-fechar {
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.toast-fechar:hover { color: #fff; }

@media (max-width: 768px) {
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 84px;
        max-width: none;
    }
}

/* Tooltip da sidebar retraída (antes era inline no JS) */
.sidebar-tooltip {
    position: fixed;
    background: var(--laranja);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity 0.2s ease;
}

.sidebar-tooltip-arrow {
    position: fixed;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--laranja);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity 0.2s ease;
}

.sidebar-tooltip.visivel,
.sidebar-tooltip-arrow.visivel { opacity: 1; }

/* Conteúdo entra suave; a sidebar só anima depois do estado inicial aplicado (evita o "pulo" ao carregar) */
.central-content > section { animation: fadeIn 0.35s ease both; }
body:not(.central-pronta) .central-sidebar,
body:not(.central-pronta) .central-content,
body:not(.central-pronta) .sidebar-toggle-btn { transition: none !important; }

/* Itens do menu: realce e indicador de ativo mais claros */
.sidebar-nav-item a { transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.sidebar-nav-item a:hover { transform: translateX(2px); }
.sidebar-nav-item a:active { transform: scale(0.98); }

/* Cartões e linhas */
.bg-white.rounded-2xl.shadow-md { transition: box-shadow 0.25s ease; }
.bg-white.rounded-2xl.shadow-md:hover { box-shadow: 0 10px 30px rgba(0, 23, 129, 0.08); }
tbody tr { transition: background-color 0.15s ease; }

/* Botões: toque e foco */
button, a { -webkit-tap-highlight-color: transparent; }
button:not(:disabled):active { transform: scale(0.98); }
:focus-visible { outline: 3px solid rgba(237, 109, 17, 0.55); outline-offset: 2px; border-radius: 6px; }
button:disabled { cursor: not-allowed; }

/* Esqueleto de carregamento */
.skeleton {
    position: relative;
    overflow: hidden;
    background: #e5e7eb;
    border-radius: 8px;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: skeleton-brilho 1.2s infinite;
}

@keyframes skeleton-brilho { 100% { transform: translateX(100%); } }

/* Área mínima de toque no celular */
@media (max-width: 768px) {
    .tab-btn, .sidebar-nav-item a, .mobile-logout-btn { min-height: 44px; }
}

/* Quem pediu menos movimento no sistema não vê animações */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   ALERTA DE CONEXÃO (menu "Meus Contratos" e botão do menu no celular)
   ======================================== */
@keyframes menu-alerta-piscar {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
    50% { opacity: 0.35; box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
}
.menu-alerta {
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    line-height: 1;
    animation: menu-alerta-piscar 1.1s ease-in-out infinite;
    pointer-events: none;
}
.menu-alerta.bloqueada { background: #ef4444; }
.central-sidebar.collapsed .menu-alerta {
    right: 14px;
    top: 8px;
    transform: none;
    width: 16px;
    height: 16px;
    font-size: 0.55rem;
}
.mobile-menu-toggle { position: fixed; }
.menu-alerta-ponto {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f59e0b;
    border: 2px solid #fff;
    animation: menu-alerta-piscar 1.1s ease-in-out infinite;
    pointer-events: none;
}
.menu-alerta-ponto.bloqueada { background: #ef4444; }
@media (prefers-reduced-motion: reduce) {
    .menu-alerta, .menu-alerta-ponto { animation: none; }
}
/* A regra genérica esconde os <span> do item com o menu recolhido; o alerta continua visível (menor, no canto). */
.central-sidebar.collapsed .sidebar-nav-item span.menu-alerta { display: flex; }

/* Contrato com conexão reduzida/bloqueada: a linha (ou o card no celular) pulsa num vermelho suave. */
@keyframes linha-restricao-pulsar {
    0%, 100% { background-color: rgba(239, 68, 68, 0.04); box-shadow: inset 4px 0 0 rgba(239, 68, 68, 0.35); }
    50% { background-color: rgba(239, 68, 68, 0.14); box-shadow: inset 4px 0 0 rgba(239, 68, 68, 0.9); }
}
.linha-restricao { animation: linha-restricao-pulsar 1.6s ease-in-out infinite; }
tr.linha-restricao:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
    .linha-restricao { animation: none; background-color: rgba(239, 68, 68, 0.08); box-shadow: inset 4px 0 0 rgba(239, 68, 68, 0.6); }
}
