:root {
    --bg: #f3f5f2;
    --card: #ffffff;
    --text: #1a1f1a;
    --muted: #5c675c;
    --primary: #1b5e20;
    --primary-dark: #124016;
    --danger: #b71c1c;
    --border: #d5ddd5;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
}

a { color: var(--primary); text-decoration: none; }

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--primary);
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}
a.brand:hover { color: #fff; opacity: 0.95; }
.brand-logo {
    height: 40px;
    max-width: 140px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
}

.logo-preview {
    max-height: 120px;
    max-width: 240px;
    width: auto;
    object-fit: contain;
}

.status {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}
.status.on { background: #e8f5e9; color: #1b5e20; }
.status.off { background: #eeeeee; color: #616161; }

.pagination { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.pagination > * { padding: 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }

.nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nav a, .nav .linkish {
    color: #fff;
    background: rgba(255,255,255,.12);
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    cursor: pointer;
}
.nav a.is-active {
    background: rgba(255,255,255,.28);
    font-weight: 700;
}

.nav-menu {
    position: relative;
}
.nav-menu-toggle {
    list-style: none;
    color: #fff;
    background: rgba(255,255,255,.18);
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 600;
}
.nav-menu-toggle::-webkit-details-marker { display: none; }
.nav-menu-toggle::after {
    content: " ▾";
    font-size: 0.85em;
    opacity: 0.9;
}
.nav-menu[open] .nav-menu-toggle {
    background: rgba(255,255,255,.3);
}
.nav-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 220px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.nav-menu-panel a {
    color: var(--text);
    background: transparent;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}
.nav-menu-panel a:hover,
.nav-menu-panel a:focus {
    background: #e8f5e9;
    color: var(--primary-dark);
}

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

.nav-short { display: none; }

h1 {
    margin: 0 0 8px;
    font-size: 1.45rem;
    line-height: 1.25;
}
h2 {
    font-size: 1.15rem;
    line-height: 1.3;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.login-page {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0 32px;
    gap: 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 28px 24px 24px;
}
.login-app-download {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 18px 16px;
    text-align: center;
    background: #f3f7f4;
    border: 1px solid var(--border);
    border-radius: 10px;
}
a.login-app-download--action {
    display: block;
    color: inherit;
    text-decoration: none;
    border-color: #a8d5b0;
    box-shadow: 0 2px 0 rgba(27, 94, 32, 0.12);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
a.login-app-download--action:hover,
a.login-app-download--action:focus {
    background: #e7f3ea;
    box-shadow: 0 4px 10px rgba(27, 94, 32, 0.16);
    transform: translateY(-1px);
}
a.login-app-download--action:active {
    transform: translateY(0);
}
.login-app-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 10px;
}
.login-app-icons--muted {
    opacity: 0.85;
}
.login-icon-phone {
    display: block;
    flex-shrink: 0;
}
.login-app-download-label {
    display: block;
    margin: 0 0 12px;
    font-weight: 600;
    color: var(--text, #222);
}
.login-app-download-empty {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
}
.login-app-download .btn-block {
    margin: 0;
    pointer-events: none; /* o link pai já recebe o toque */
}
.is-android-app .login-app-download {
    display: none;
}
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.login-logo,
.login-logo-placeholder {
    display: block;
    width: 100%;
    max-width: 260px;
    height: 120px;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 10px;
    background: #f0f4f0;
    border: 1px dashed var(--border);
}
.login-logo {
    padding: 10px;
    background: #fff;
    border-style: solid;
}
.login-system-name {
    margin: 0;
    text-align: center;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.05rem;
}
.login-title {
    margin: 0 0 18px;
    text-align: center;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
}
.login-form .field {
    display: block;
    width: 100%;
    margin-bottom: 14px;
}
.login-form label {
    display: block;
    margin: 0 0 6px;
    font-weight: 600;
}
.login-form input[type="text"],
.login-form input[type="password"] {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
}
.login-form .btn-block {
    margin-top: 8px;
}
.login-alert {
    margin: 0 0 16px;
    text-align: left;
    font-weight: 600;
}
.login-form .field.has-error label {
    color: #b71c1c;
}
.login-form input.is-invalid {
    border-color: #c62828;
    background: #fff8f8;
}
.login-form .field-error {
    margin: 6px 0 0;
    color: #b71c1c;
    font-size: 0.9rem;
    font-weight: 600;
}
.system-title { text-align: center; margin: 0 0 8px; color: var(--primary); }

.form-card label { display: block; margin: 12px 0 6px; font-weight: 600; }
.form-card input[type="text"],
.form-card input[type="password"],
.form-card input[type="file"],
.form-card input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
}

.check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }

.btn {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    margin-top: 12px;
    margin-right: 8px;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #e8eee8; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; margin-right: 0; }

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 72px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 700;
    letter-spacing: .02em;
}
.menu-btn--primary {
    background: var(--primary-dark);
    box-shadow: 0 2px 0 rgba(0,0,0,.12);
}
.menu-btn-download {
    flex-direction: column;
    gap: 6px;
}
.menu-btn-icon {
    display: block;
    flex-shrink: 0;
}
.is-android-app .menu-btn-download {
    display: none;
}

.home-welcome { margin-bottom: 8px; }
.home-section { margin-top: 20px; }
.home-section-title {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.home-section-hint {
    margin: 0 0 10px;
    font-size: 0.9rem;
}
.menu-grid--ops {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.menu-grid--ops .menu-btn {
    min-height: 84px;
    font-size: 1.05rem;
}
.menu-grid--admin .menu-btn {
    min-height: 64px;
    font-size: 0.92rem;
    background: #2e7d32;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.pedidos-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pedido-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(26, 31, 26, 0.05);
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.pedido-card:hover,
.pedido-card:focus {
    border-color: var(--primary);
    box-shadow: 0 3px 12px rgba(27, 94, 32, 0.12);
    outline: none;
}
.pedido-card:active {
    transform: scale(0.995);
}
.pedido-card--cancelado {
    opacity: 0.78;
}
.pedido-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.pedido-card-id {
    font-size: 1.05rem;
}
.pedido-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 10px;
}
.pedido-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.pedido-card-total {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary-dark);
}
.pedido-card-action {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.92rem;
}

.pedido-dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px 16px;
    margin: 12px 0 16px;
}
.pedido-dl dt {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 2px;
}
.pedido-dl dd {
    margin: 0;
    font-weight: 600;
}
.pedido-total-destaque {
    color: var(--primary-dark);
    font-size: 1.2rem;
}
.pedido-cancel-info {
    margin: 0 0 12px;
}
.pedido-itens {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pedido-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #f7faf7;
}
.pedido-item-nome {
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}
.pedido-item-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.95rem;
}
.pedido-itens-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 1.1rem;
}

.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Listagem admin: cards compactos (mais itens visíveis na tela) */
.product-grid--admin {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.product-grid--admin .product-img {
    height: 96px;
}
.product-grid--admin .product-img.placeholder {
    font-size: 0.75rem;
}
.product-grid--admin .product-card h2 {
    font-size: 0.88rem;
    padding: 8px 8px 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
    line-height: 1.2;
}
.product-grid--admin .product-card .price {
    font-size: 0.92rem;
    padding: 0 8px 4px;
}
.product-grid--admin .product-card > p,
.product-grid--admin .product-card .row-actions {
    margin-left: 8px;
    margin-right: 8px;
    font-size: 0.8rem;
}
.product-grid--admin .product-card > p {
    margin-top: 0;
    margin-bottom: 4px;
}
.product-grid--admin .status {
    font-size: 0.72rem;
    padding: 2px 6px;
}
.product-grid--admin .product-card .row-actions {
    padding-bottom: 8px;
    gap: 4px;
}
.product-grid--admin .product-card .row-actions .btn,
.product-grid--admin .product-card .row-actions .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 28px;
}

.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(26, 31, 26, 0.06);
    transition: box-shadow .15s ease, transform .15s ease;
}
.product-card:hover {
    box-shadow: 0 4px 14px rgba(26, 31, 26, 0.1);
}
.product-card.inactive { opacity: .62; }
.product-card h2 {
    font-size: 1.05rem;
    margin: 0;
    padding: 12px 14px 4px;
    line-height: 1.25;
}
.product-card .price {
    margin: 0;
    padding: 0 14px 10px;
}
.product-card > p,
.product-card .row-actions,
.product-card .qty-controls,
.product-card .btn-add {
    margin-left: 14px;
    margin-right: 14px;
}
.product-card .row-actions {
    padding-bottom: 12px;
    margin-top: auto;
    gap: 6px;
}
.product-card .row-actions .btn,
.product-card .row-actions .btn-sm {
    margin-top: 0;
    margin-right: 0;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    min-height: 32px;
    border-radius: 6px;
}
.product-card .btn-add {
    width: calc(100% - 28px);
    margin-bottom: 14px;
}
.product-img {
    width: 100%;
    height: 168px;
    object-fit: cover;
    display: block;
    background: linear-gradient(145deg, #e8eee8, #f5f7f5);
}
.product-img.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.price { font-weight: 700; font-size: 1.1rem; color: var(--primary-dark); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions form { display: inline; margin: 0; }

.current-image img {
    max-width: 220px;
    max-height: 220px;
    width: auto;
    border-radius: 10px;
    display: block;
    margin-bottom: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; }
.alert.ok { background: #e8f5e9; color: #1b5e20; }
.alert.err { background: #ffebee; color: #b71c1c; }
.muted { color: var(--muted); }
.inline { display: inline; margin: 0; }

/* —— Mobile / admin: densidade e usabilidade —— */
@media (max-width: 900px) {
    .topbar {
        padding: 8px 10px;
        gap: 8px;
    }
    .brand strong {
        font-size: 0.92rem;
        line-height: 1.2;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .brand-logo {
        height: 32px;
        max-width: 96px;
    }
    .nav {
        width: 100%;
        gap: 6px;
    }
    .nav a,
    .nav .linkish,
    .nav-menu-toggle {
        padding: 7px 10px;
        font-size: 12px;
        border-radius: 6px;
        min-height: 34px;
        line-height: 1.2;
    }
    .nav-menu {
        flex: 1 1 auto;
    }
    .nav-menu-panel {
        left: 0;
        right: 0;
        min-width: 0;
        width: 100%;
    }
    .nav-full { display: none; }
    .nav-short { display: inline; }

    .container {
        padding: 10px 10px 20px;
    }

    h1 { font-size: 1.2rem; }
    h2 { font-size: 1.05rem; }

    .page-head {
        gap: 8px;
        margin-bottom: 10px;
        align-items: flex-start;
    }
    .page-head .btn {
        margin-top: 0;
        min-height: 36px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .card,
    .form-card {
        padding: 14px;
    }
    .form-card label {
        margin: 10px 0 4px;
        font-size: 0.92rem;
    }
    .form-card input[type="text"],
    .form-card input[type="password"],
    .form-card input[type="file"],
    .form-card input[type="number"] {
        padding: 10px;
        font-size: 16px; /* evita zoom iOS */
    }

    .btn {
        min-height: 40px;
        padding: 9px 14px;
        font-size: 14px;
        margin-top: 8px;
        margin-right: 6px;
    }
    .btn-sm,
    .table-wrap .btn,
    .row-actions .btn-sm {
        min-height: 32px;
        padding: 6px 10px;
        font-size: 12px;
        margin-top: 0;
    }

    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 8px;
    }
    .menu-btn {
        min-height: 52px;
        font-size: 12px;
        letter-spacing: 0.01em;
        padding: 8px 6px;
        text-align: center;
        line-height: 1.25;
    }
    .menu-grid--ops .menu-btn {
        min-height: 64px;
        font-size: 0.95rem;
    }
    .menu-grid--admin .menu-btn {
        min-height: 48px;
        font-size: 11px;
    }
    .menu-btn-icon {
        width: 22px;
        height: 22px;
    }
    .home-section { margin-top: 16px; }
    .home-section-title { font-size: 0.85rem; }
    .home-section-hint { font-size: 0.82rem; }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
        gap: 10px;
    }
    .product-img {
        height: 110px;
    }
    .product-grid--admin {
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
        gap: 8px;
    }
    .product-grid--admin .product-img {
        height: 72px;
    }
    .product-grid--admin .product-card h2 {
        font-size: 0.78rem;
        padding: 6px 6px 2px;
        min-height: 2.1em;
    }
    .product-grid--admin .product-card .price {
        font-size: 0.82rem;
        padding: 0 6px 2px;
    }
    .product-grid--admin .product-card > p,
    .product-grid--admin .product-card .row-actions {
        margin-left: 6px;
        margin-right: 6px;
        font-size: 0.72rem;
    }
    .product-grid--admin .product-card .row-actions .btn {
        min-height: 26px;
        padding: 3px 6px;
        font-size: 10px;
    }
    .product-card h2 {
        font-size: 0.92rem;
        padding: 8px 10px 2px;
    }
    .product-card .price {
        font-size: 0.95rem;
        padding: 0 10px 6px;
    }
    .product-card > p,
    .product-card .row-actions {
        margin-left: 10px;
        margin-right: 10px;
        font-size: 0.88rem;
    }
    .product-card .row-actions {
        padding-bottom: 10px;
    }
    .product-card .row-actions .btn {
        min-height: 30px;
        padding: 5px 8px;
        font-size: 11px;
    }

    .logo-preview {
        max-height: 88px;
        max-width: 180px;
    }

    .pedido-card {
        padding: 12px;
    }
    .pedido-card-id { font-size: 0.98rem; }
    .pedido-card-total { font-size: 1.05rem; }

    .pagination > * {
        padding: 6px 8px;
        font-size: 0.88rem;
    }

    /* Tabelas em “cards” no mobile */
    .table-wrap {
        border: 0;
        background: transparent;
        overflow: visible;
    }
    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap th,
    .table-wrap td,
    .table-wrap tr {
        display: block;
        width: 100%;
    }
    .table-wrap thead {
        display: none;
    }
    .table-wrap tr {
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 10px 12px;
        margin-bottom: 8px;
    }
    .table-wrap td {
        border: 0;
        padding: 4px 0;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        text-align: right;
        font-size: 0.92rem;
    }
    .table-wrap td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        text-align: left;
        flex: 0 0 42%;
    }
    .table-wrap td[data-label=""]::before,
    .table-wrap td:not([data-label])::before {
        display: none;
    }
    .table-wrap td.row-actions,
    .table-wrap td[data-label="Ações"] {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px;
        margin-top: 6px;
        padding-top: 8px;
        border-top: 1px solid var(--border);
    }
    .table-wrap td.row-actions::before,
    .table-wrap td[data-label="Ações"]::before {
        flex-basis: 100%;
        margin-bottom: 2px;
    }
}

@media (max-width: 600px) {
    .nav a, .nav .linkish, .nav-menu-toggle {
        padding: 7px 9px;
        font-size: 12px;
        min-height: 34px;
    }
    .btn { min-height: 40px; }
    .product-card .row-actions .btn {
        min-height: 30px;
        padding: 5px 8px;
        font-size: 11px;
    }
    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .menu-btn {
        min-height: 48px;
        font-size: 11px;
    }
    .menu-grid--ops {
        grid-template-columns: 1fr;
    }
    .menu-grid--ops .menu-btn {
        min-height: 56px;
    }
}

/* Venda */
.venda-alerta-caixa {
    margin-bottom: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
}
.venda-alerta-caixa a {
    font-weight: 700;
    margin-left: 4px;
}
.venda-layout {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 320px);
    gap: 12px;
    align-items: start;
}

/* Grade compacta só na venda (cadastro de produtos mantém cards maiores) */
.venda-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
}
.venda-card {
    box-shadow: none;
}
.venda-card:hover { transform: none; box-shadow: 0 2px 8px rgba(26, 31, 26, 0.08); }
.venda-card-media { position: relative; }
.venda-card .product-img {
    height: 64px;
}
.venda-card .product-img.placeholder {
    font-size: 0.7rem;
}
.venda-card-body {
    display: flex;
    flex-direction: column;
    padding: 0 0 6px;
    flex: 1;
}
.venda-card h2 {
    font-size: 0.82rem;
    padding: 6px 8px 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.2em;
    line-height: 1.2;
}
.venda-card .price {
    padding: 0 8px 2px;
    font-size: 0.88rem;
}
.venda-estoque {
    margin: 0;
    padding: 0 8px 6px;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}
.venda-estoque.esgotado {
    color: var(--danger);
}
.venda-card.sem-estoque {
    opacity: 0.72;
}
.venda-card .qty-controls {
    gap: 6px;
    margin: 0 6px 4px;
}
.venda-card .btn-qty {
    width: 34px;
    height: 34px;
    font-size: 18px;
    flex-shrink: 0;
}
.venda-card .qty-value { font-size: 14px; min-width: 18px; }
.venda-card .btn-add {
    margin: 0 6px 6px;
    width: calc(100% - 12px);
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 700;
    min-height: 36px;
}
.venda-badge {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: rgba(27, 94, 32, 0.92);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    text-align: center;
    padding: 3px 4px;
    border-radius: 5px;
    line-height: 1.15;
}

.venda-carrinho {
    position: sticky;
    top: 8px;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--primary);
    box-shadow: 0 4px 16px rgba(27, 94, 32, 0.12);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 24px);
}
.carrinho-topo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #e8f5e9, #fff);
    border-bottom: 1px solid var(--border);
}
.carrinho-topo h2 {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}
.carrinho-qtd {
    display: inline-block;
    margin-top: 2px;
    margin-right: 6px;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}
