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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* HEADER */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.header-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 16px;
    font-weight: bold;
}

.account-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 13px;
}

.account-bar button {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    background: transparent;
    color: white;
    cursor: pointer;
}

.login-screen {
    display: grid;
    min-height: calc(100vh - 20px);
    place-items: center;
}

.login-screen[hidden] {
    display: none;
}

.login-card {
    width: min(100%, 440px);
    padding: 24px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-card h1 {
    margin-bottom: 12px;
    color: #4c51bf;
    font-size: 24px;
    text-align: center;
}

.login-card > p {
    margin-bottom: 16px;
    color: #4a5568;
    line-height: 1.5;
}

.login-card label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
}

.login-email {
    overflow-wrap: anywhere;
    font-weight: 600;
}

.login-message {
    min-height: 24px;
    color: #9b2c2c;
    font-size: 14px;
}

.login-note {
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
}

/* TABS */
.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

/* CONTEÚDO DAS ABAS */
.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* SECTIONS */
.section {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.section:last-child {
    border-bottom: none;
}

.section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

/* INPUTS */
.form-input, .input-group input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-input:focus, .input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-group label {
    align-self: center;
    font-weight: 600;
    color: #333;
}

.input-group input {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

/* BOTÕES */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-close {
    background: #f56565;
    color: white;
    padding: 10px 20px;
    margin-top: 10px;
}

/* CARRINHO */
.cart {
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 15px;
    min-height: 100px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.cart-item-code {
    font-size: 12px;
    color: #999;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-qty button {
    background: #e8e8e8;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.cart-item-qty button:hover {
    background: #667eea;
    color: white;
}

.cart-item-price {
    font-weight: 600;
    color: #48bb78;
    min-width: 80px;
    text-align: right;
}

/* TOTAL */
.total-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
}

.total-box h3 {
    font-size: 24px;
}

.total-box span {
    font-size: 28px;
    font-weight: bold;
}

.pix-box {
    padding: 18px;
    margin-bottom: 15px;
    border: 1px solid #c6f6d5;
    border-radius: 8px;
    background: #f0fff4;
}

.pix-box h3 {
    margin-bottom: 8px;
    color: #276749;
}

.pix-box label {
    display: block;
    margin: 10px 0 5px;
    color: #333;
    font-weight: 600;
}

.pix-description,
.pix-result,
.pix-message {
    margin-bottom: 10px;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.5;
}

.pix-code {
    display: block;
    width: 100%;
    min-height: 90px;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font: 13px/1.5 monospace;
    overflow-wrap: anywhere;
    resize: vertical;
}

.pix-code[hidden] {
    display: none;
}

.pix-box .btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.payment-modal[hidden] {
    display: none;
}

.payment-modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    background: rgba(26, 32, 44, 0.72);
}

.payment-dialog {
    position: relative;
    width: min(100%, 480px);
    max-height: 100%;
    padding: 24px;
    overflow-y: auto;
    border-radius: 12px;
    background: white;
    text-align: center;
}

.payment-dialog h2 {
    margin: 4px 32px 8px;
    color: #276749;
}

.payment-close {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: #edf2f7;
    cursor: pointer;
}

.payment-amount {
    margin: 12px 0;
    color: #276749;
    font-size: 22px;
    font-weight: 700;
}

.payment-qr {
    display: block;
    width: min(100%, 280px);
    height: auto;
    margin: 12px auto 18px;
    image-rendering: pixelated;
}

.payment-warning {
    margin: 12px 0;
    color: #975a16;
    font-size: 13px;
    line-height: 1.5;
}

.receipt-preview {
    margin: 16px 0;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    text-align: left;
}

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

.receipt-header h1 {
    margin-bottom: 6px;
    font-size: 20px;
}

.receipt-header p,
.receipt-thanks {
    font-size: 12px;
}

.receipt-table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
    font-size: 12px;
}

.receipt-table th,
.receipt-table td {
    padding: 7px 4px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    overflow-wrap: anywhere;
}

.receipt-total {
    margin: 14px 0;
    font-size: 18px;
    text-align: right;
}

.receipt-thanks {
    margin-top: 18px;
    text-align: center;
}

.receipt-print {
    display: none;
}

@media print {
    @page {
        margin: 15mm;
    }

    body * {
        visibility: hidden !important;
    }

    #receiptPrintArea,
    #receiptPrintArea * {
        visibility: visible !important;
    }

    #receiptPrintArea {
        position: absolute;
        top: 0;
        left: 0;
        display: block !important;
        width: 100%;
        padding: 0;
        color: #000;
        background: #fff;
        font-family: Arial, sans-serif;
        font-size: 12px;
    }

    .receipt-table {
        font-size: 11px;
    }
}

/* LISTA DE PRODUTOS */
.produtos-list {
    display: grid;
    gap: 10px;
}

.produto-item {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.produto-info {
    flex: 1;
}

.produto-nome {
    font-weight: 600;
    color: #333;
}

.produto-codigo {
    font-size: 12px;
    color: #999;
}

.produto-preco {
    font-weight: 600;
    color: #48bb78;
    margin: 0 15px;
    min-width: 80px;
    text-align: right;
}

.produto-estoque {
    font-size: 12px;
    color: #666;
    min-width: 60px;
    text-align: center;
}

.produto-actions {
    display: flex;
    gap: 8px;
}

.produto-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-edit {
    background: #ffc107;
    color: white;
}

.btn-delete {
    background: #f56565;
    color: white;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete:hover {
    background: #e53e3e;
}

/* HISTÓRICO */
.historico-list {
    display: grid;
    gap: 10px;
}

.historico-item {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #48bb78;
}

.historico-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.historico-data {
    color: #999;
    font-size: 12px;
}

.historico-total {
    color: #48bb78;
    font-weight: bold;
}

.historico-itens {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* RELATÓRIO */
.relatorio-box {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.relatorio-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.relatorio-item:last-child {
    border-bottom: none;
}

.relatorio-label {
    font-weight: 600;
    color: #333;
}

.relatorio-valor {
    color: #48bb78;
    font-weight: bold;
    font-size: 16px;
}

/* CÂMERA */
#cameraContainer {
    text-align: center;
    margin: 15px 0;
}

#video {
    border-radius: 8px;
    margin-bottom: 10px;
}

/* RESPONSIVO */
@media (max-width: 600px) {
    .payment-dialog {
        padding: 20px 16px;
    }

    .header h1 {
        font-size: 22px;
    }

    .header-info {
        flex-direction: column;
        gap: 10px;
        font-size: 14px;
    }

    .tab-btn {
        min-width: 80px;
        padding: 12px 8px;
        font-size: 12px;
    }

    .tabs {
        overflow-x: auto;
    }

    .cart-item {
        flex-wrap: wrap;
    }

    .cart-item-price {
        width: 100%;
        text-align: left;
        margin-top: 8px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group label {
        align-self: flex-start;
    }

    .input-group input {
        width: 100%;
    }

    .produto-item {
        flex-wrap: wrap;
    }

    .produto-actions {
        width: 100%;
        margin-top: 8px;
    }

    .btn {
        font-size: 12px;
        padding: 10px 15px;
    }
}
