* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* evita rolagem lateral acidental */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

:root {
    --primary-color: #1e3a5f;
    --secondary-color: #4a90e2;
    --accent-color: #ff6b6b;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --border-radius: 10px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
    position: relative;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.5rem;
    color: white;
}

.logo h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

.user-menu {
    position: relative;
}

.user-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.user-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}



/* Bottom Navigation */
.bottom-nav {
    background-color: var(--primary-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 90;
}

.fab {
    position: fixed;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 95;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}

.fab:hover {
    background-color: #3a7bc8;
    transform: translateX(-50%) scale(1.05);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    background-color: white;
    box-shadow: var(--box-shadow);
    z-index: 200;
    transition: all 0.3s ease;
}

.bottom-sidebar {
    bottom: -100%;
    left: 0;
    right: 0;
    height: 45%;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 1.5rem;
}

.bottom-sidebar.active {
    bottom: 0;
}

.top-sidebar {
    top: -100%;
    left: 0;
    right: 0;
    height: 35%;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    padding: 1.5rem;
    overflow-y: auto;
}

.top-sidebar.active {
    top: 0;
}

.sidebar-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.close-sidebar:hover {
    background-color: #f5f7fa;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s;
}

.menu-item:hover {
    background-color: #f5f7fa;
}

.menu-item i {
    font-size: 1.3rem;
    color: var(--secondary-color);
}

.menu-item span {
    font-size: 0.75rem;
    text-align: center;
    color: var(--primary-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.form-group input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.confirm-btn,
.cancel-btn {
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.confirm-btn {
    background-color: var(--secondary-color);
}

.confirm-btn:hover {
    background-color: #3a7bc8;
}

.cancel-btn {
    background-color: var(--accent-color);
}

.cancel-btn:hover {
    background-color: #e55c5c;
}

/* Main Content */
main {
    flex: 1;
    padding: 1.5rem;
    padding-bottom: 80px;
    /* espaço para a barra inferior */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.welcome-message {
    text-align: center;
    max-width: 600px;
}

.welcome-message h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.welcome-message p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Dashboard Styles (quando logado) */
.dashboard {
    display: none;
    width: 100%;
    max-width: 1200px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dashboard-header h2 {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.logout-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== Barra de Filtros (somente visual por enquanto) ===== */
/* Barra de filtros responsiva */
.filters-bar {
    margin: 10px 0;
    display: grid;
    gap: 8px 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: end;
}

/* botão aplicar filtros */
#btnAplicarFiltros {
    align-self: end;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #2cbb68;
    color: #f9fafa;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

#btnAplicarFiltros:hover {
    background: #218d39;
}


.filters-bar label {
    display: block;
    font-size: 12px;
    color: #777;
}

.filters-bar select,
.filters-bar input[type="date"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f7f7f7;
}

/* ===== Lista de Cargas ===== */
.cargas-container {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

/* Cabeçalho e itens com 3 colunas:
   [Liquidação/Empresa] | [Emissão/Embarque] | [Ações] */
.cargas-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    /* <= atualizado p/ 3 colunas */
    gap: 1rem;
    font-size: 0.85rem;
}

.cargas-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

/* sugestão leve – opcional */
.carga-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    background: #fff;
}

.carga-actions .action-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #f9fafb;
    cursor: pointer;
}

.carga-actions .action-btn:hover {
    background: #f3f4f6;
}


.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 0.8rem;
}

.details-btn {
    color: var(--secondary-color);
}

.details-btn:hover {
    background-color: rgba(74, 144, 226, 0.1);
}

.apontamento-btn {
    color: var(--warning-color);
}

.apontamento-btn:hover {
    background-color: rgba(243, 156, 18, 0.1);
}

.no-cargas {
    text-align: center;
    padding: 2rem;
    color: #777;
    font-size: 0.9rem;
}

/* Overlay para sidebars */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 190;
    display: none;
}

/* Badge opcional (se quiser usar no JS) */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #e0e0e0;
    font-size: 12px;
    background: #fafafa;
}

/* Responsividade */
@media (max-width: 768px) {

    .cargas-header,
    .carga-item {
        grid-template-columns: 1fr;
        /* empilha */
        gap: 0.5rem;
    }

    .carga-actions {
        justify-content: center;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .bottom-sidebar {
        height: 50%;
    }

    .top-sidebar {
        height: 40%;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.8rem 1rem;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    main {
        padding: 1rem;
        padding-bottom: 70px;
    }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bottom-sidebar {
        height: 55%;
    }

    .top-sidebar {
        height: 45%;
    }
}