@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { font-family: 'Inter', 'Segoe UI', sans-serif; box-sizing: border-box; }

body {
    margin: 0;
    background: #060d1a;
    color: #cbd5e1;
}

/* ─── LOGIN ───────────────────────────────────────── */
.login-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #060d1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: #0a1628;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    border: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}

.login-box h2 {
    margin-top: 0;
    color: #f1f5f9;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* ─── HEADER ──────────────────────────────────────── */
header {
    background: #0a1628;
    color: #f1f5f9;
    padding: 0 20px;
    height: 50px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.atalhos-barra {
    font-size: 11px;
    color: #475569;
    font-weight: 500;
}

.atalhos-barra span {
    background: rgba(255,255,255,0.08);
    color: #94a3b8;
    padding: 2px 7px;
    border-radius: 4px;
    margin: 0 3px;
    font-weight: 700;
    font-size: 11px;
    border: 1px solid rgba(255,255,255,0.08);
}

/* ─── LAYOUT ──────────────────────────────────────── */
.container {
    display: flex;
    gap: 12px;
    padding: 12px;
    height: calc(100vh - 50px);
}

.box {
    flex: 1;
    background: #0a1628;
    padding: 18px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.06);
}

.scroll-content {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
    padding-right: 4px;
}

.scroll-content::-webkit-scrollbar { width: 4px; }
.scroll-content::-webkit-scrollbar-track { background: transparent; }
.scroll-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

h3 {
    margin-top: 0;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── INPUTS ──────────────────────────────────────── */
input, select {
    width: 100%;
    padding: 10px 12px;
    margin: 5px 0;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: #060d1a;
    color: #e2e8f0;
    outline: none;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s;
}

input:focus, select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

input::placeholder { color: #334155; }

/* ─── BOTÕES ──────────────────────────────────────── */
button {
    width: 100%;
    padding: 10px 16px;
    margin: 5px 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
    font-weight: 600;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    letter-spacing: 0.2px;
}

button:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }
button:active { transform: translateY(1px); }

.btn-danger {
    background: rgba(248,113,113,0.12);
    color: #f87171;
    border: 1px solid rgba(248,113,113,0.2);
}
.btn-danger:hover { background: rgba(248,113,113,0.2); color: #fca5a5; }

.btn-success {
    background: #2563eb;
    color: white;
    border: none;
}
.btn-success:hover { background: #1d4ed8; color: white; }

/* ─── PRODUTOS ────────────────────────────────────── */
.produto {
    border: 1px solid rgba(255,255,255,0.06);
    padding: 12px;
    margin: 6px 0;
    border-radius: 8px;
    background: #060d1a;
    transition: border-color 0.15s;
}

.produto:hover { border-color: rgba(255,255,255,0.12); }

.alerta-estoque {
    background: rgba(248,113,113,0.15);
    color: #f87171;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 6px;
    display: inline-block;
    letter-spacing: 0.3px;
}

.actions { display: flex; gap: 5px; margin-top: 8px; }
.actions button { flex: 1; padding: 6px; margin: 0; font-size: 11px; }

/* ─── CARRINHO ────────────────────────────────────── */
.carrinho-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding: 10px 0;
}

.total-box {
    background: #060d1a;
    padding: 14px;
    border-radius: 10px;
    margin-top: auto;
    border: 1px solid rgba(255,255,255,0.06);
}

.total {
    font-size: 26px;
    font-weight: 700;
    color: #60a5fa;
    margin: 0 0 10px;
    text-align: right;
    letter-spacing: -0.5px;
}

/* ─── RESUMO ──────────────────────────────────────── */
.resumo-linha {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
}

.backup-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.backup-buttons { display: flex; gap: 8px; }
.backup-buttons button { font-size: 11px; padding: 7px; }

/* ─── TOAST ───────────────────────────────────────── */
#toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0a1628;
    color: #e2e8f0;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    display: none;
    z-index: 1100;
}

/* ─── MODAIS ──────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 450px;
    background: #0a1628;
    padding: 24px;
    border-radius: 12px;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}

.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 5;
    backdrop-filter: blur(2px);
}

/* ─── IMPRESSÃO ───────────────────────────────────── */
@media print {
    /* ── RECIBO 80mm (padrão) ── */
    @page { size: 80mm auto; margin: 2mm; }

    /* ── ETIQUETA 105x30mm ── */
    body.print-etiqueta { }
    @page etiqueta { size: 105mm 30mm; margin: 0; }
    body.print-etiqueta #areaImpressaoEtiquetas { page: etiqueta; }

    body * { visibility: hidden; }

    body.print-receipt #receipt,
    body.print-receipt #receipt * { visibility: visible; }

    body.print-fechamento #fechamento,
    body.print-fechamento #fechamento * { visibility: visible; }

    body.print-receipt #receipt,
    body.print-fechamento #fechamento {
        position: fixed !important;
        top: 0 !important; left: 0 !important;
        transform: none !important;
        width: 76mm !important;
        max-width: 76mm !important;
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        color: black !important;
        padding: 2mm !important;
        margin: 0 !important;
        font-size: 12px !important;
    }

    #receipt h2 { color: black !important; font-size: 14px !important; margin: 3px 0 !important; border: none !important; }
    #receipt h3, #fechamento h3 { color: black !important; margin: 5px 0 !important; border: none !important; }
    #receipt button, #fechamento button { display: none !important; }

    body.print-receipt #receipt #itens div,
    body.print-fechamento .fechamento-item-print {
        display: flex !important;
        justify-content: space-between !important;
    }

    /* ── ETIQUETAS 105x30mm (Argox OS-214 Plus) ── */
    body.print-etiqueta * { visibility: hidden; }
    body.print-etiqueta #areaImpressaoEtiquetas,
    body.print-etiqueta #areaImpressaoEtiquetas * { visibility: visible !important; }

    body.print-etiqueta #areaImpressaoEtiquetas {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 105mm !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.print-etiqueta .etiqueta-preview {
        width: 105mm !important;
        height: 30mm !important;
        max-height: 30mm !important;
        padding: 1mm 2mm !important;
        margin: 0 !important;
        border: none !important;
        background: white !important;
        color: black !important;
        page-break-inside: avoid !important;
        page-break-after: always !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    body.print-etiqueta .etiqueta-empresa {
        font-size: 13px !important;
        font-weight: bold !important;
        margin: 0 0 1mm !important;
        width: 100% !important;
        text-align: center !important;
    }

    body.print-etiqueta .etiqueta-nome {
        font-size: 20px !important;
        font-weight: bold !important;
        margin: 0 0 1mm !important;
        line-height: 1.1 !important;
        text-align: center !important;
        width: 100% !important;
    }

    body.print-etiqueta .etiqueta-barcode {
        height: 10mm !important;
        width: 100mm !important;
        margin: 0 auto !important;
    }

    body.print-etiqueta .etiqueta-cod-num {
        font-size: 9px !important;
        margin: 0 !important;
    }

    body.print-etiqueta .etiqueta-preco {
        font-size: 28px !important;
        font-weight: bold !important;
        line-height: 1 !important;
        margin: 1mm 0 0 !important;
    }

    body.print-etiqueta .etiqueta-preco small {
        font-size: 14px !important;
    }
}