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

body {
    font-family: -apple-system, Segoe UI, Roboto, sans-serif;
    background-image: linear-gradient(to right, rgb(165, 49, 95), rgb(141, 111, 111), rgb(146, 9, 146)), url("../images/bglgt.png");
    background-blend-mode: soft-light;
    color: #1f2937;
    line-height: 1.5;
    padding-bottom: 40px;
}

.container { max-width: 600px; margin: 0 auto; padding: 16px; }

h1 { font-size: 1.6rem; text-align: center; margin: 12px 0; }
.subtitle { text-align: center; color: #1c2027; margin-bottom: 16px; font-weight: 500;}
h2 { font-size: 1.1rem; margin-bottom: 12px; }

.card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

input[type=text], input[type=password], input[type=file], textarea, select {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
}

/* Produtos no cardápio */
.produto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    gap: 10px;
}
.produto:last-child { border-bottom: none; }
.produto-info { display: flex; flex-direction: column; }
.produto-info small { color: #6b7280; }
.preco { color: #16a34a; font-weight: bold; margin-top: 2px; }

.qtd-controle { display: flex; align-items: center; gap: 8px; }
.btn-qtd {
    width: 38px; height: 38px;
    border: none; border-radius: 50%;
    background: #2563eb; color: #fff;
    font-size: 1.3rem; cursor: pointer;
}
.qtd {
    width: 44px; text-align: center;
    padding: 8px 0; margin: 0;
    border: 1px solid #d1d5db; border-radius: 8px;
}

.total-card h2 { text-align: center; }
#total { color: #16a34a; }

/* PIX */
.pix-box textarea { font-size: .8rem; resize: none; height: 80px; }
.btn-copiar {
    width: 100%; padding: 12px;
    background: #f59e0b; color: #fff;
    border: none; border-radius: 10px;
    font-size: 1rem; cursor: pointer; margin-bottom: 16px;
}
.btn-enviar {
    display: block; width: 100%; text-align: center;
    padding: 14px; background: #16a34a; color: #fff;
    border: none; border-radius: 10px;
    font-size: 1.05rem; cursor: pointer; text-decoration: none;
}

.link-admin { display: block; text-align: center; color: #9ca3af; margin-top: 20px; font-size: .9rem; }

.sucesso { text-align: center; }
.sucesso h1 { color: #16a34a; }

/* Admin */
.admin-header { display: flex; justify-content: space-between; align-items: center; }
.produto-admin {
    display: flex; flex-wrap: wrap; gap: 6px;
    align-items: center; padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.produto-admin input { margin: 0; flex: 1; min-width: 100px; }
.btn-pequeno {
    padding: 8px 12px; background: #2563eb; color: #fff;
    border: none; border-radius: 8px; cursor: pointer;
    text-decoration: none; font-size: .9rem;
}
.btn-excluir { background: #dc2626; }

.pedido {
    border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 12px; margin-bottom: 12px;
}
.pedido.confirmado { border-color: #16a34a; background: #f0fdf4; }
.pedido-topo { display: flex; justify-content: space-between; }
.badge { background: #e5e7eb; padding: 2px 10px; border-radius: 20px; font-size: .8rem; }
.pedido pre { white-space: pre-wrap; font-family: inherit; margin: 8px 0; color: #374151; }
.pedido-acoes { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.pedido-acoes select { width: auto; margin: 0; }

/* ===== ABAS ===== */
.abas {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.aba-btn {
    flex: 1;
    padding: 14px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    position: relative;
    transition: all .15s;
}
.aba-btn.ativa {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.contador {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: .75rem;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 20px;
    margin-left: 4px;
}

/* ===== DRAG-AND-DROP PRODUTOS ===== */
.produto-admin-linha {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    background: #fff;
}
.produto-admin-linha .produto-admin {
    border: none;
    padding: 0;
    flex: 1;
}
.alca-arrasto {
    cursor: grab;
    color: #9ca3af;
    font-size: 1.4rem;
    padding: 0 4px;
    touch-action: none;       /* essencial p/ arraste no celular */
    user-select: none;
}
.alca-arrasto:active { cursor: grabbing; }

/* Aparência durante o arraste (classes do SortableJS) */
.sortable-ghost {
    opacity: .4;
    background: #dbeafe;
}
.sortable-chosen {
    background: #eff6ff;
    border-radius: 10px;
}

.aviso-ordem {
    display: none;
    text-align: center;
    color: #16a34a;
    font-weight: 600;
    margin-top: 10px;
}

/* Botões de pagamento lado a lado */
.pix-botoes { display: flex; gap: 8px; margin-bottom: 12px; }
.pix-botoes .btn-copiar { margin-bottom: 0; }
.btn-qrcode {
    flex: 1; padding: 12px;
    background: #2563eb; color: #fff;
    border: none; border-radius: 10px;
    font-size: 1rem; cursor: pointer;
}
.btn-copiar { flex: 1; }

/* Área do QR Code */
#qrcode-area {
    display: none;
    text-align: center;
    margin-bottom: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 10px;
}
#qrcode { display: inline-block; }
#qrcode img { margin: 0 auto; }
#qrcode-area small { display: block; color: #6b7280; margin-top: 8px; }

/* Ordenação no admin */
.produto-admin-linha {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}
.produto-admin-linha .produto-admin {
    border: none; padding: 0; flex: 1;
}

/* ===== ABA BALANÇO ===== */
.balanco-cards {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.balanco-card {
    flex: 1;
    min-width: 150px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}
.balanco-valor {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #16a34a;
}
.balanco-label {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: .9rem;
}
.tabela-balanco {
    width: 100%;
    border-collapse: collapse;
}
.tabela-balanco th,
.tabela-balanco td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}
.tabela-balanco thead th {
    background: #16a34a;
    color: #fff;
    text-align: left;
}
.tabela-balanco tfoot td {
    background: #f3f4f6;
    border-top: 2px solid #16a34a;
}

/* ===== OPÇÕES DE PAGAMENTO ===== */
.pagamento-opcoes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.pag-opcao {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all .15s;
    text-align: center;
}
.pag-opcao input { display: none; }
.pag-opcao:has(input:checked) {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #16a34a;
}