.status-mini {
    font-size: 0.7rem;
    padding: 2px 6px;
    vertical-align: middle;
}
.carrinho-total-vivo {
    text-align: right;
    min-width: 120px;
}
.carrinho-total-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.carrinho-total-valor {
    display: block;
    font-size: 1.45rem;
    color: var(--primary);
    line-height: 1.15;
}
.carrinho-total-vivo.pulse .carrinho-total-valor {
    animation: totalPulse 0.45s ease;
}
@keyframes totalPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); color: #0d3d12; }
    100% { transform: scale(1); }
}

.carrinho-flash {
    margin: 0;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1b5e20;
    background: #c8e6c9;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity .2s ease, max-height .2s ease, padding .2s ease;
}
.carrinho-flash.is-on {
    opacity: 1;
    max-height: 64px;
    padding: 8px 12px;
}

.carrinho-lista {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 80px;
    max-height: 42vh;
}
.carrinho-vazio-msg {
    margin: 0;
    padding: 16px 14px;
    text-align: center;
}
.carrinho-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}
.carrinho-item.is-new {
    animation: itemIn 0.5s ease;
    background: #f1f8f1;
}
@keyframes itemIn {
    from { background: #c8e6c9; }
    to { background: #f1f8f1; }
}
.carrinho-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.carrinho-item-info strong {
    font-size: 0.95rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.carrinho-item-meta { font-size: 0.82rem; color: var(--muted); }
.carrinho-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.carrinho-item-acoes {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    margin: 0;
}
.carrinho-item-acoes .btn-qty {
    width: 36px;
    height: 36px;
    font-size: 18px;
}
.carrinho-item-acoes .qty-value {
    min-width: 20px;
    font-size: 15px;
}
.carrinho-sub {
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary-dark);
}
.carrinho-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
    background: #fafcfa;
}
.carrinho-acoes .btn { margin-top: 0; }
.carrinho-acoes .btn-primary {
    flex: 1;
    min-height: 48px;
    font-size: 16px;
    font-weight: 700;
}
.venda-carrinho .alert { margin: 0 14px 14px; }

.qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 10px 0;
}
.btn-qty {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 24px;
    cursor: pointer;
}
.qty-value { min-width: 28px; text-align: center; font-weight: 700; font-size: 18px; }

