/* -------------------------------------------------------------
 * Stylesheet: Sistema PDV - Frente de Caixa Offline / SaaS Go + Postgres
 * Author: Antigravity AI
 * Aesthetic: Warm Bakery Theme (Amber & Coffee Brown) / Glassmorphism
 * ------------------------------------------------------------- */

:root {
    --font-primary: 'Outfit', sans-serif;
    
    /* Configurações padrão de Tema Claro (Bakery Cream) */
    --bg-gradient-1: #faf6f0;
    --bg-gradient-2: #f2e7da;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(184, 115, 51, 0.12);
    --card-shadow: rgba(85, 50, 20, 0.08);
    
    --text-primary: #3c2f2f;
    --text-secondary: #705c53;
    --text-muted: #9e8b83;
    
    --primary: hsl(35, 95%, 45%); /* Amber/Gold */
    --primary-hover: hsl(35, 95%, 38%);
    --primary-light: rgba(217, 119, 6, 0.12);
    
    --success: hsl(150, 70%, 35%);
    --success-light: rgba(16, 185, 129, 0.1);
    
    --warning: hsl(45, 90%, 48%);
    --warning-light: rgba(245, 158, 11, 0.1);
    
    --danger: hsl(360, 75%, 45%);
    --danger-light: rgba(220, 38, 38, 0.1);
    
    --border-color: rgba(184, 115, 51, 0.15);
    --glass-blur: 16px;
    --transition-speed: 0.2s;
}

body.dark-theme {
    --bg-gradient-1: #150f0d;
    --bg-gradient-2: #241914;
    --card-bg: rgba(43, 31, 26, 0.7);
    --card-border: rgba(245, 158, 11, 0.08);
    --card-shadow: rgba(0, 0, 0, 0.45);
    
    --text-primary: #fbf8f5;
    --text-secondary: #d6c6b9;
    --text-muted: #8d7a6e;
    
    --primary: hsl(38, 95%, 55%);
    --primary-hover: hsl(38, 95%, 62%);
    --primary-light: rgba(245, 158, 11, 0.15);
    
    --success: hsl(150, 75%, 42%);
    --success-light: rgba(16, 185, 129, 0.15);
    
    --warning: hsl(45, 90%, 55%);
    --warning-light: rgba(245, 158, 11, 0.15);
    
    --danger: hsl(360, 80%, 55%);
    --danger-light: rgba(239, 68, 68, 0.15);
    
    --border-color: rgba(245, 158, 11, 0.12);
}

/* Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
    background-attachment: fixed;
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    transition: background var(--transition-speed), color var(--transition-speed);
}

/* Controle dos ícones do alternador de temas */
body.light-theme .moon-icon {
    display: none;
}
body.dark-theme .sun-icon {
    display: none;
}

/* Botões */
.btn {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 0.9rem 1.8rem;
    font-size: 1.1rem;
    border-radius: 0.9rem;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--text-muted);
    color: var(--card-bg);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    color: var(--text-primary);
    background: rgba(217, 119, 6, 0.05);
    border-color: var(--primary);
}

.btn-danger {
    background: var(--danger-light);
    border-color: rgba(220, 38, 38, 0.2);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.flex-1 {
    flex: 1;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px var(--card-shadow);
    transition: transform var(--transition-speed), background var(--transition-speed);
}

/* -------------------------------------------------------------
 * 1. TELAS DE LOGIN & BLOQUEIO
 * ------------------------------------------------------------- */
.activation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 12, 10, 0.7);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.activation-card {
    width: 100%;
    max-width: 460px;
    text-align: center;
    padding: 2.5rem;
    animation: slideUp 0.4s ease;
    border-color: rgba(217, 119, 6, 0.3);
}

