:root {
  color-scheme: light;
  --ink: #15231f;
  --muted: #68756f;
  --surface: #fff;
  --surface-soft: #f3f6f4;
  --line: #dce5e0;
  --brand: #153b34;
  --brand-2: #256f5e;
  --accent: #e6a23c;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(21, 59, 52, .12);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--surface-soft); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--brand-2); font-size: 12px; font-weight: 800; letter-spacing: .13em; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, rgba(230,162,60,.25), transparent 30%), linear-gradient(135deg, #eef4f0 0%, #dcebe4 100%); }
.login-card { width: min(430px, 100%); padding: 42px; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.login-card h1 { margin: 4px 0 8px; font-size: 32px; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 18px; background: var(--brand); color: #fff; font-size: 28px; font-weight: 900; box-shadow: 0 10px 24px rgba(21,59,52,.25); }
.brand-mark.small { width: 38px; height: 38px; margin: 0; border-radius: 12px; font-size: 19px; }
label { display: block; margin: 18px 0 7px; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(37,111,94,.12); }
button { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 750; }
.primary { background: var(--brand); color: #fff; }
.primary:hover { background: #0c2e28; }
.secondary { border: 1px solid var(--line); background: #fff; color: var(--brand); }
.quiet { background: transparent; color: inherit; }
.wide { width: 100%; margin-top: 20px; }
.form-error { min-height: 20px; color: var(--danger); font-size: 13px; }
.app-shell { min-height: 100vh; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.brand-inline, .topbar-actions, .user-card, .cart-title { display: flex; align-items: center; gap: 12px; }
.brand-inline div { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.brand-inline strong { font-size: 16px; color: var(--ink); }
.network-state { padding: 5px 9px; border-radius: 999px; background: #e2f3eb; color: #176448; font-size: 12px; font-weight: 800; }
.network-state.offline { background: #fee4e2; color: #b42318; }
.workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.user-card { padding: 12px; margin-bottom: 20px; border-radius: 14px; background: var(--surface-soft); }
.user-card div { display: flex; flex-direction: column; min-width: 0; }
.user-card span { color: var(--muted); font-size: 12px; }
.avatar { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #d9ebe4; color: var(--brand); font-weight: 900; }
nav { display: grid; gap: 6px; }
.nav-button { display: flex; gap: 12px; width: 100%; padding: 12px; background: transparent; color: var(--muted); text-align: left; }
.nav-button.active { background: #e8f1ed; color: var(--brand); }
.content { min-width: 0; padding: 30px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-heading h2 { margin: 0; font-size: 27px; }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 22px; align-items: start; }
.catalog-panel, .cart-panel, .orders-list { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 30px rgba(21,59,52,.05); }
.catalog-panel { padding: 22px; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 20px; }
.product-card { display: flex; flex-direction: column; min-height: 185px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfb; }
.product-card h3 { margin: 0 0 7px; font-size: 16px; line-height: 1.3; }
.product-meta { color: var(--muted); font-size: 12px; }
.product-footer { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
.product-price { font-weight: 850; }
.add-button { min-width: 42px; padding: 9px 11px; background: var(--brand); color: #fff; }
.cart-panel { position: sticky; top: 90px; padding: 20px; }
.cart-title { justify-content: space-between; }
.cart-title h3 { margin: 0; font-size: 21px; }
.count-badge { min-width: 30px; padding: 5px 9px; border-radius: 999px; background: var(--accent); color: #32240d; text-align: center; font-weight: 900; }
.cart-items { display: grid; gap: 10px; max-height: 310px; overflow: auto; margin: 18px 0; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cart-item small { display: block; color: var(--muted); }
.cart-controls { display: flex; align-items: center; gap: 7px; }
.cart-controls button { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); background: #fff; }
.remove-button { color: var(--danger); }
.empty-state { padding: 28px 8px; color: var(--muted); text-align: center; }
.total-row { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 18px; }
.orders-list { overflow: hidden; }
.order-row { display: grid; grid-template-columns: 150px 1fr 130px 150px 110px; gap: 14px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.order-row:last-child { border-bottom: 0; }
.order-row small { display: block; color: var(--muted); }
.status-pill { width: fit-content; padding: 5px 9px; border-radius: 999px; background: #edf2f0; color: var(--brand); font-size: 12px; font-weight: 800; }
.status-pill.submitted { background: #fff0d7; color: #855d13; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: 390px; padding: 13px 16px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow); transform: translateY(120px); opacity: 0; transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--danger); }
@media (max-width: 980px) {
  .workspace { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 16px 8px; }
  .user-card div { display: none; }
  .user-card { justify-content: center; }
  .nav-button { justify-content: center; font-size: 0; }
  .nav-button span { font-size: 21px; }
  .order-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
}
@media (max-width: 650px) {
  .topbar { padding: 0 14px; }
  .network-state { display: none; }
  .workspace { display: block; padding-bottom: 70px; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; padding: 7px 12px env(safe-area-inset-bottom); border: 0; border-top: 1px solid var(--line); }
  .sidebar .user-card { display: none; }
  .sidebar nav { grid-template-columns: 1fr 1fr; }
  .nav-button, .nav-button.active { justify-content: center; font-size: 12px; }
  .nav-button span { font-size: 18px; }
  .content { padding: 20px 14px; }
  .page-heading { align-items: end; }
  .page-heading h2 { font-size: 23px; }
  .catalog-panel { padding: 15px; }
  .catalog-grid { grid-template-columns: 1fr; }
  .order-row { grid-template-columns: 1fr auto; }
  .order-row > *:nth-child(3), .order-row > *:nth-child(4) { display: none; }
  .login-card { padding: 28px 22px; }
}