@media (max-width: 900px) {
    .venda-layout { grid-template-columns: 1fr; }
    .venda-carrinho {
        position: sticky;
        top: 0;
        z-index: 20;
        order: -1;
        max-height: none;
    }
    .carrinho-lista { max-height: 26vh; }
    .venda-grid {
        grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
        gap: 6px;
    }
    .venda-card .product-img { height: 56px; }
    .venda-card .btn-add { min-height: 34px; font-size: 11px; padding: 6px 4px; }
    .venda-card .btn-qty { width: 32px; height: 32px; font-size: 16px; }
    .menu-btn { min-height: 52px; font-size: 12px; }
}

/* App Android (WebView): mesma UX da proposta, com toque e FAB */
.is-android-app .container {
    padding-bottom: 28px;
}
.is-android-app.page-venda .container.wide {
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 24px;
}
.is-android-app .topbar {
    padding: 8px 10px;
    gap: 8px;
    padding-right: 64px; /* evita cobrir o FAB de config no canto */
}
.is-android-app .nav a,
.is-android-app .nav .linkish,
.is-android-app .nav-menu-toggle {
    padding: 10px 12px;
    font-size: 14px;
}
.is-android-app .venda-carrinho {
    border-width: 2px;
    -webkit-transform: translateZ(0); /* sticky mais estável no WebView */
}
.is-android-app .carrinho-total-valor {
    font-size: 1.55rem;
}
.is-android-app .carrinho-acoes {
    padding-bottom: 16px;
}
.is-android-app .carrinho-acoes .btn-primary {
    min-height: 52px;
    font-size: 17px;
}
.is-android-app .venda-card .btn-add {
    min-height: 40px;
    font-size: 12px;
}
.is-android-app .venda-card .btn-qty,
.is-android-app .carrinho-item-acoes .btn-qty {
    width: 40px;
    height: 40px;
}
.is-android-app .venda-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.is-android-app .venda-card .product-img {
    height: 54px;
}

