:root { 
    --navy: #003b63; 
    --gray-bg: #f8f9fa; 
    --gray-text: ##003b63;
    --border-gray: #dee2e6;
}

body { background: var(--gray-bg); font-family: 'Exo 2', sans-serif; color: var(--navy); }

/* Sidebar */
.sidebar { width: 100%; height: 64px; position: fixed; top: 0; left: 0; right: 0; background: var(--navy); transition: 0.3s; z-index: 1000; display: flex; flex-direction: row; align-items: center; padding: 0 18px; gap: 18px; }
.sidebar.collapsed .nav { display: flex; }
.sidebar.collapsed span { display: none; }
.sidebar.collapsed .sidebar-title { display: none; }
.sidebar .sidebar-header { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: none; }
.logo-img { max-height: 48px; filter: drop-shadow(1px 0 0 black) drop-shadow(-1px 0 0 black) drop-shadow(0 1px 0 black) drop-shadow(0 -1px 0 black); }

.nav { margin-left: auto; display: flex; flex-direction: row; gap: 8px; align-items: center; }
.nav-link { color: #adb5bd; padding: 8px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; transition: 0.2s; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.04); border-radius: 6px; }
.nav-link.active { background: #fff; color: var(--navy) !important; font-weight: 600; border-radius: 6px; border: none; }

.content-area { margin-left: 0; margin-top: 74px; padding: 25px; transition: 0.3s; }
.content-area.expanded { margin-left: 70px; }

.topbar { border-bottom: 1px solid black; }

/* Cards */
.card { transition: box-shadow 0.3s ease; border: 1px solid black; }
.card:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important; }
.stat-card { border-left: 5px solid var(--border-gray); background: #fff; animation: fadeInUp 0.6s ease-out forwards; opacity: 0; }
.border-left-proprio { border-left-color: var(--navy) !important; }
.border-left-terceiro { border-left-color: #aebbc7 !important; }

.col-md-3:nth-child(1) .stat-card { animation-delay: 0.1s; }
.col-md-3:nth-child(2) .stat-card { animation-delay: 0.2s; }
.col-md-3:nth-child(3) .stat-card { animation-delay: 0.3s; }
.col-md-3:nth-child(4) .stat-card { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tabela */
#logistics-table { font-family: 'Courier New', Courier, monospace; }
.table thead { background: var(--navy); color: white; }
.table thead th { font-size: 10px; border: none; text-transform: uppercase; padding: 12px; font-weight: 500; }
.table td { font-size: 11px; vertical-align: middle; color: #333; }

.table-responsive.rounded { border: 1px solid black; }

.badge-proprio { background: var(--navy); color: white; padding: 4px 8px; border-radius: 4px; font-size: 9px; border: 1px solid black; }
.badge-terceiro { background: #e9ecef; color: var(--navy); padding: 4px 8px; border-radius: 4px; font-size: 9px; font-weight: bold; border: 1px solid black; }

.stat-card .badge, #active-filter-indicator .badge { border: 1px solid black; }

.bg-navy-light { background: #e7e9eb; }
.btn-navy { background: var(--navy); color: white; }
.btn-save { background: #2ecc71; color: white; border: none; }
#toggle-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border-radius: 6px; width: 36px; height: 36px; background: white; border: 1px solid var(--border-gray); color: var(--navy); display: none; align-items: center; justify-content: center; padding: 0; }

.chart-container { height: 260px; position: relative; margin-top: 10px; }

/* Responsivo: barra vertical oculta/visível em mobile */
@media (max-width: 768px) {
    #toggle-btn { display: flex; }
    .sidebar { height: auto; padding: 8px 12px; flex-direction: column; align-items: flex-start; gap: 6px; }
    .nav { display: none; width: 100%; flex-direction: column; gap: 0; background: var(--navy); padding: 8px 0; border-radius: 6px; }
    .sidebar.collapsed .nav { display: flex; }
    .sidebar .nav .nav-link { padding: 10px 14px; width: 100%; border-radius: 0; }
    .header-spacer { height: 64px; }
    .iframe-container { height: calc(100vh - 145px - 64px); }
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 0;
    border-top: 1px solid var(--border-gray);
    transition: 0.3s;
    z-index: 900;
}

/* Remove regras de margem lateral antigas */
.content-area.expanded { margin-left: 0; }

.page-content { padding-bottom: 50px; }
.page-content { padding-bottom: 50px; }

@media print { .sidebar, #file-actions, #toggle-btn, #table-filter, .alert, .footer, #abastecimento { display: none !important; } .content-area { margin: 0 !important; } }

/* Iframe container */
.iframe-container {
    height: calc(100vh - 145px); /* Viewport height - topbar - footer - main padding */
    padding: 0 !important;
}
.iframe-full {
    width: 100%;
    height: 100%;
    border: none;
}

/* Slideshow */
.slideshow-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background-color: white;
    border: 1px solid var(--border-gray);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, background-position 1.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}