.activation-icon {
    width: 4rem;
    height: 4rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.activation-icon i {
    width: 2rem;
    height: 2rem;
}

.activation-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.activation-sub {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, .form-group select {
    width: 100%;
    min-width: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    outline: none;
    transition: all 0.2s;
}

body.light-theme .form-group input, body.light-theme .form-group select {
    background: rgba(255, 255, 255, 0.95);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(217, 119, 6, 0.25);
}

.error-msg {
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 600;
    display: none;
    margin-top: 0.25rem;
}

.success-msg {
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 600;
    display: none;
    margin-top: 0.25rem;
}

.demo-keys-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(217, 119, 6, 0.05);
    border: 1px dashed rgba(217, 119, 6, 0.25);
    border-radius: 0.75rem;
    font-size: 0.8rem;
    text-align: left;
}

.demo-keys-box h5 {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.demo-keys-box ul {
    list-style: none;
}

.demo-keys-box li {
    margin-bottom: 0.25rem;
}

.demo-keys-box code {
    background: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

body.light-theme .demo-keys-box code {
    background: rgba(0, 0, 0, 0.06);
}

.demo-keys-box code:hover {
    background: var(--primary);
    color: white;
}

/* -------------------------------------------------------------
 * 2. NAVBAR DO PDV
 * ------------------------------------------------------------- */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1rem;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 1rem;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    width: 2.75rem;
    height: 2.75rem;
    background: var(--primary);
    color: white;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
}

.nav-logo i {
    width: 1.5rem;
    height: 1.5rem;
}

.nav-left h2 {
    font-size: 1.25rem;
    font-weight: 800;
}

.nav-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.barcode-status-indicator {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

body.light-theme .barcode-status-indicator {
    background: rgba(0, 0, 0, 0.03);
}

.barcode-status-indicator.active {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-light);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clock-display {
    background: rgba(0, 0, 0, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-family: monospace;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    margin-right: 0.5rem;
}

body.light-theme .clock-display {
    background: rgba(0, 0, 0, 0.04);
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 0.9rem;
    height: 2.5rem;
    width: auto;
    min-width: 2.5rem;
    border-radius: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}



body.light-theme .nav-btn {
    background: rgba(255, 255, 255, 0.9);
}

.nav-btn i {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.nav-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.btn-danger-nav {
    color: var(--danger);
    background: var(--danger-light);
    border-color: rgba(220, 38, 38, 0.15);
}

.btn-danger-nav:hover {
    background: var(--danger);
    color: white;
}


/* -------------------------------------------------------------
 * 3. NAVEGAÇÃO DE ABAS
 * ------------------------------------------------------------- */
.tab-headers {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-link {
    background: none;
    border: none;
    padding: 0.6rem 1.2rem;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.6rem;
    transition: all 0.2s;
}

.tab-link:hover {
    color: var(--text-primary);
    background: rgba(217, 119, 6, 0.05);
}

.tab-link.active {
    color: white;
    background: var(--primary);
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.2);
}

.main-tab-content {
    display: none;
}

.main-tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* -------------------------------------------------------------
 * 4. WORKSPACE DO PDV (CAIXA)
 * ------------------------------------------------------------- */
.pos-workspace {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

@media (max-width: 1024px) {
    .pos-workspace {
        grid-template-columns: 1fr;
    }
}

.pos-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.pos-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

/* Carrinho */
.cart-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-table-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

/* Rodapé do Carrinho com Total Prévio e Checkout */
.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    gap: 1.5rem;
}

.cart-total-preview-box {
    display: flex;
    flex-direction: column;
}

.cart-total-preview-box .total-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cart-total-preview-box .total-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

#btn-go-to-checkout {
    padding: 1rem 2rem;
    font-size: 1.15rem;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.25);
    flex: 1;
    max-width: 320px;
}

/* Modal de Checkout customizado */
.modal-checkout-content {
    max-width: 800px !important;
    width: 95% !important;
}

.modal-checkout-content .payment-summary {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}


.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.cart-table th, .cart-table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-table th {
    background: rgba(217, 119, 6, 0.04);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.cart-table tbody tr:hover {
    background: rgba(217, 119, 6, 0.02);
}

.cart-qty-input {
    width: 60px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-weight: 700;
    text-align: center;
    padding: 0.25rem;
    border-radius: 0.35rem;
    outline: none;
}

body.light-theme .cart-qty-input {
    background: white;
}

/* Painel de Cálculo e Pagamento */
.payment-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .calc-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.calc-box {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.6rem 1rem;
    display: flex;
    flex-direction: column;
}

body.light-theme .calc-box {
    background: white;
}

.calc-box label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.calc-value {
    font-size: 1.25rem;
    font-weight: 800;
    margin-top: 0.15rem;
}

.calc-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 800;
    outline: none;
    width: 100%;
}

.highlight-total {
    background: var(--primary-light) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.highlight-total label {
    color: var(--primary) !important;
}

.payment-details-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
}

@media (max-width: 700px) {
    .payment-details-grid {
        grid-template-columns: 1fr;
    }
}

.payment-methods h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.method-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.65rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

body.light-theme .method-btn {
    background: white;
}

.method-btn i {
    width: 1.2rem;
    height: 1.2rem;
}

.method-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.method-btn.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* Garante que o estado ativo seja visível no tema claro */
body.light-theme .method-btn.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.change-calculator {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

body.light-theme .change-calculator {
    background: white;
}

.change-calculator label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.change-calculator input {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1.2rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    outline: none;
    width: 100%;
}

body.light-theme .change-calculator input {
    background: #fafafa;
}

.change-display-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.85rem;
}

.change-display-row strong {
    font-size: 1.25rem;
    color: var(--success);
    font-weight: 800;
}

.action-buttons-row {
    display: flex;
    gap: 0.75rem;
}

/* Lado Direito do Caixa */
.search-scan-panel h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.search-input-wrapper input {
    flex: 1;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    outline: none;
}

body.light-theme .search-input-wrapper input {
    background: white;
}

.shortcuts-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    overflow-y: auto;
    max-height: 300px;
}

.shortcut-btn {
    background: rgba(217, 119, 6, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    font-family: var(--font-primary);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    transition: all 0.15s;
    height: 70px;
}

body.light-theme .shortcut-btn {
    background: white;
}

.shortcut-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.shortcut-btn strong {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shortcut-btn span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.simulator-panel h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.simulator-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.simulator-controls select {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

body.light-theme .simulator-controls select {
    background: white;
}

/* -------------------------------------------------------------
 * 5. SEÇÃO DE GERENCIAMENTO (CATÁLOGO, ESTOQUE, RELATÓRIOS)
 * ------------------------------------------------------------- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(217, 119, 6, 0.04);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
}

.data-table tbody tr:hover {
    background: rgba(217, 119, 6, 0.02);
}

.table-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.action-row-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.35rem;
    transition: all 0.1s;
}

.action-row-btn:hover {
    color: var(--primary);
    background: rgba(217, 119, 6, 0.05);
}

.action-row-btn.delete-btn:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.action-row-btn i {
    width: 1.05rem;
    height: 1.05rem;
}

/* Faturamento Panel */
.faturamento-summary-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.fat-card {
    text-align: center;
    padding: 1.5rem;
}

.fat-card span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
}

.fat-card h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 0.25rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Modais */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    overflow: hidden;
}

.modal.active {
    display: flex;
    animation: fadeIn var(--transition-speed) ease forwards;
}

.modal-content {
    width: 95%;
    max-width: 500px;
    padding: 2rem;
    background: var(--bg-gradient-2);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp var(--transition-speed) ease forwards;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.modal-lg {
    max-width: 1080px;
}

/* Reduzir preenchimento e fonte no relatório gerencial para caber sem rolagem */
#modal-manager-cash-reports .data-table th,
#modal-manager-cash-reports .data-table td {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
}

/* Estilo para códigos de barras na tabela */
.data-table td code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: 0.35rem;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

body.dark-theme .data-table td code {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

/* Listagem de itens vendidos no histórico */
.sale-items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.sale-item-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

body.dark-theme .sale-item-tag {
    background: rgba(255, 255, 255, 0.04);
}

.sale-item-tag strong {
    color: var(--primary);
    margin-left: 0.25rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

@media (max-width: 500px) {
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.modal-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.admin-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cursor-pointer {
    cursor: pointer;
}

.text-center { text-align: center; }
.font-lg {
    font-size: 2rem !important;
    font-weight: 800 !important;
    padding: 0.5rem !important;
}

.quick-weights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

/* -------------------------------------------------------------
 * 6. CUPOM FISCAL TÉRMICO
 * ------------------------------------------------------------- */
.receipt-modal-content {
    max-width: 380px;
    padding: 1.5rem;
}

.thermal-receipt {
    background: #ffffff;
    color: #000000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    padding: 15px 10px;
    border-radius: 4px;
    line-height: 1.3;
}

.thermal-receipt p, .thermal-receipt span, .thermal-receipt td, .thermal-receipt strong {
    color: #000000 !important;
}

.receipt-header {
    text-align: center;
    margin-bottom: 8px;
}

.receipt-header h4 {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 2px;
}

.receipt-subheader {
    font-size: 11px;
    margin-bottom: 4px;
}

.receipt-details {
    text-align: left;
    margin: 4px 0;
    font-size: 10px;
}

.receipt-divider {
    letter-spacing: -1px;
    margin: 4px 0;
    text-align: center;
}

.receipt-items-table {
    width: 100%;
}

.receipt-tr {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.receipt-tr.header {
    font-weight: bold;
}

.col-desc {
    flex: 1.2;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-qty {
    flex: 0.8;
    text-align: center;
}

.col-total {
    flex: 0.8;
    text-align: right;
}

.receipt-item-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}

.receipt-item-main {
    display: flex;
    justify-content: space-between;
}

.receipt-item-detail {
    font-size: 9px;
    color: #555 !important;
    padding-left: 10px;
}

.receipt-footer-calc {
    margin-top: 5px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.receipt-row.total {
    font-size: 13px;
    font-weight: bold;
    margin: 6px 0;
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    padding: 4px 0;
}

.receipt-footer-msg {
    text-align: center;
    margin-top: 15px;
}

.receipt-software-tag {
    font-size: 8px;
    margin-top: 10px;
    color: #666 !important;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

@media print {
    /* Ocultar todos os elementos filhos diretos do body por padrão */
    body > * {
        display: none !important;
    }
    
    /* Exibir apenas o modal do cupom */
    body > #modal-receipt {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 80mm !important;
        height: auto !important;
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    /* Resetar estilos do modal-content para não imprimir bordas, sombras ou gradientes */
    #modal-receipt .modal-content {
        display: block !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        border-radius: 0 !important;
    }
    
    /* Garantir que todos os elementos de texto do cupom fiquem visíveis e na cor preta */
    #modal-receipt, #modal-receipt * {
        visibility: visible !important;
        color: #000000 !important;
    }
    
    /* Ocultar elementos marcados como print-hidden (cabeçalho, botões) */
    #modal-receipt .print-hidden, #modal-receipt .print-hidden * {
        display: none !important;
    }
    
    /* Configuração do contêiner do cupom térmico */
    #receipt-print-area {
        display: block !important;
        width: 80mm !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: #ffffff !important;
    }
}

/* -------------------------------------------------------------
 * 7. RESPONSIVIDADE E AJUSTES DE TELAS
 * ------------------------------------------------------------- */

.modal-table-container {
    max-height: 50vh;
    overflow-y: auto;
}

.modal-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.modal-actions-bar .search-box {
    flex: 1;
    min-width: 200px;
}

.modal-actions-bar .search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    outline: none;
}
body.light-theme .modal-actions-bar .search-box input {
    background: white;
}

/* Media Queries de Responsividade */

/* Telas de Tablets (menores que 992px) */
@media (max-width: 992px) {
    .nav-btn span {
        display: none; /* Oculta textos dos botões da navbar */
    }
    
    .nav-btn {
        min-width: 2.5rem;
        padding: 0.5rem;
        gap: 0;
    }
    
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .nav-left h2 {
        font-size: 1.1rem;
    }
    
    .clock-display {
        font-size: 0.95rem;
        padding: 0.5rem 0.75rem;
        margin-right: 0.25rem;
    }
}

/* Telas Médias/Pequenas (menores que 768px) */
@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
        max-height: 95vh;
    }
    
    .modal-lg {
        max-width: 95%;
    }
}

/* Telas de Celulares (menores que 600px) */
@media (max-width: 600px) {
    .faturamento-summary-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .fat-card {
        padding: 1rem;
    }
}

/* Telas Pequenas de Celulares (menores que 576px) */
@media (max-width: 576px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .nav-left {
        justify-content: space-between;
        width: 100%;
    }
    
    .nav-center {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .nav-right {
        justify-content: space-between;
        width: 100%;
        gap: 0.25rem;
    }

    .clock-display {
        flex: 1;
        text-align: center;
        margin-right: 0;
    }
    
    .payment-details-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .modal-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-actions-bar .search-box {
        width: 100%;
    }
    
    .modal-actions-bar .btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .admin-buttons-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Telas muito pequenas (menores que 480px) */
@media (max-width: 480px) {
    .activation-card {
        padding: 1.5rem;
    }
}

/* --- Estilos para Alertas de Estoque Baixo --- */
.shortcut-btn.low-stock {
    border: 1.5px dashed var(--danger) !important;
    background: rgba(220, 38, 38, 0.08) !important;
    position: relative;
}

body.light-theme .shortcut-btn.low-stock {
    background: #fff5f5 !important;
}

.shortcut-low-stock-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.65rem !important;
    font-weight: 700;
    color: var(--danger) !important;
    display: flex;
    align-items: center;
    gap: 2px;
}

.row-low-stock {
    background: rgba(220, 38, 38, 0.15) !important;
}

.row-low-stock:hover {
    background: rgba(220, 38, 38, 0.22) !important;
}

.low-stock-warning-text {
    font-size: 0.75rem;
    color: var(--danger);
    font-weight: 600;
    margin-top: 2px;
    display: block;
}

.low-stock-icon {
    color: var(--danger);
    margin-right: 4px;
    vertical-align: middle;
    width: 0.9rem;
    height: 0.9rem;
}

/* --- Estilos para o Crachá do Operador (Navbar) --- */
.operator-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(184, 115, 51, 0.06);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

body.dark-theme .operator-badge {
    background: rgba(245, 158, 11, 0.05);
}

.operator-badge i {
    width: 0.9rem;
    height: 0.9rem;
    color: var(--primary);
    flex-shrink: 0;
}

.role-pill {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Variações de Cores por Perfil */
.role-pill.role-admin {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.role-pill.role-manager {
    background: rgba(217, 119, 6, 0.12);
    color: var(--primary);
}

.role-pill.role-cashier {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

/* --- Barra de Status (Rodapé) --- */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    margin-top: 1rem;
    border-radius: 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    background: rgba(184, 115, 51, 0.02);
}

body.dark-theme .status-bar {
    background: rgba(245, 158, 11, 0.02);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--success);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.status-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-version {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Layout da Janela de Configurações em Duas Colunas */
.modal-settings-content {
    max-width: 820px !important;
    width: 95% !important;
}

.modal-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1rem;
}

.settings-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-settings-content .backup-section {
    padding: 0.25rem 0;
}

.modal-settings-content .backup-section p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.modal-settings-content .backup-section h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.modal-settings-content .modal-divider {
    margin: 0.5rem 0;
    border: 0;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .modal-settings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}


