:root {
    --cor-topo: #2F3E4E;
    --cor-menu: #2F3E4E;
    --cor-acao: #2FA4FF;
    --cor-fundo: #F2F4F6;
    --cor-card: #FFFFFF;
    --cor-texto: #212529;
    --cor-texto-sec: #6C757D;
    --status-pendente: #FFC107;
    --status-bancada: #17A2B8;
    --status-concluido: #28A745;
    --status-erro: #DC3545;
}

/* Blinking Green Dot */
@keyframes blink-green {
    0% { opacity: 1; box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { opacity: 1; box-shadow: 0 0 0 5px rgba(40, 167, 69, 0); }
    100% { opacity: 1; box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    vertical-align: middle;
    animation: blink-green 2s infinite;
}

.status-dot-offline {
    background-color: #6c757d !important;
    animation: none !important;
    box-shadow: none !important;
}

.status-dot-menu {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* Custom Green Pulse (Bootstrap Success) */
@keyframes blink-green-success {
    0% { opacity: 1; box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { opacity: 1; box-shadow: 0 0 0 5px rgba(40, 167, 69, 0); }
    100% { opacity: 1; box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.status-dot-success {
    background-color: #28a745;
    animation: blink-green-success 2s infinite;
}

/* Bottom Action Bar (Bulk Actions) */
.bottom-cart-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 14px 12px;
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease-in-out;
}

.bottom-cart-bar.hidden {
    transform: translateY(100%);
}

.bottom-cart-bar .bottom-cart-summary {
    line-height: 1.15;
}

.bottom-cart-bar .bottom-cart-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bottom-cart-bar .bottom-cart-count {
    margin-top: 0;
}

.bottom-cart-bar .cart-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(25,135,84,0.25);
    color: #198754;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.1;
}

/* Reset e Base */
body {
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    height: 100vh;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--cor-menu);
    padding-top: 60px; /* Altura do header */
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar a {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 16px;
    color: #f1f1f1;
    display: block;
    transition: 0.3s;
    border-left: 4px solid transparent;
}

.sidebar a:hover, .sidebar a.active {
    background-color: rgba(255,255,255,0.1);
    border-left-color: var(--cor-acao);
    color: white;
}

.sidebar .brand {
    position: absolute;
    top: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background-color: rgba(0,0,0,0.2);
}

.sidebar-nav {
    height: calc(100vh - 60px);
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.35) rgba(255,255,255,0.08);
}

.sidebar-nav::-webkit-scrollbar {
    width: 10px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.08);
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 999px;
    border: 2px solid rgba(0,0,0,0);
    background-clip: padding-box;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
    border: 2px solid rgba(0,0,0,0);
    background-clip: padding-box;
}

/* Topbar */
.topbar {
    height: 60px;
    background-color: var(--cor-topo);
    position: fixed;
    top: 0;
    left: 250px; /* Largura da sidebar */
    right: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Content Wrapper */
.content-wrapper {
    margin-left: 250px;
    padding: 20px 10px;
    padding-top: 80px; /* 60px topbar + 20px space */
    transition: all 0.3s;
    min-height: 100vh;
}

/* Mobile Bottom Menu */
.mobile-bottom-menu {
    display: none;
}

/* Responsividade */
@media screen and (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    .topbar {
        left: 0;
    }
    .content-wrapper {
        margin-left: 0 !important;
    }
    .sidebar.show {
        width: 250px;
    }

    .mobile-bottom-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1020;
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        background-color: #ffffff;
        border-top: 1px solid #dee2e6;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-bottom-menu a,
    .mobile-bottom-menu .menu-toggle-btn {
        flex: 1 1 25%;
        min-height: 58px;
        border: 0;
        background: transparent;
        color: var(--cor-texto-sec);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.2;
        cursor: pointer;
    }

    .mobile-bottom-menu i {
        font-size: 16px;
    }

    .mobile-bottom-menu a.active,
    .mobile-bottom-menu a:hover,
    .mobile-bottom-menu .menu-toggle-btn:hover {
        color: var(--cor-acao);
    }

    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0));
    }
}

/* Utils */
.card-resumo {
    border-radius: 10px;
    padding: 20px;
    color: white;
    margin-bottom: 20px;
}

.card-custom { 
    background-color: var(--cor-card); 
    border-radius: 8px; 
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
}

/* Status Badges */
.badge-pendente { background-color: var(--status-pendente); color: #212529; }
.badge-bancada { background-color: var(--status-bancada); color: white; }
.badge-concluido { background-color: var(--status-concluido); color: white; }
.badge-erro { background-color: var(--status-erro); color: white; }

.btn-acao { 
    background-color: var(--cor-acao); 
    color: white; 
    border: none; 
    transition: filter 0.2s;
}
.btn-acao:hover { 
    background-color: var(--cor-acao); 
    filter: brightness(0.9);
    color: white; 
}
