:root {
    --primary-color: rgb(255, 134, 1);
    --secondary-color: #f8f9fa;
    --dark-color: #343a40;
    --light-bg: #eef2f7;
}

body {
    background-color: var(--light-bg);
    color: #3f4254;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #1a1a1a;
}

.bg-primary h1,
.bg-primary h2,
.bg-primary h3,
.bg-primary h4,
.bg-primary h5,
.bg-primary h6,
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6,
.split-left h1,
.split-left h2,
.split-left h3,
.split-left h4,
.split-left h5,
.split-left h6 {
    color: #fff !important;
}

.sidebar {
    height: 100vh;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--dark-color);
    padding-top: 20px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
    overflow-x: hidden;
}

body.sidebar-collapsed .sidebar {
    width: 70px;
}

body.sidebar-collapsed .sidebar .sidebar-logo {
    display: none;
}

body.sidebar-collapsed .sidebar a {
    text-align: center;
    padding: 15px 0;
}

body.sidebar-collapsed .sidebar a i {
    margin-right: 0 !important;
    font-size: 1.25rem;
}

body.sidebar-collapsed .sidebar a span {
    display: none;
}

body.sidebar-collapsed .sidebar hr {
    margin: 1rem 0.5rem !important;
}

.sidebar a {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 16px;
    color: #c2c7d0;
    display: block;
    transition: 0.3s;
}

.sidebar a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar a.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* Estado de onboarding pendente: links bloqueados */
.sidebar a.sidebar-locked {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: auto;
    /* mantém para mostrar o tooltip */
    display: flex;
    align-items: center;
}

.sidebar a.sidebar-locked:hover {
    background-color: transparent;
    color: #c2c7d0;
}

.sidebar a.sidebar-locked i.ms-auto {
    margin-left: auto !important;
}

/* ── MODO ONBOARDING: sidebar oculta, conteúdo em tela cheia ── */
body.onboarding-mode .sidebar,
body.onboarding-mode .btn-toggle-arrow {
    display: none !important;
}

body.onboarding-mode .content {
    margin-left: 0 !important;
    padding-top: 64px !important;
    background: linear-gradient(135deg, #f0f4ff 0%, #f8f5ff 50%, #fff8f0 100%);
    min-height: 100vh;
}

body.onboarding-mode .navbar {
    display: none !important;
}

.content {
    margin-left: 250px;
    padding: 0 0 20px 0;
    transition: all 0.3s ease-in-out;
    min-height: 100vh;
}

body.sidebar-collapsed .content {
    margin-left: 70px !important;
}

.navbar {
    padding: 1.2rem 1.5rem;
}

/* Novo Estilo: Botão Seta Flutuante */
.btn-toggle-arrow {
    position: fixed;
    left: 234px;
    /* Ajuste fino na borda */
    top: 25px;
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    /* Sempre no topo */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-toggle-arrow:hover {
    background-color: #e67501;
    transform: scale(1.15);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

body.sidebar-collapsed .btn-toggle-arrow {
    left: 55px;
}

body.sidebar-collapsed .btn-toggle-arrow i::before {
    content: "\F285";
    /* Ícone bi-chevron-right */
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #e67501;
    border-color: #e67501;
    box-shadow: 0 0 0 0.25rem rgba(255, 134, 1, 0.5);
}

.card {
    border: none;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.07);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

/* Base Shadow Overrides - Enhancing for better visibility */
.shadow-sm {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08) !important;
}

.shadow {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12) !important;
}

.shadow-lg {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18) !important;
}

/* Special elevation for dark/important cards */
.card.bg-dark,
.card.bg-primary,
.card-pdv,
#caixa-bar {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

/* PDV Specific Card Borders */
.card-pdv {
    border: 1px solid rgba(255, 134, 1, 0.25) !important;
}

.card-pdv.bg-primary {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Subtle border for all cards to enhance elevation */
.card {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: bold;
}

.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
    background-color: var(--primary-color);
}

/* PDV Styles */
.product-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.product-item:hover {
    transform: translateY(-5px);
}

/* Receipt Printing - Handled by recibo.php itself */
.no-print-global {
    display: none;
}

#receipt-print {
    width: 80mm;
    background: white;
    padding: 10px;
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
}

.receipt-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
}

.receipt-footer {
    text-align: center;
    border-top: 1px dashed #000;
    margin-top: 10px;
    padding-top: 10px;
}

.qr-code-container {
    text-align: center;
    margin-top: 10px;
}

.qr-code-container img {
    width: 150px;
}

/* Select2 Bootstrap 5 Styling */
.select2-container--default .select2-selection--single {
    height: 45px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #212529;
    padding-left: 0;
    line-height: normal;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 10px;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #6c757d !important;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.25) !important;
    outline: 0;
}

.select2-dropdown {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1060;
}

.select2-results__option {
    padding: 10px 15px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #6c757d !important;
    color: #fff !important;
}

.select2-search--dropdown {
    padding: 10px;
}

.select2-search--dropdown .select2-search__field {
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #6c757d !important;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.15);
}

/* Letras Maiúsculas */
.text-uppercase-input {
    text-transform: uppercase;
}

/* Input Utils */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .form-control {
    padding-right: 40px;
}

.clear-btn,
.password-toggle {
    position: absolute;
    right: 0;
    width: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: #adb5bd;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    z-index: 10;
}

.clear-btn:hover,
.password-toggle:hover {
    color: var(--primary-color);
}

.clear-btn.d-none {
    display: none !important;
}

/* Loading Overlay Global */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-in-out;
}

.loading-overlay i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}

.loading-overlay h4 {
    color: var(--dark-color);
    font-weight: 600;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

/* Custom Premium Tabs */
.nav-tabs {
    border-bottom: 2px solid #f0f0f0;
    gap: 10px;
}

.nav-tabs .nav-link {
    border: none !important;
    color: #64748b !important;
    font-weight: 600;
    padding: 12px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: transparent !important;
    font-size: 0.95rem;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: rgba(var(--primary-color-rgb), 0.05) !important;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color) !important;
}

.nav-tabs .nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 10px 10px 0 0;
}

.nav-tabs .nav-link i {
    font-size: 1.1rem;
    vertical-align: middle;
}

/* Estilização Global de Campos de Formulário */
.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 1px solid #a0a0a0 !important;
    border-radius: 8px !important;
    padding: 0.6rem 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.select2-container--default .select2-selection--single {
    height: auto !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.5 !important;
    padding-left: 0 !important;
    padding-top: 2px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
}

/* Efeito de Foco nos Campos */
.form-control:focus,
.form-select:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #6c757d !important;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.15) !important;
    outline: 0;
}

/* Ajuste para inputs com máscara */
input.mask-money {
    font-weight: 600;
}