/* =========================================
   SIGLOG OS 2026 - STYLE.CSS (DEFINITIVO)
   ========================================= */

:root {
    /* --- CORES DE IDENTIDADE --- */
    --orange: #FA991C;
    --teal: #1C768F;
    --cyan-neon: #00d2d3;
    /* Operacional */
    --navy: #032539;
    --blue: #3b82f6;
    --purple: #9d4edd;
    /* Relatórios */
    --green: #00E676;
    /* Financeiro */
    --red: #FF5252;
    /* Admin/Danger */
    --white: #FFFFFF;

    /* --- MEDIDAS (LAYOUT) --- */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 80px;
}

/* --- TEMA ESCURO (PADRÃO) --- */
:root,
[data-theme="dark"] {
    --bg-body: #021a29;
    --bg-sidebar: rgba(3, 37, 57, 0.85);
    --bg-card: rgba(3, 37, 57, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #FBF3F2;
    --text-secondary: #94a3b8;
    --input-bg: rgba(0, 0, 0, 0.3);
    --blob-opacity: 0.5;
    --scrollbar-track: #021a29;
    --scrollbar-thumb: #1C768F;
}

/* --- TEMA CLARO (LIGHT MODE) --- */
[data-theme="light"] {
    --bg-body: #F0F2F5;
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --bg-card: #FFFFFF;
    --border-color: #D1D5DB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --input-bg: #FFFFFF;
    --blob-opacity: 0.1;
    --scrollbar-track: #F0F2F5;
    --scrollbar-thumb: #9CA3AF;
}

/* --- RESET BÁSICO --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- LOGO SWITCHER --- */
.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    /* Garante que não vaze quando encolher */
}

.logo-img {
    height: 45px;
    /* Tamanho padrão */
    max-width: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Regras de Tema */
.logo-light {
    display: none;
}

.logo-dark {
    display: block;
}

[data-theme="light"] .logo-light {
    display: block;
}

[data-theme="light"] .logo-dark {
    display: none;
}

/* QUANDO A SIDEBAR ENCOLHE */
.sidebar.collapsed .logo-img {
    opacity: 0;
    /* Fica invisível */
    width: 0;
    /* Zera a largura */
    height: 0;
    /* Zera a altura */
    margin: 0;
}

/* --- BACKGROUND ANIMADO --- */
.ambient-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.grid-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(125, 125, 125, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 125, 125, 0.1) 1px, transparent 1px);
    background-size: 60px 60px;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: var(--blob-opacity);
    animation: float 10s infinite ease-in-out alternate;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* --- LAYOUT PRINCIPAL --- */
.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    /* Impede barra de rolagem horizontal */
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.brand-area {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

/* Estilo dos Mini Cards da Sidebar */
.nav-menu {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-card {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
}

.nav-card i {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
    margin-right: 12px;
    transition: 0.3s;
}

.nav-card span {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 1;
    transition: 0.3s;
}

/* Cores Neon na Sidebar (Hover/Active) */
.nav-card.bi:hover,
.nav-card.bi.active {
    background: rgba(28, 118, 143, 0.15);
    border-color: var(--teal);
    color: #fff;
    box-shadow: 0 0 15px rgba(28, 118, 143, 0.3);
}

.nav-card.bi:hover i,
.nav-card.bi.active i {
    color: var(--teal);
}

.nav-card.rateio:hover,
.nav-card.rateio.active {
    background: rgba(250, 153, 28, 0.15);
    border-color: var(--orange);
    color: #fff;
    box-shadow: 0 0 15px rgba(250, 153, 28, 0.3);
}

.nav-card.rateio:hover i,
.nav-card.rateio.active i {
    color: var(--orange);
}

.nav-card.relatorios:hover,
.nav-card.relatorios.active {
    background: rgba(157, 78, 221, 0.15);
    border-color: var(--purple);
    color: #fff;
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.3);
}

.nav-card.relatorios:hover i,
.nav-card.relatorios.active i {
    color: var(--purple);
}

.nav-card.admin:hover,
.nav-card.admin.active {
    background: rgba(255, 71, 87, 0.15);
    border-color: var(--red);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.3);
}

.nav-card.admin:hover i,
.nav-card.admin.active i {
    color: var(--red);
}

/* Comportamento quando colapsado */
.sidebar.collapsed .nav-card {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-card span {
    opacity: 0;
    width: 0;
    display: none;
}

.sidebar.collapsed .nav-card i {
    margin-right: 0;
    font-size: 1.4rem;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: margin-left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar.collapsed~.main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* --- HEADER --- */
.top-header {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.breadcrumb {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Botões do Header */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.btn-icon:hover {
    background: rgba(125, 125, 125, 0.1);
    color: #fff;
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
}

.btn-primary:hover {
    background: rgba(125, 125, 125, 0.1);
}

/* --- GRID SYSTEM PERSONALIZADO (Substituto do Bootstrap) --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

.grid-sidebar-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

/* Responsividade do Grid */
@media (max-width: 900px) {

    .grid-3,
    .grid-sidebar-layout {
        grid-template-columns: 1fr;
    }
}

/* --- GLASS PANEL (Cards Internos) --- */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    color: var(--text-primary);
    height: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* --- TABELAS --- */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-primary);
}

.table th {
    text-align: left;
    padding: 15px;
    color: var(--cyan-neon);
    border-bottom: 2px solid var(--teal);
    text-transform: uppercase;
    font-size: 0.85rem;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tr:hover td {
    background: rgba(125, 125, 125, 0.05);
}

/* --- UTILITÁRIOS --- */
.text-right {
    text-align: right;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.fade-up {
    animation: fadeUp 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- SCROLLBAR PERSONALIZADA --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--teal);
}

/* --- RESPONSIVIDADE MOBILE --- */
@media (max-width: 768px) {
    .sidebar {
        left: -100%;
        width: 100%;
    }

    .sidebar.active-mobile {
        left: 0;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 20px;
    }

    .header-actions .btn-primary {
        display: none;
    }

    /* Esconde botão suporte no mobile */
}

/* Utilitários de Visibilidade Mobile  */
@media (min-width: 769px) {
    .d-md-none {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .d-none-mobile {
        display: none !important;
    }
}

/* --- FOOTER (RODAPÉ) --- */
.footer-sistema {
    margin-top: auto;
    /* Empurra pro final da tela */
    padding: 40px 0 20px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.social-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    /* Espaço entre ícones */
    margin-bottom: 20px;
}

.social-link {
    color: var(--text-secondary);
    font-size: 1.3rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    /* Bolinha sutil */
    border: 1px solid transparent;
}

.social-link:hover {
    color: #fff;
    background: var(--teal);
    /* Fica Teal ao passar o mouse */
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(28, 118, 143, 0.3);
}

.copyright-area p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.dev-credits i {
    color: var(--orange);
    animation: pulse 2s infinite;
    /* O raiozinho fica pulsando */
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}