:root {
    --verde: #103B2F;
    --dourado: #D4AF37;
    --bordo: #6B1F2B;
    --fundo: #F5F4EF;
    --texto: #1C1C1C;
    --branco: #FFFFFF;
    --linha: #E4E0D6;
    --sombra: 0 18px 40px rgba(16, 59, 47, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--fundo);
    color: var(--texto);
}
a { color: inherit; text-decoration: none; }
code { background: #eee9dc; border-radius: 6px; padding: 2px 6px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: var(--verde);
    color: var(--branco);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: var(--dourado);
    border: 1px solid rgba(212, 175, 55, .65);
    font-weight: 800;
    font-size: 24px;
}
.brand strong, .brand small { display: block; }
.brand small { opacity: .72; margin-top: 2px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a, .logout {
    padding: 12px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,.88);
}
.sidebar nav a.ativo, .sidebar nav a:hover, .logout:hover {
    background: rgba(212, 175, 55, .16);
    color: var(--branco);
}
.logout { margin-top: auto; }

.content {
    width: 100%;
    padding: 28px 28px 96px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 28px; }
h2 { font-size: 20px; margin-bottom: 12px; }
.topbar p, .muted { color: #706D66; margin: 6px 0 0; }

.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.card, .panel, .login-card {
    background: var(--branco);
    border: 1px solid var(--linha);
    border-radius: 8px;
    box-shadow: var(--sombra);
}
.card { padding: 20px; }
.card span { display: block; color: #706D66; margin-bottom: 10px; }
.card strong { color: var(--verde); font-size: 24px; }
.panel { padding: 22px; margin-bottom: 18px; }

.btn {
    border: 0;
    border-radius: 8px;
    padding: 13px 18px;
    font-weight: 700;
    cursor: pointer;
}
.btn.primario { background: var(--verde); color: var(--branco); }
.btn.primario:hover { background: #0b2d24; }

label { display: grid; gap: 7px; font-weight: 700; margin-bottom: 14px; }
input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--linha);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
}
input:focus { outline: 3px solid rgba(212,175,55,.25); border-color: var(--dourado); }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(160deg, #103B2F 0%, #174D3F 42%, #F5F4EF 42%);
}
.login-card { width: min(440px, 100%); padding: 28px; }
.login-brand { margin-bottom: 20px; }
.login-card h1 { font-size: 24px; margin-bottom: 18px; }
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-weight: 700;
}
.alert.erro { background: #F9E8E8; color: #8A1D1D; }
.alert.sucesso { background: #E8F4EC; color: #145D38; }

.test-list { display: grid; gap: 10px; }
.test-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--linha);
    border-radius: 8px;
    padding: 12px;
}
.test-list .ok { border-color: #B9DFC8; background: #F2FBF5; }
.test-list .fail { border-color: #E9B7B7; background: #FFF6F6; }

.bottom-nav { display: none; }

@media (max-width: 800px) {
    .app-shell { display: block; }
    .sidebar { display: none; }
    .content { padding: 20px 16px 88px; }
    .cards { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; }
    h1 { font-size: 24px; }
    .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        background: var(--verde);
        color: var(--branco);
        border-top: 1px solid rgba(255,255,255,.12);
        z-index: 20;
    }
    .bottom-nav a {
        min-height: 60px;
        display: grid;
        place-items: center;
        font-size: 13px;
    }
    .test-list div { display: grid; }
}

.dashboard-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid var(--linha); text-align: left; vertical-align: middle; }
.data-table th { color: #5e5a52; font-size: 13px; font-weight: 700; }
.data-table tr:hover td { background: #fbfaf7; }
.btn.pequeno { padding: 9px 12px; font-size: 13px; background: #eee9dc; color: var(--texto); display: inline-flex; align-items: center; justify-content: center; }
.btn.whatsapp, .whatsapp { background: #128C7E; color: #fff; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; min-height: 28px; border-radius: 8px; padding: 4px 9px; background: #eee9dc; font-weight: 700; font-size: 12px; white-space: nowrap; }
.status-processing { background: #E7F3FF; color: #145A91; }
.status-completed { background: #E8F4EC; color: #145D38; }
.status-pending, .status-on-hold { background: #FFF4D8; color: #7A5200; }
.status-cancelled, .status-refunded, .status-failed { background: #F9E8E8; color: #8A1D1D; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
select { width: 100%; min-height: 46px; border: 1px solid var(--linha); border-radius: 8px; padding: 10px 12px; font: inherit; background: #fff; }
select:focus { outline: 3px solid rgba(212,175,55,.25); border-color: var(--dourado); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--linha); padding: 10px 0; }
.kv span { color: #706D66; }
.kv strong { text-align: right; color: var(--verde); }
.check-line { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 0; }
.check-line input { width: 18px; min-height: 18px; }

@media (max-width: 1200px) {
    .dashboard-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .dashboard-cards, .detail-grid, .filters { grid-template-columns: 1fr; }
    .section-head { align-items: flex-start; flex-direction: column; }
    .pagination { justify-content: flex-start; }
    .kv { display: grid; }
    .kv strong { text-align: left; }
}

.products-table td small { display: block; color: #706D66; margin-top: 4px; }
.product-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linha); background: #f7f4ea; }
.product-actions { min-width: 330px; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.product-actions details { position: relative; }
.product-actions summary { list-style: none; cursor: pointer; }
.product-actions summary::-webkit-details-marker { display: none; }
.mini-form { position: absolute; right: 0; top: 42px; z-index: 10; width: 260px; display: grid; gap: 8px; padding: 12px; background: #fff; border: 1px solid var(--linha); border-radius: 8px; box-shadow: var(--sombra); }
.mini-form input, .mini-form select { min-height: 40px; }
.danger { background: #F9E8E8 !important; color: #8A1D1D !important; }
.small { font-size: 12px; }
.product-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.product-form textarea { width: 100%; border: 1px solid var(--linha); border-radius: 8px; padding: 10px 12px; font: inherit; resize: vertical; }
.product-form textarea:focus { outline: 3px solid rgba(212,175,55,.25); border-color: var(--dourado); }
.product-form .span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; }
.inline-stock { display: flex; gap: 8px; align-items: center; }
.inline-stock input { width: 100px; }
.status-outofstock { background: #F9E8E8; color: #8A1D1D; }
.status-instock { background: #E8F4EC; color: #145D38; }

@media (max-width: 800px) {
    .product-form { grid-template-columns: 1fr; }
    .product-form .span-2 { grid-column: auto; }
    .product-actions { min-width: 260px; }
    .mini-form { position: static; width: 100%; margin-top: 8px; }
    .inline-stock { display: grid; }
}

/* UX refresh 2026-07-14: identidade ondas areia/laranja + mobile cards */
:root {
    --verde: #103B2F;
    --laranja: #E86F4F;
    --laranja-escuro: #C95135;
    --areia: #FFF3DC;
    --amarelo: #F2A93B;
    --fundo: #F7F3EA;
    --linha: #E9DDC9;
    --sombra: 0 14px 34px rgba(16, 59, 47, .10);
}
html, body { max-width: 100%; overflow-x: hidden; }
body { background: linear-gradient(180deg, #fbf7ee 0, var(--fundo) 320px); }
body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto 0;
    height: 112px;
    pointer-events: none;
    opacity: .20;
    background:
        radial-gradient(120px 34px at 12% 58%, transparent 47%, var(--laranja) 49%, transparent 52%),
        radial-gradient(180px 44px at 42% 38%, transparent 47%, var(--laranja) 49%, transparent 52%),
        radial-gradient(220px 48px at 78% 54%, transparent 47%, var(--laranja) 49%, transparent 52%);
}
.mobile-appbar { display: none; }
.brand-logo, .mobile-brand img {
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(0,0,0,.18);
    flex: 0 0 auto;
}
.sidebar { background: linear-gradient(180deg, #103B2F 0%, #0C3026 100%); }
.sidebar nav a.ativo, .sidebar nav a:hover, .logout:hover { background: rgba(232, 111, 79, .24); }
.card, .panel, .login-card { border-color: var(--linha); }
.btn.primario { background: var(--verde); }
.btn.primario:hover { background: #0b2d24; }
.btn.accent { background: var(--laranja); color: #fff; }
select, input, textarea { max-width: 100%; }
.filter-panel .section-head { align-items: flex-start; }
.metric-card { min-height: 118px; }
.metric-card span { font-size: 15px; }
.metric-card strong { color: var(--verde); }
.table-wrap { border-radius: 8px; }
.data-table { table-layout: auto; }
.data-table td, .data-table th { line-height: 1.28; }
.products-table td:nth-child(2) strong { max-width: 220px; display: inline-block; }
.compact-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.compact-form select { width: auto; min-width: 150px; }

@media (max-width: 800px) {
    body { padding-top: env(safe-area-inset-top); }
    body::before { height: 86px; opacity: .16; }
    .mobile-appbar {
        position: sticky;
        top: 0;
        z-index: 40;
        display: flex;
        align-items: center;
        min-height: 64px;
        padding: 10px 16px;
        background: linear-gradient(135deg, var(--laranja) 0%, #F09055 100%);
        color: #fff;
        box-shadow: 0 10px 24px rgba(16,59,47,.16);
    }
    .mobile-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
    .content { padding: 18px 14px 94px; }
    .topbar { margin-bottom: 16px; }
    .topbar h1 { font-size: 28px; line-height: 1.05; }
    .topbar p { font-size: 15px; }
    .panel { padding: 18px; margin-bottom: 16px; border-radius: 12px; box-shadow: 0 12px 24px rgba(16,59,47,.10); }
    .card { padding: 18px; border-radius: 12px; }
    .dashboard-cards { gap: 12px; }
    .metric-card { min-height: 96px; }
    .metric-card span { margin-bottom: 12px; }
    .metric-card strong { font-size: 28px; }
    .section-head { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
    .section-head .btn, .section-head a.btn { width: 100%; min-height: 48px; }
    .filters { grid-template-columns: 1fr !important; gap: 12px; }
    label { margin-bottom: 0; font-size: 15px; }
    input, select, textarea { min-height: 48px; border-radius: 10px; font-size: 16px; }
    .btn { min-height: 48px; border-radius: 10px; }
    .filter-panel { overflow: visible; }
    .list-panel { padding: 0; background: transparent; border: 0; box-shadow: none; }
    .table-wrap { overflow: visible; border-radius: 0; }
    .responsive-table { min-width: 0; width: 100%; border-collapse: separate; border-spacing: 0 12px; }
    .responsive-table thead { display: none; }
    .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
    .responsive-table tr {
        background: #fff;
        border: 1px solid var(--linha);
        border-radius: 14px;
        box-shadow: 0 12px 26px rgba(16,59,47,.10);
        padding: 12px;
    }
    .responsive-table td {
        border: 0;
        padding: 9px 0;
        display: grid;
        grid-template-columns: minmax(94px, 34%) 1fr;
        gap: 12px;
        align-items: center;
        text-align: left;
        word-break: break-word;
    }
    .responsive-table td::before {
        content: attr(data-label);
        color: #756d60;
        font-weight: 700;
        font-size: 13px;
    }
    .responsive-table td[colspan] { display: block; text-align: center; padding: 18px; }
    .responsive-table td[colspan]::before { display: none; }
    .actions, .product-actions { display: flex !important; gap: 8px; flex-wrap: wrap; align-items: stretch; min-width: 0; }
    .actions .btn, .product-actions .btn, .product-actions details, .product-actions .compact-form { flex: 1 1 130px; }
    .product-actions details { width: 100%; }
    .product-actions summary.btn { width: 100%; }
    .mini-form { position: static; width: 100%; margin-top: 8px; box-shadow: none; background: #fff8ed; }
    .compact-form { width: 100%; display: grid; grid-template-columns: 1fr; }
    .compact-form select { width: 100%; }
    .product-thumb { width: 86px; height: 86px; }
    .products-table td:first-child { align-items: start; }
    .products-table td:first-child::before { padding-top: 30px; }
    .pagination { justify-content: center; background: #fff; border: 1px solid var(--linha); border-radius: 12px; padding: 12px; }
    .bottom-nav {
        min-height: 68px;
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        background: #103B2F;
        box-shadow: 0 -12px 24px rgba(16,59,47,.18);
    }
    .bottom-nav a { min-height: 64px; font-size: 14px; font-weight: 700; }
}

.push-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.push-actions form { margin: 0; }
@media (max-width: 800px) {
    .push-actions { display: grid; grid-template-columns: 1fr; }
    .push-actions .btn, .push-actions form, .push-actions form .btn { width: 100%; }
}
