@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --ink: #1b2922;
  --muted: #718078;
  --line: #e3eae6;
  --canvas: #f4f7f5;
  --paper: #fff;
  --green: #1d6b43;
  --green-dark: #124b32;
  --green-soft: #e8f4ec;
  --orange: #f58220;
  --blue: #2058a6;
  --shadow: 0 12px 36px rgba(24, 52, 38, .07);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: 'DM Sans', system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.55; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, .navbar-brand { font-family: 'Manrope', 'DM Sans', sans-serif; letter-spacing: -.035em; color: var(--ink); }
h1, h2, h3 { font-weight: 750; }
.text-secondary { color: var(--muted) !important; }
.form-label { color: #34463b; font-weight: 650; font-size: .9rem; }
.form-control, .form-select { min-height: 44px; padding: .62rem .85rem; border-color: #dbe4de; border-radius: 10px; color: var(--ink); box-shadow: none; }
.form-control:focus, .form-select:focus { border-color: #66a883; box-shadow: 0 0 0 .2rem rgba(29, 107, 67, .13); }
.form-control::placeholder { color: #99a49e; }
.form-check-input:checked { background-color: var(--green); border-color: var(--green); }
.btn { min-height: 40px; border-radius: 10px; padding: .55rem .9rem; font-weight: 650; transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { --bs-btn-bg: var(--green); --bs-btn-border-color: var(--green); --bs-btn-hover-bg: var(--green-dark); --bs-btn-hover-border-color: var(--green-dark); --bs-btn-active-bg: var(--green-dark); --bs-btn-active-border-color: var(--green-dark); }
.btn-success { --bs-btn-bg: var(--green); --bs-btn-border-color: var(--green); --bs-btn-hover-bg: var(--green-dark); --bs-btn-hover-border-color: var(--green-dark); }
.btn-outline-success { --bs-btn-color: var(--green); --bs-btn-border-color: #9dbbaa; --bs-btn-hover-bg: var(--green); --bs-btn-hover-border-color: var(--green); }
.btn-outline-primary { --bs-btn-color: var(--green); --bs-btn-border-color: #b3cdbd; --bs-btn-hover-bg: var(--green); --bs-btn-hover-border-color: var(--green); }
.btn-light { --bs-btn-color: var(--green-dark); --bs-btn-hover-color: var(--green-dark); }
.alert { border-radius: 12px; }
.table { --bs-table-color: var(--ink); --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .86rem .8rem; border-bottom-color: var(--line); }
.table thead th { color: #7c8981; font-size: .71rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table a { font-weight: 700; }
hr { border-color: var(--line); opacity: 1; }

/* Shared content components */
.panel { min-width: 0; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; font-size: 1.22rem; }
.panel-heading p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: .9rem; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.badge-soft { display: inline-flex; align-items: center; padding: .35rem .58rem; border-radius: 999px; background: #edf1ef; color: #46564c; font-size: .73rem; font-weight: 750; white-space: nowrap; }
.status-active, .status-paid, .status-completed, .status-published, .status-confirmed { background: #e5f4e9; color: #1c7342; }
.status-pending, .status-requested, .status-processing, .status-draft { background: #fff1d7; color: #96600d; }
.status-unpaid, .status-cancelled, .status-rejected, .status-archived { background: #fce9e8; color: #a84340; }
.status-shipped, .status-approved { background: #e8effb; color: #355e9b; }
.empty-state { display: grid; justify-items: center; gap: 9px; padding: 38px 20px; color: var(--muted); text-align: center; }
.empty-state > i { display: grid; width: 52px; height: 52px; place-items: center; margin-bottom: 3px; border-radius: 16px; background: var(--green-soft); color: var(--green); font-size: 1.25rem; }
.empty-state small { display: block; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card { position: relative; display: grid; min-height: 145px; grid-template-columns: 46px minmax(0,1fr); align-content: center; column-gap: 13px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.stat-icon { display: grid; width: 44px; height: 44px; grid-row: span 3; place-items: center; border-radius: 13px; background: var(--green-soft); color: var(--green); }
.icon-blue { background: #e9f0ff; color: #3566bc; }
.icon-orange { background: #fff1e2; color: #d7771d; }
.icon-purple { background: #f1ebff; color: #7951ba; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 650; }
.stat-value { display: block; margin-top: 2px; font-family: 'Manrope', sans-serif; font-size: 1.45rem; line-height: 1.2; overflow-wrap: anywhere; }
.stat-note { margin-top: 6px; color: #8a968f; font-size: .76rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.95fr); gap: 18px; align-items: start; }
.welcome-banner { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 150px; padding: 28px 34px; border-radius: 18px; color: #fff; background: linear-gradient(115deg, #124b32 0%, #1d6b43 63%, #398a61 100%); box-shadow: 0 14px 34px rgba(18,75,50,.18); }
.welcome-banner h2 { margin: 5px 0 4px; color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.welcome-banner p { margin: 0; color: rgba(255,255,255,.78); }
.welcome-kicker { color: #c6e3d1; font-size: .7rem; font-weight: 800; letter-spacing: .16em; }
.activity-list { display: grid; }
.activity-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 12px; background: #f0f5f2; color: var(--green); }
.activity-item strong, .activity-item small { display: block; }
.activity-item small { margin-top: 3px; color: var(--muted); }
.quick-links { display: grid; gap: 6px; }
.quick-links a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: #405247; font-weight: 600; }
.quick-links a:hover { background: #f2f7f3; color: var(--green); }
.quick-links a > i { width: 18px; color: var(--green); }
.admin-columns { display: grid; grid-template-columns: minmax(320px,.85fr) minmax(0,1.4fr); gap: 18px; align-items: start; }
.roles-layout { display: grid; grid-template-columns: minmax(250px,.7fr) minmax(0,1.8fr); gap: 18px; align-items: start; }
.role-option { display: flex; justify-content: space-between; gap: 10px; padding: 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.role-option small { color: var(--muted); }
.role-option.selected { border-color: #83b295; background: #eff8f1; }
.order-detail-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(310px,.8fr); gap: 18px; align-items: start; }
.search-row { display: flex; gap: 9px; }
.search-row .form-control { flex: 1; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 12px; }
.media-thumb { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f5f7f6; }
.media-thumb img,.media-thumb video { display: block; width: 100%; height: 110px; object-fit: cover; }
.media-thumb form { padding: 7px; }
.table-product-img { width: 46px; height: 46px; margin-right: 10px; border-radius: 9px; object-fit: cover; vertical-align: middle; }
.review-admin { padding: 20px 0; border-bottom: 1px solid var(--line); }
.review-admin:last-child { border-bottom: 0; }
.review-admin h3 { font-size: 1.05rem; }
.review-stars { display: flex; gap: 3px; color: #e6a623; }
.review-stars .star-empty { color: #dbe1dd; }
.review-card { padding: 15px 0; border-bottom: 1px solid var(--line); }
.review-card:last-child { border-bottom: 0; }
.review-card h3 { margin: 7px 0; font-size: 1rem; }
.review-card p { margin-bottom: 7px; }
.user-edit-row { display: grid; grid-template-columns: 1fr 1.3fr 1fr 1.2fr auto auto; gap: 7px; align-items: center; min-width: 840px; }
.cart-totals { display: grid; gap: 9px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cart-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.cart-totals span { color: var(--muted); }
.cart-totals .grand-total { padding-top: 9px; border-top: 1px dashed #d5dfd9; font-size: 1.1rem; }
.cart-totals .grand-total span,.cart-totals .grand-total b { color: var(--ink); font-weight: 800; }
.amount-in { color: #21804b; }

/* Admin shell */
.sidebar { position: fixed; z-index: 1030; inset: 0 auto 0 0; display: flex; width: 264px; flex-direction: column; padding: 20px 14px 14px; color: #fff; background: linear-gradient(180deg,#1455a6,#104a8d 72%,#103f78); border-right: 4px solid var(--orange); }
.brand { display: flex; align-items: center; gap: 11px; min-height: 62px; padding: 0 6px 17px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.18); }
.brand:hover { color: #fff; }
.brand-mark { display: grid; width: 43px; height: 43px; flex: 0 0 43px; place-items: center; border-radius: 13px; background: rgba(255,255,255,.16); color: #fff; font-size: 1.1rem; }
.brand strong,.brand small,.sidebar-user strong,.sidebar-user small { display: block; }
.brand strong { font-family: 'Manrope',sans-serif; font-size: .9rem; letter-spacing: .02em; }
.brand small { margin-top: 2px; color: rgba(255,255,255,.69); font-size: .72rem; }
.sidebar nav { display: grid; gap: 5px; padding-top: 18px; overflow: auto; }
.sidebar .nav-link { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 9px 11px; border-radius: 10px; color: rgba(255,255,255,.83); font-size: .88rem; font-weight: 600; transition: background .15s,color .15s; }
.sidebar .nav-link i { width: 19px; text-align: center; color: rgba(255,255,255,.72); }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.11); }
.sidebar .nav-link.active { color: var(--green-dark); background: #fff7f0; box-shadow: inset 4px 0 var(--orange); }
.sidebar .nav-link.active i { color: var(--green); }
.store-link { display: flex; align-items: center; gap: 9px; margin: auto 0 12px; padding: 11px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; color: #fff; font-size: .83rem; font-weight: 650; }
.store-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 12px 5px 0; border-top: 1px solid rgba(255,255,255,.18); }
.sidebar-user .avatar { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); font-weight: 800; }
.sidebar-user strong { max-width: 145px; overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: rgba(255,255,255,.66); font-size: .68rem; }
.sidebar-user > a { margin-left: auto; color: rgba(255,255,255,.8); padding: 7px; }
.main-area { min-height: 100vh; margin-left: 264px; }
.topbar { position: sticky; z-index: 100; top: 0; display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 16px; padding: 13px clamp(20px,3vw,38px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.topbar-label { color: var(--green); font-size: .64rem; font-weight: 800; letter-spacing: .16em; }
.topbar h1 { margin: 2px 0 0; font-size: 1.35rem; }
.topbar-store { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #cddbd2; border-radius: 10px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.page-content { max-width: 1600px; margin: 0 auto; padding: 24px clamp(18px,3vw,38px) 42px; }
.mobile-menu { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--green); }
.sidebar-scrim { display: none; }

/* Login */
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 28px 18px; background: radial-gradient(ellipse at 12% 15%,#e4f1e7 0,transparent 34%),radial-gradient(ellipse at 90% 85%,#fff0dc 0,transparent 32%),#f4f7f5; }
.login-card { width: min(100%, 460px); padding: 34px; background: #fff; border: 1px solid rgba(218,230,221,.9); border-radius: 22px; box-shadow: 0 24px 70px rgba(21,65,40,.13); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.login-brand .brand-mark { width: 50px; height: 50px; flex-basis: 50px; color: #fff; background: var(--green); font-size: 1.2rem; }
.login-brand strong,.login-brand small { display: block; }
.login-brand strong { font-family: 'Manrope',sans-serif; font-size: 1rem; }
.login-brand small { color: var(--muted); font-size: .8rem; }
.login-card h1 { font-size: 1.7rem; }
.login-card .form-control { min-height: 48px; }
.login-card .btn { min-height: 48px; }
.login-card .alert-info { --bs-alert-bg: #eef7f1; --bs-alert-border-color: #d7eadc; --bs-alert-color: #3c6248; }

/* Storefront */
.storefront { min-height: 100vh; background: #f5f7f6; }
.store-header { position: sticky; z-index: 100; top: 0; display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 clamp(18px,4vw,64px); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); box-shadow: 0 4px 18px rgba(31,55,41,.04); backdrop-filter: blur(12px); }
.store-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--green-dark); font-family: 'Manrope',sans-serif; font-size: 1rem; font-weight: 800; }
.store-logo > i { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: var(--green); color: #fff; }
.store-header nav { display: flex; align-items: center; gap: 22px; }
.store-header nav > a { color: #4b5b51; font-size: .88rem; font-weight: 650; }
.store-header nav > a:hover { color: var(--green); }
.store-header nav .cart-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid #cbdacf; border-radius: 999px; color: var(--green); }
.cart-pill b { display: grid; min-width: 22px; height: 22px; place-items: center; padding: 0 5px; border-radius: 50%; color: #fff; background: var(--green); font-size: .72rem; }
.store-container { width: min(1440px, 100%); min-height: calc(100vh - 122px); margin: 0 auto; padding: 32px clamp(16px,3.5vw,48px) 50px; }
.store-hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 26px 30px; margin-bottom: 24px; overflow: hidden; border-radius: 18px; color: #fff; background: linear-gradient(115deg,#124b32,#1d6b43 62%,#398a61); box-shadow: 0 16px 34px rgba(18,75,50,.14); }
.store-hero .eyebrow { color: #c8e9d4; }
.store-hero h1 { max-width: 620px; margin: 0; color: #fff; font-size: clamp(1.8rem,4vw,2.7rem); }
.store-hero p { margin: 8px 0 0; color: rgba(255,255,255,.77); }
.store-search { display: flex; width: min(380px,42%); min-height: 48px; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid rgba(255,255,255,.32); border-radius: 11px; background: rgba(255,255,255,.13); color: #fff; }
.store-search i { color: rgba(255,255,255,.78); }
.store-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: #fff; background: transparent; }
.store-search input::placeholder { color: rgba(255,255,255,.75); }
.store-layout { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 24px; align-items: start; }
.category-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 15px; scrollbar-width: thin; }
.category-chips a { flex: 0 0 auto; padding: 8px 13px; border: 1px solid #dce6df; border-radius: 999px; background: #fff; color: #52645a; font-size: .81rem; font-weight: 650; }
.category-chips a:hover,.category-chips a.selected { border-color: var(--green); color: #fff; background: var(--green); }
.product-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.store-product { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 5px 16px rgba(35,58,44,.045); transition: transform .18s ease,box-shadow .18s ease; }
.store-product:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(35,58,44,.1); }
.store-product-image { display: grid; aspect-ratio: 1.25; place-items: center; overflow: hidden; background: #edf2ee; color: #9ba99f; }
.store-product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.store-product:hover .store-product-image img { transform: scale(1.035); }
.store-product-image > span { font-size: 2.4rem; }
.store-product-info { display: grid; gap: 7px; padding: 15px; }
.store-product-info > small { color: var(--green); font-size: .7rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.store-product-info h2 { margin: 0; font-size: 1rem; line-height: 1.35; }
.store-product-info h2 a { color: var(--ink); }
.store-product-info h2 a:hover { color: var(--green); }
.store-product-info p { display: -webkit-box; min-height: 2.8em; margin: 0; overflow: hidden; color: var(--muted); font-size: .82rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.store-price { display: flex; align-items: baseline; gap: 9px; margin: 2px 0 5px; color: var(--green); font-family: 'Manrope',sans-serif; font-size: 1.12rem; font-weight: 800; }
.store-price del { color: #9aa69f; font-family: 'DM Sans',sans-serif; font-size: .8rem; font-weight: 500; }
.cart-panel { position: sticky; top: 88px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.cart-panel .panel-heading { margin-bottom: 8px; }
.cart-panel h2 { margin: 0; font-size: 1.25rem; }
.cart-panel .panel-heading p:not(.eyebrow) { margin: 3px 0 0; color: var(--muted); font-size: .83rem; }
.cart-panel .empty-state { padding: 28px 12px; }
.cart-lines { display: grid; max-height: 300px; gap: 12px; overflow: auto; padding: 8px 1px 15px; }
.cart-line { display: grid; grid-template-columns: 54px minmax(0,1fr) auto; gap: 10px; align-items: start; }
.cart-line > img,.cart-placeholder { display: grid; width: 54px; height: 54px; place-items: center; overflow: hidden; border-radius: 10px; background: #eff3f0; color: #9ba79f; object-fit: cover; }
.cart-line-body { min-width: 0; }
.cart-line-body strong,.cart-line-body small { display: block; }
.cart-line-body strong { overflow: hidden; font-size: .81rem; text-overflow: ellipsis; white-space: nowrap; }
.cart-line-body small { color: var(--muted); font-size: .73rem; }
.cart-line > b { font-size: .8rem; }
.cart-qty { display: flex; gap: 5px; margin-top: 5px; }
.cart-qty input { width: 58px; min-height: 31px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 7px; }
.cart-qty .btn { min-height: 30px; padding: 3px 8px; font-size: .7rem; }
.voucher-form { display: flex; gap: 7px; margin: 12px 0; }
.voucher-form .form-control { min-width: 0; }
.checkout-form { display: grid; gap: 10px; margin-top: 16px; }
.checkout-form h3 { margin: 1px 0 0; font-size: 1rem; }
.checkout-form small { color: var(--muted); font-size: .74rem; }
.checkout-form .btn { white-space: normal; }
.payment-note { padding: 10px 12px; border-radius: 9px; background: #f0f6f2; color: #46624f; font-size: .84rem; }
.order-success { display: flex; align-items: center; gap: 15px; padding: 16px 19px; margin-bottom: 18px; border: 1px solid #c7e4cf; border-radius: 13px; background: #edf8ef; color: #28643d; }
.order-success > i { font-size: 1.6rem; }
.order-success h1 { margin: 0; font-size: 1.1rem; }
.order-success p { margin: 3px 0 0; }
.store-footer { padding: 18px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .8rem; text-align: center; }
.product-detail { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(320px,.9fr); gap: clamp(24px,5vw,64px); align-items: start; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.product-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.product-gallery img,.product-gallery video,.gallery-empty { width: 100%; aspect-ratio: 1.15; border-radius: 12px; background: #eef2ef; object-fit: cover; }
.product-gallery img:first-child { grid-column: 1/-1; aspect-ratio: 1.45; }
.gallery-empty { display: grid; grid-column: 1/-1; place-items: center; color: #9aa79e; font-size: 3rem; }
.product-description { position: sticky; top: 100px; padding: 10px 0; }
.product-description h1 { margin: 7px 0 12px; font-size: clamp(1.8rem,4vw,2.5rem); }
.product-description .review-stars { align-items: center; margin-bottom: 13px; }
.product-description .review-stars span { margin-left: 7px; color: var(--muted); font-size: .8rem; }
.sku { color: var(--muted); font-size: .8rem; }
.store-price.large { margin: 16px 0; font-size: 1.7rem; }
.long-description { color: #526158; line-height: 1.8; }
.stock-state { color: var(--green); font-size: .85rem; font-weight: 700; }
.quantity-input { max-width: 120px; }
.product-description form > .btn { display: block; width: min(100%,320px); }
.reviews-section { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(300px,.8fr); gap: 24px; margin-top: 24px; }
.reviews-section > section:first-child { padding: 20px 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.gallery-empty i { font-size: 2.4rem; }

@media (max-width: 1150px) {
  .sidebar { width: 238px; }
  .main-area { margin-left: 238px; }
  .store-layout { grid-template-columns: minmax(0,1fr) 320px; gap: 16px; }
  .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .sidebar { width: 280px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 15px 0 35px rgba(12,35,23,.18); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 1020; inset: 0; background: rgba(15,30,21,.4); }
  body.sidebar-open .sidebar-scrim { display: block; }
  .main-area { margin-left: 0; }
  .mobile-menu { display: inline-grid; flex: 0 0 40px; place-items: center; }
  .topbar { justify-content: flex-start; min-height: 72px; padding-inline: 16px; }
  .topbar > div { flex: 1; }
  .topbar-store { padding: 8px; font-size: 0; }
  .topbar-store i { font-size: .95rem; }
  .page-content { padding: 18px 16px 30px; }
  .dashboard-grid,.admin-columns,.roles-layout,.order-detail-grid { grid-template-columns: minmax(0,1fr); }
  .welcome-banner { padding: 22px; }
  .store-layout { grid-template-columns: minmax(0,1fr); }
  .cart-panel { position: static; }
  .product-detail { grid-template-columns: minmax(0,1fr); }
  .product-description { position: static; }
  .reviews-section { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .login-card { padding: 25px 21px; border-radius: 17px; }
  .store-header { min-height: 60px; padding-inline: 13px; }
  .store-logo { font-size: .9rem; }
  .store-logo > i { width: 32px; height: 32px; }
  .store-header nav { gap: 10px; }
  .store-header nav > a { font-size: .78rem; }
  .store-header nav .cart-pill { padding: 7px 9px; }
  .store-container { padding: 16px 12px 28px; }
  .store-hero { align-items: stretch; flex-direction: column; gap: 17px; padding: 21px 19px; border-radius: 14px; }
  .store-search { width: 100%; min-height: 44px; }
  .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .store-product { border-radius: 12px; }
  .store-product-image { aspect-ratio: 1.05; }
  .store-product-info { gap: 5px; padding: 10px; }
  .store-product-info h2 { font-size: .86rem; }
  .store-product-info p { min-height: 2.4em; font-size: .75rem; }
  .store-product-info > small { font-size: .62rem; }
  .store-price { font-size: .98rem; }
  .store-product-info .btn { min-height: 36px; padding: .45rem .5rem; font-size: .78rem; }
  .cart-panel { padding: 15px; }
  .product-detail { padding: 15px; }
  .product-gallery { gap: 7px; }
  .reviews-section > section:first-child { padding: 16px; }
  .stat-grid { gap: 9px; }
  .stat-card { min-height: 120px; grid-template-columns: 36px minmax(0,1fr); gap: 9px; padding: 13px; }
  .stat-icon { width: 36px; height: 36px; border-radius: 10px; }
  .stat-value { font-size: 1.12rem; }
  .stat-label,.stat-note { font-size: .7rem; }
  .welcome-banner { align-items: flex-start; flex-direction: column; }
  .panel { padding: 16px; border-radius: 13px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .search-row { flex-wrap: wrap; }
  .search-row .form-control { flex-basis: 100%; }
  .user-edit-row { min-width: 760px; }
}


/* Saved admin branding. Status badges retain their semantic colors. */
.admin-theme .sidebar { background: linear-gradient(180deg,var(--green),var(--green-dark)); border-right-color: var(--system-color); }
.admin-theme .sidebar .nav-link.active { background: var(--green-soft); box-shadow: inset 4px 0 var(--system-color); }
.admin-theme .welcome-banner { background: linear-gradient(115deg,var(--green-dark),var(--green)); box-shadow: 0 14px 34px rgba(var(--theme-rgb),.18); }
.admin-theme .welcome-kicker { color: rgba(255,255,255,.85); }
.admin-theme .form-control:focus,.admin-theme .form-select:focus { border-color: var(--green); box-shadow: 0 0 0 .2rem var(--theme-ring); }
.admin-theme .btn-outline-success,.admin-theme .btn-outline-primary { --bs-btn-border-color: var(--theme-border); }
.admin-theme .topbar-store { border-color: var(--theme-border); }
.admin-theme .activity-icon,.admin-theme .quick-links a:hover { background: var(--green-soft); }
.admin-theme .role-option.selected { border-color: var(--theme-border); background: var(--green-soft); }
.brand > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.settings-logo-preview { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; }

/* Catalog workspace and forms */
.product-list-panel .table td:last-child { white-space: nowrap; }
.admin-theme .modal-content { border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.admin-theme .modal-header { padding: 22px 26px; background: var(--green-soft); border-bottom-color: var(--line); }
.admin-theme .modal-body { padding: 24px 26px; }
.admin-theme .modal-footer { padding: 16px 26px; border-top-color: var(--line); }
.form-section-title { margin: 10px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.import-guide { background: var(--green-soft); border-radius: 12px; padding: 18px; }
.import-guide p { margin-bottom: 12px; }
@media (max-width: 560px) { .admin-theme .modal-header,.admin-theme .modal-body,.admin-theme .modal-footer { padding: 16px; } }

.product-floating-field { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.product-floating-field > i { align-self: center; width: 42px; flex: 0 0 42px; color: var(--green); text-align: center; }
.product-floating-field .form-floating { flex: 1; min-width: 0; }
.product-floating-field .form-control,.product-floating-field .form-select { border: 0; border-radius: 0; }
.product-floating-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 .15rem var(--theme-ring); }
.product-floating-field .form-control:focus,.product-floating-field .form-select:focus { box-shadow: none; }
.quick-option-editor { padding: 12px; margin-top: 8px; background: var(--green-soft); border: 1px solid var(--theme-border); border-radius: 10px; }
#bulkStockActions[hidden] { display: none !important; }
@media print { .admin-theme .sidebar,.admin-theme .topbar,.admin-theme form,.admin-theme .btn { display: none !important; } .admin-theme .main-area { margin-left: 0; } }

/* Storefront CMS theme; both catalog and product pages share these tokens. */
.storefront { background: var(--canvas); font-family: var(--store-font, 'DM Sans'),sans-serif; color: var(--ink); }
.storefront h1,.storefront h2,.storefront h3,.storefront .store-logo,.storefront .store-price { font-family: var(--store-font, 'DM Sans'),sans-serif; }
.storefront .store-header,.storefront .store-footer,.storefront .store-product,.storefront .cart-panel,.storefront .product-detail,.storefront .reviews-section > section,.storefront .category-chips a { background: var(--paper); }
.storefront .store-header nav > a,.storefront .long-description { color: var(--ink); }
.storefront .store-header nav .cart-pill { color: var(--green); border-color: var(--theme-border); }
.storefront .store-logo > img { width: 40px; height: 40px; object-fit: contain; border-radius: 9px; }
.storefront .store-hero { background: linear-gradient(115deg,var(--hero-start),var(--hero-end)); color: var(--hero-text); border-radius: var(--radius); box-shadow: 0 16px 34px rgba(var(--theme-rgb),.14); align-items: center; flex-wrap: wrap; }
.storefront .store-hero h1,.storefront .store-hero p,.storefront .store-hero .eyebrow,.storefront .store-search,.storefront .store-search input,.storefront .store-search input::placeholder,.storefront .store-search i { color: var(--hero-text); }
.store-hero-copy { flex: 1 1 400px; }
.store-hero-image { width: 180px; height: 150px; object-fit: contain; border-radius: var(--radius); }
.storefront .store-product,.storefront .cart-panel,.storefront .product-detail,.storefront .panel,.storefront .btn,.storefront .category-chips a { border-radius: var(--radius); }
.storefront .product-grid { grid-template-columns: repeat(var(--store-columns,3),minmax(0,1fr)); }
.storefront .store-product-image img,.storefront .product-gallery img { object-fit: var(--store-image-fit,contain); }
.storefront .store-product-image,.storefront .cart-placeholder,.storefront .gallery-empty { background: var(--green-soft); }
.storefront .category-chips a.selected,.storefront .category-chips a:hover { background: var(--green); color: #fff; }
.storefront .category-chips a { color: var(--ink); }
.storefront .store-product-info p,.storefront .store-footer { color: var(--muted); }
.storefront .store-price { color: var(--green); }
.storefront .form-control,.storefront .form-select { color: var(--ink); background-color: var(--paper); }
.storefront .form-control:focus,.storefront .form-select:focus { border-color: var(--green); box-shadow: 0 0 0 .2rem var(--theme-ring); }
.storefront .btn-outline-success,.storefront .btn-outline-primary { --bs-btn-border-color: var(--theme-border); }
.storefront .payment-note { background: var(--green-soft); color: var(--green-dark); }
.store-announcement { padding: 10px 20px; text-align: center; background: var(--green); color: #fff; font-size: .85rem; }
.store-about { max-width: 760px; margin: 0 auto 24px; padding: 10px; }
.store-about h2 { font-size: 1.25rem; }
.store-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }
.cms-section { padding: 24px 0; border-top: 1px solid var(--line); }
.cms-section h3 { margin-bottom: 18px; }
.cms-save { position: sticky; bottom: 0; padding: 16px 0; background: var(--paper); border-top: 1px solid var(--line); }
@media(max-width:1150px) { .storefront .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:560px) { .store-hero-copy { flex-basis: auto; } .store-hero-image { align-self: center; } .storefront .store-header nav { gap: 8px; } }

/* CMS editor and actual storefront rendering, isolated until publication. */
.cms-workspace { display:grid; grid-template-columns:minmax(280px, 380px) minmax(0, 1fr); gap:24px; align-items:start; }
.cms-workspace form .row > [class*="col-"] { width:100%; }
.cms-preview-panel { position:sticky; top:100px; min-width:0; }
.cms-preview-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.cms-preview-panel .form-select { width:auto; }
.cms-preview-viewport { height: min(65vh, 750px); min-height:320px; overflow:hidden; background:#e8ebf0; border:1px solid var(--line); border-radius:10px; }
#cms-preview-frame { border:0; display:block; transform-origin:top left; background:white; }
.cms-workspace .cms-save { z-index:2; }
@media(max-width:1100px) { .cms-workspace { grid-template-columns:1fr; } .cms-preview-panel { position:static; grid-row:1; } .cms-preview-viewport { height:60vh; } }
