/* --- 1. CONFIGURAÇÕES GLOBAIS E VARIÁVEIS --- */
:root {
    --primary-color: #3B71CA;
    --primary-color-light: #5E81F4;
    --secondary-color: #6C757D;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --sidebar-bg-start: #2a2a3e;
    --sidebar-bg-end: #1c1c2e;
    --body-bg: #f4f7fc;
    --white-color: #FFFFFF;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 80px;
}

html,
body {
    background-color: var(--body-bg);
    overflow-x: hidden;
}


/* --- 2. LAYOUT PRINCIPAL (WRAPPER & MAIN CONTENT) --- */
#wrapper {
    display: flex;
    position: relative;
    width: 100%;
    min-height: 100vh;
}

.main-content-wrapper {
    flex-grow: 1;
    transition: margin-left 0.3s ease-in-out;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

#wrapper.sidebar-collapsed .main-content-wrapper {
    margin-left: 0;
    width: 100%;
}

/* --- 3. SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(170deg, var(--sidebar-bg-start), var(--sidebar-bg-end));
    color: var(--white-color);
    transition: margin-left 0.3s ease-in-out;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    margin-left: 0;
}

.sidebar a {
    color: var(--white-color);
    text-decoration: none;
}

.sidebar hr {
    background-color: rgba(255, 255, 255, 0.1);
    margin: 1rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    font-weight: 500;
    padding: 0.85rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white-color);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white-color);
    font-weight: 600;
    box-shadow: inset 3px 0 0 0 var(--primary-color);
}

.sidebar .sub-link {
    font-size: 0.95rem;
    padding-left: 2.5rem;
}

.sidebar .sub-link.active,
.sidebar .sub-link:hover {
    background: none;
    box-shadow: none;
    color: var(--white-color);
    font-weight: 600;
}

.sidebar-close-btn {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    padding: 0.5rem;
}

#wrapper.sidebar-collapsed .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
}

/* --- 4. HEADER SUPERIOR --- */
.top-header {
    border-bottom: 1px solid #dee2e6;
    background-color: var(--white-color);
}

@keyframes bell-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.bell-animation {
    animation: bell-pulse 1.5s infinite;
}

#notification-list .dropdown-item:hover {
    background-color: #f8f9fa;
}

.new-order-icon {
    font-size: 4rem;
    color: var(--primary-color);
    animation: bell-pulse 1.5s infinite;
}

/* --- 5. COMPONENTES DO DASHBOARD --- */

/* -- Cards em Geral -- */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.06);
}

/* --- Card de Status da Loja --- */
.store-status-card .form-check-input {
    width: 3.5em;
    height: 1.75em;
}

.store-status-card .form-check-label {
    font-size: 1.1rem;
    font-weight: 600;
}

/* -- Cards de Estatística (KPIs) -- */
.stat-card-v2 {
    background-color: var(--white-color);
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card-v2:hover .stat-icon {
    transform: scale(1.1) rotate(-8deg);
}

.stat-icon.icon-primary {
    background-color: #e8f1ff;
    color: var(--primary-color);
}

.stat-icon.icon-success {
    background-color: #d1e7dd;
    color: var(--success-color);
}

.stat-icon.icon-danger {
    background-color: #f8d7da;
    color: var(--danger-color);
}

.stat-icon.icon-warning {
    background-color: #fff3cd;
    color: var(--warning-color);
}

/* -- Lista de Atividades (Últimos Pedidos) -- */
.activity-feed .list-group-item {
    padding: 1rem 1.25rem;
    border-color: #f1f1f1 !important;
    transition: background-color 0.2s ease-in-out;
}

.activity-feed .list-group-item:hover {
    background-color: #f8f9fa;
}

.stat-icon.icon-primary-soft {
    background-color: #e8f1ff;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

.stat-icon.icon-success-soft {
    background-color: #d1e7dd;
    color: var(--success-color);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

/* -- Cards de Listagem (Produto, Pedido, Usuário) -- */
.order-card,
.product-card-list,
.user-card {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.order-card:hover,
.product-card-list:hover,
.user-card:hover {
    border-left-color: var(--primary-color);
    z-index: 2;
}

.product-list-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.product-list-img[src*="sem-imagem.png"]:hover {
    border: 3px solid var(--danger-color) !important; 
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3); 
    transition: all 0.2s ease-in-out; 
}

.user-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
}

.badge.bg-secondary-soft {
    background-color: #e9ecef !important;
}

.badge.text-secondary {
    color: #495057 !important;
}

/* -- Cards de Listagem (Bairro) -- */
.bairro-card {
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.bairro-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
    z-index: 2;
}

/* -- Cards de Grupo de Adicionais -- */
.addon-group-card {
    border-left: 4px solid var(--secondary-color);
}

.addon-option-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f1f1;
}

.addon-option-list li:last-child {
    border-bottom: none;
}

.scrollable-dropdown {
    max-height: 250px;
    overflow-y: auto;
}

.addon-pill {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 0.5em 0.75em;
    font-size: 0.9rem;
    border-radius: 0.5rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.addon-pill .btn-close {
    filter: brightness(0) invert(1);
    width: 0.5em;
    height: 0.5em;
    margin-left: 0.75rem;
    opacity: 0.7;
}

.addon-pill .btn-close:hover {
    opacity: 1;
}

/* -- Cards de Listagem (Cupom) -- */
.coupon-card {
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.coupon-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
    z-index: 2;
}

.coupon-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e8f1ff;
    color: var(--primary-color);
    font-size: 1.5rem;
}

@media (max-width: 767.98px) {
    .bairro-card .card-body {
        flex-wrap: wrap;
    }

    .bairro-card .dropup {
        margin-left: 0 !important;
        margin-top: 1rem;
        width: 100%;
    }

    .bairro-card .dropup .btn {
        width: 100%;
    }
}

/* -- Modal de Status de Pedido -- */
.status-options .custom-option {
    position: relative;
}

.status-options .custom-option .form-check-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    cursor: pointer;
}

