:root {
    color-scheme: light;
    --ink: #17120f;
    --muted: #6f6254;
    --line: #eadfce;
    --paper: #fbf2e3;
    --panel: #ffffff;
    --accent: #f26a21;
    --accent-dark: #101010;
    --green: #138a43;
    --green-dark: #0d6f35;
    --red: #b83a32;
    --gold: #e9b44c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 12% 120px, #ffe6a9 0 70px, transparent 72px),
        radial-gradient(circle at 88% 220px, #c9f0b8 0 62px, transparent 64px),
        linear-gradient(180deg, #fffaf1 0, var(--paper) 360px, #ffffff 100%);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.topbar {
    align-items: center;
    background: #101010;
    border-bottom: 4px solid var(--accent);
    display: grid;
    grid-template-columns: 56px 1fr auto;
    min-height: 78px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.brand {
    color: var(--accent);
    font-size: 24px;
    font-weight: 800;
    justify-self: center;
}

.brand span {
    color: #ffffff;
}

.logo-brand img {
    display: block;
    max-height: 58px;
    max-width: 220px;
    object-fit: contain;
}

.logo-brand span {
    display: none;
}

.nav-toggle {
    display: none;
}

.hamburger {
    cursor: pointer;
    display: grid;
    gap: 5px;
    width: 36px;
}

.hamburger span {
    background: #ffffff;
    border-radius: 999px;
    display: block;
    height: 4px;
}

.nav {
    align-items: center;
    background: #17120f;
    border: 1px solid #38291f;
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, .24);
    display: none;
    flex-direction: column;
    gap: 14px;
    left: 18px;
    padding: 14px;
    position: absolute;
    top: 84px;
    min-width: 190px;
}

.nav-toggle:checked ~ .nav {
    display: flex;
}

.nav a {
    color: #ffffff;
    font-weight: 700;
}

.nav-user {
    background: #201a16;
    border: 1px solid #3a2d24;
    border-radius: 999px;
    color: #ffd7a5;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 12px;
}

.balance-pill {
    background: #fff1cf;
    border: 2px solid var(--accent);
    border-radius: 999px;
    color: #6d430c;
    font-size: 13px;
    font-weight: 900;
    padding: 8px 12px;
    white-space: nowrap;
}

.link-button {
    background: transparent;
    border: 0;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.shell {
    margin: 0 auto;
    max-width: 1320px;
    padding: 24px 18px 72px;
}

.page-heading {
    align-items: end;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 24px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: 34px;
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
}

p,
small,
.product-meta,
.stock {
    color: var(--muted);
}

.button {
    align-items: center;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    white-space: nowrap;
}

.button.primary {
    background: var(--accent);
    color: #ffffff;
}

.button.primary:hover {
    background: var(--accent-dark);
}

.button.secondary,
.button.compact {
    background: #f1e6d4;
    color: var(--ink);
}

.button.green {
    background: var(--green);
    color: #ffffff;
}

.button.green:hover {
    background: var(--green-dark);
}

.button.cart-green {
    background: #a9df8f;
    border: 2px solid #62b44d;
    color: #163a18;
    font-size: 13px;
    min-height: 36px;
    padding: 0 10px;
}

.button.cart-green:hover {
    background: #8fd877;
}

.button.compact {
    min-height: 34px;
    padding: 0 10px;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.alert {
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.alert.success {
    background: #e2f2e8;
    color: var(--green);
}

.alert.error {
    background: #fbe2df;
    color: var(--red);
}

.product-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 auto;
    max-width: 980px;
}

.product-card,
.panel,
.metric,
.empty {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(32, 20, 10, .06);
}

.product-card {
    overflow: hidden;
    border: 2px solid #f3ddb9;
    margin: 0 auto;
    max-width: 310px;
    width: 100%;
}

.product-card img {
    aspect-ratio: 5 / 3;
    object-fit: cover;
    width: 100%;
}

.product-body {
    padding: 14px;
}

.product-body h2 {
    font-size: 18px;
    line-height: 1.18;
    margin-bottom: 6px;
    min-height: 42px;
}

.storefront-heading h1 {
    color: #101010;
    text-shadow: 2px 2px 0 #ffd596;
}

.price-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin: 12px 0 8px;
}

.price-row strong {
    font-size: 21px;
}

.price-row span {
    background: #fff1cf;
    border-radius: 999px;
    color: #7b5611;
    font-size: 13px;
    font-weight: 800;
    padding: 6px 10px;
}

.inline-form {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 62px 1fr;
    margin-top: 12px;
}

.inline-form input {
    min-height: 36px;
    padding: 7px 8px;
}

input,
select,
textarea {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    min-height: 42px;
    padding: 9px 10px;
    width: 100%;
}

textarea {
    resize: vertical;
}

.panel {
    padding: 18px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 8px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.summary-row,
.total-line,
.line {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.summary-row {
    margin-top: 18px;
}

.summary-row > div {
    display: flex;
    gap: 10px;
}

.checkout-layout,
.admin-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
}

.admin-grid {
    align-items: start;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
}

.admin-grid .panel:first-child {
    grid-column: 1 / -1;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.single {
    grid-template-columns: 1fr;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 14px;
    font-weight: 800;
    gap: 7px;
}

.span-2 {
    grid-column: span 2;
}

.check {
    align-items: center;
    display: flex;
    gap: 10px;
}

.check input {
    min-height: auto;
    width: auto;
}

.line {
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.total-line {
    font-size: 20px;
    margin-top: 18px;
}

.empty {
    padding: 36px;
    text-align: center;
}

.auth-card {
    margin: 40px auto;
    max-width: 420px;
}

.auth-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 420px));
    justify-content: center;
}

.account-strip {
    background: #fff5dc;
    border: 1px solid #f1d9a4;
    border-radius: 8px;
    padding: 12px;
}

.text-link {
    color: var(--green);
    font-weight: 800;
}

.floating-whatsapp {
    align-items: center;
    background: var(--green);
    border-radius: 999px;
    bottom: 20px;
    box-shadow: 0 12px 24px rgba(13, 111, 53, .28);
    color: #ffffff;
    display: inline-flex;
    font-weight: 900;
    min-height: 48px;
    padding: 0 18px;
    position: fixed;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 20;
}

.mini-list {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
}

.metric-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 18px;
}

.metric {
    padding: 14px;
}

.metric span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 800;
    min-height: 32px;
    text-transform: uppercase;
}

.metric strong {
    font-size: 28px;
}

.status-form {
    display: flex;
    gap: 8px;
}

.order-detail-row td {
    background: #fffaf1;
    padding-top: 0;
}

.order-detail summary {
    color: var(--green-dark);
    cursor: pointer;
    font-weight: 900;
    padding: 10px 0;
}

.order-detail-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(280px, 1fr) minmax(260px, .8fr);
}

.order-detail textarea {
    font-family: Consolas, Monaco, monospace;
    min-height: 220px;
}

.pager {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 14px;
}

.inventory-edit {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(86px, .65fr)) minmax(100px, .6fr) minmax(92px, .5fr) minmax(120px, .7fr) auto;
}

.inventory-edit input {
    min-height: 36px;
}

.mini-check {
    font-size: 12px;
}

@media (max-width: 900px) {
    .product-grid,
    .checkout-layout,
    .admin-grid,
    .metric-grid,
    .auth-grid {
        grid-template-columns: 1fr;
    }

    .page-heading,
    .summary-row {
        align-items: stretch;
        flex-direction: column;
    }

    .form-grid,
    .form-grid.single {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .topbar {
        grid-template-columns: 44px 1fr auto;
        padding: 10px 14px;
    }

    .nav {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .inventory-edit {
        grid-template-columns: 1fr;
    }

    .order-detail-grid {
        grid-template-columns: 1fr;
    }

    .pager {
        justify-content: center;
    }
}