.btn-sm { padding: 8px 10px; font-size: 14px; min-height: auto; margin-top: 0; }
.price.big { font-size: 1.6rem; }
.success-card { max-width: 520px; margin: 24px auto; text-align: center; }
.container.wide, .venda-page { max-width: 1200px; }
.form-sep {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}
.form-subtitle {
    margin: 0 0 6px;
    font-size: 1.1rem;
}
.apk-atual {
    margin: 10px 0 14px;
    padding: 12px;
    background: #f3f7f4;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.apk-atual .status {
    display: inline-block;
}
.home-guest {
    max-width: 520px;
    margin: 24px auto 16px;
    text-align: center;
}
.home-guest h1 { margin-top: 0; }
.home-guest .row-actions {
    justify-content: center;
    margin-top: 8px;
}
.home-guest .row-actions .btn {
    margin-right: 0;
    margin-left: 0;
}
.home-guest-download {
    max-width: 400px;
    margin: 0 auto 24px;
}
.is-android-app .home-guest-download {
    display: none;
}

/* Revisão do pedido antes de confirmar */
.revisao-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(26, 31, 26, 0.55);
}
.revisao-overlay[hidden] { display: none !important; }
.revisao-card {
    width: 100%;
    max-width: 440px;
    max-height: min(88vh, 640px);
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    border: 2px solid var(--primary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    padding: 18px 16px 16px;
}
.revisao-card h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
}
.revisao-ajuda { margin: 0 0 12px; font-size: 0.9rem; }
.revisao-lista {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    max-height: 42vh;
    overflow-y: auto;
}
.revisao-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}
.revisao-item:last-child { border-bottom: 0; }
.revisao-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.revisao-item-info strong {
    font-size: 0.98rem;
    line-height: 1.25;
}
.revisao-item-info span {
    font-size: 0.85rem;
    color: var(--muted);
}
.revisao-item-sub {
    white-space: nowrap;
    color: var(--primary-dark);
    font-size: 1rem;
}
.revisao-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0 10px;
    padding: 12px 4px 0;
    border-top: 2px solid var(--border);
    font-size: 1.15rem;
}
.revisao-total strong {
    font-size: 1.45rem;
    color: var(--primary);
}
.revisao-pagamento {
    margin: 4px 0 12px;
}
.revisao-pagamento-label {
    margin: 0 0 8px;
    font-weight: 700;
    font-size: 0.95rem;
}
.revisao-pagamento-opcoes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.revisao-pag-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
}
.revisao-pag-opt input {
    width: 18px;
    height: 18px;
    margin: 0;
}
.revisao-pag-opt:has(input:checked),
.revisao-pag-opt.is-selected {
    border-color: var(--primary);
    background: #e8f5e9;
    color: var(--primary-dark);
}
.revisao-troco {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.revisao-troco-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-weight: 700;
    cursor: pointer;
}
.revisao-troco-check input {
    width: 20px;
    height: 20px;
}
.revisao-valor-recebido {
    margin-top: 10px;
}
.revisao-valor-recebido label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}
.revisao-valor-recebido input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
}
.revisao-troco-resumo {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: #f1f8f1;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
}
.revisao-troco-resumo > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.95rem;
}
.revisao-troco-resumo .troco-destaque {
    padding-top: 6px;
    border-top: 1px solid #c8e6c9;
    font-size: 1.05rem;
}
.revisao-troco-resumo .troco-destaque strong {
    color: var(--primary);
}
.revisao-troco-resumo strong.is-invalid {
    color: var(--danger);
}
.revisao-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.revisao-acoes .btn { margin-top: 0; flex: 1; min-height: 48px; }
.revisao-acoes .btn-primary { font-weight: 700; }
body.revisao-aberta { overflow: hidden; }
.is-android-app .revisao-card {
    max-height: 90vh;
}
.is-android-app .revisao-acoes .btn {
    min-height: 52px;
}

/* Modal forma de pagamento (antes de imprimir) */
.pagamento-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(26, 31, 26, 0.55);
}
.pagamento-overlay[hidden] { display: none !important; }
.pagamento-card {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 12px;
    border: 2px solid var(--primary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    padding: 18px 16px 16px;
}
.pagamento-card h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
}
.pagamento-card > .muted {
    margin: 0 0 14px;
}
.pagamento-opcoes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}
.pagamento-opcoes .btn {
    margin-top: 0;
    min-height: 52px;
    font-size: 17px;
    font-weight: 700;
}
.pagamento-card .btn-ghost {
    margin-top: 0;
    min-height: 44px;
}
body.pagamento-modal-aberta { overflow: hidden; }