.status-options .custom-option .form-check-label {
    border: 2px solid #eee;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    width: 100%;
    font-weight: 500;
}

.status-options .custom-option .form-check-input:hover+.form-check-label {
    border-color: var(--primary-color);
}

.status-options .custom-option .form-check-input:checked+.form-check-label {
    border-color: var(--primary-color);
    background-color: #e8f1ff;
    font-weight: 600;
}

/* ===================================================================
   ESTILOS PARA GESTÃO DE MESAS E COMANDAS
=================================================================== */

.mesa-card {
    border: 2px solid #e9ecef;
    border-radius: 1rem;
    color: var(--dark-color);
    transition: all 0.2s ease-in-out;
}

.mesa-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.08);
}

.mesa-card.status-livre {
    border-left: 5px solid var(--success-color);
}

.mesa-card.status-ocupada {
    border-left: 5px solid var(--warning-color);
}

.mesa-card.status-reservada {
    border-left: 5px solid var(--primary-color);
}

.mesa-card.status-livre .fs-1 {
    color: var(--success-color);
}

.mesa-card.status-ocupada .fs-1 {
    color: var(--warning-color);
}

.mesa-card.status-reservada .fs-1 {
    color: var(--primary-color);
}

/* Estilo para as abas na página configurações */

.settings-tabs .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.settings-tabs .nav-link {
    font-weight: 500;
    color: var(--secondary-color);
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.settings-tabs .nav-link.active,
.settings-tabs .nav-item.show .nav-link {
    color: var(--primary-color);
    border-color: transparent;
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

.settings-tabs .nav-link:hover {
    border-bottom-color: #dee2e6;
}

.settings-tabs .tab-content {
    padding-top: 1.5rem;
}

.business-hours .day-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.business-hours .day-row:last-child {
    border-bottom: none;
}

.business-hours .day-label {
    width: 120px;
    font-weight: 500;
    margin-left: 1rem;
}

.business-hours .time-inputs {
    display: flex;
    align-items: center;
}

.business-hours .time-inputs .form-control {
    width: auto;
    padding: 0.375rem;
    text-align: center;
}

/* --- ESTILOS PARA O INTERRUPTOR (TOGGLE SWITCH) --- */
.form-switch .form-check-input {
    width: 2.2em;
    height: 1.25em;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

@media (max-width: 767.98px) {
    .settings-tabs .nav-link {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
        text-align: center;
    }
}

.filter-card {
    position: relative;
    z-index: 5;
}

@media print {

    body {
        font-size: 11pt;
        background-color: #fff !important;
    }

    .sidebar,
    .top-header,
    .no-print {
        display: none !important;
    }

    .main-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    main.p-4 {
        padding: 1cm !important; 
    }

    h4.fw-bold {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid #ccc;
        padding-bottom: 0.5rem;
        font-size: 14pt;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin-bottom: 1.5rem !important;
        page-break-inside: avoid; 
    }

    .card-header,
    .card-body {
        padding: 0 !important;
        background-color: transparent !important;
        border: none !important;
    }
    
    .stat-icon {
        display: none !important;
    }
  
    .card .row {
        display: block; 
    }

    .card .row > [class*="col-"] {
        width: 100% !important;
        flex: 0 0 100%;
        max-width: 100%;
        border-right: none !important;
        text-align: left !important;
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid #eee;
    }

    .card .row > [class*="col-"]:last-child {
        border-bottom: none;
    }
    
    .card .row .h4, .card .row .h6, .card .row p {
        margin-bottom: 0 !important;
    }

    .card .row .h4 {
        font-size: 12pt;
    }

    table {
        width: 100%;
        margin-top: 1rem;
    }
    th, td {
        border: 1px solid #ddd !important;
        padding: 6px;
    }
    thead {
        background-color: #f2f2f2 !important;
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact;
    }

    .progress-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* --- 6. LAYOUT RESPONSIVO --- */
@media (max-width: 991.98px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .main-content-wrapper {
        margin-left: 0;
    }

    #wrapper.sidebar-collapsed .sidebar {
        margin-left: 0;
    }

    .user-card .card-body {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .user-card .dropdown {
        margin-left: 0 !important;
        margin-top: 1rem;
        width: 100%;
    }

    .user-card .dropdown .btn {
        width: 100%;
    }
}