:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: #f7f3ed;
  color: #291d19;
  --ink: #291d19; --muted: #716158; --line: #e7ddd3;
  --white: #fffdf9; --accent: #9e3924; --rail: #29201c;
  --radius: 19px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #b24e36; outline-offset: 3px; }
button:disabled { opacity: .52; cursor: default; }
button { color: inherit; }
.icon { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rail { width: 235px; background: var(--rail); color: #fff6ea; position: fixed; inset: 0 auto 0 0; padding: 31px 19px 22px; display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 7px; font-size: 21px; font-weight: 760; }
.brand small { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: #dac5b6; }
.brand-mark { width: 44px; height: 44px; border-radius: 14px; background: #e7a38a; color: #3c231b; display: grid; place-items: center; font-family: Georgia, serif; font-size: 29px; font-weight: 700; }
.rail nav { display: grid; gap: 6px; margin-top: 48px; }
.nav-button { background: transparent; border: 0; text-align: left; color: #e7d9ce; display: flex; align-items: center; gap: 11px; padding: 12px 13px; min-height: 46px; border-radius: 11px; font-weight: 600; }
.nav-button:hover { background: #43332b; }
.nav-button[aria-current="page"] { background: #51392e; color: #fff0e4; }
.rail .nav-button[aria-current="page"] .icon { color: #f5b096; }
.rail-note { margin: auto 7px 0; padding-top: 18px; border-top: 1px solid #625149; color: #e7d9ce; font-size: 14px; }
.rail-note span { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; background: #e7a38a; }
.shell { margin-left: 235px; }
.topbar { min-height: 77px; display: flex; align-items: center; justify-content: space-between; padding: 12px max(28px, calc((100% - 1020px) / 2)); gap: 12px; background: var(--white); border-bottom: 1px solid var(--line); }
.top-caption { color: var(--muted); font-size: 14px; font-weight: 650; }
.mobile-brand, .mobile-nav { display: none; }
.role { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); white-space: nowrap; }
select { appearance: none; background: var(--white) no-repeat right 12px center / 12px 8px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23716158' stroke-width='1.7'/%3E%3C/svg%3E"); padding-right: 34px !important; }
.role select { font-weight: 680; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
main { max-width: 1076px; padding: 29px 28px 48px; margin: 0 auto; }
.hero { isolation: isolate; overflow: hidden; position: relative; background: #492d25; color: #fff6ed; padding: 35px 36px 37px; border-radius: 23px; min-height: 204px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border: 1px solid #99604b; border-radius: 50%; width: 410px; height: 410px; right: -92px; top: -106px; box-shadow: 0 0 0 19px #492d25, 0 0 0 20px #80543f, 0 0 0 39px #492d25, 0 0 0 40px #80543f, 0 0 0 59px #492d25, 0 0 0 60px #80543f; }
.hero::after { width: 128px; height: 128px; right: 47px; top: 37px; opacity: .7; box-shadow: none; background: #754735; }
.hero h1 { font-family: Georgia, serif; font-weight: 600; font-size: clamp(2.45rem, 5vw, 3.8rem); line-height: 1; margin: 9px 0 12px; letter-spacing: -.045em; }
.hero p { max-width: 360px; color: #f4ddd0; margin: 0; }
.eyebrow { font-size: 13px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: #f9b79e; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 27px 0 13px; }
.section-heading h2 { font-size: 1.35rem; margin: 0; }
.section-heading span, .muted, .field small { color: var(--muted); font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tile { display: grid; grid-template-columns: 49px minmax(0, 1fr); align-items: center; gap: 14px; text-align: left; background: var(--white); border: 1px solid var(--line); padding: 17px; min-height: 91px; border-radius: var(--radius); transition: border-color .15s, background .15s; }
.tile:hover { border-color: #bd917c; background: #fff9f2; }
.tile strong { display: block; font-size: 1.06rem; }
.tile small { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.tile-icon { width: 49px; height: 49px; display: grid; place-items: center; border-radius: 14px; background: #f3dfd7; color: #8a3927; }
.tile[data-go="table"] .tile-icon { background: #f1e6c9; color: #6f5015; }
.tile[data-go="stock"] .tile-icon { background: #e2eadb; color: #3c593a; }
.tile[data-go="order"] .tile-icon { background: #f3e4cf; color: #765027; }
.entry, .list-row { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 17px; border-top: 1px solid var(--line); }
.entry:first-child, .list-row:first-child { border-top: 0; }
.entry span, .list-row small { color: var(--muted); font-size: 14px; }
.list-row small { display: block; margin-top: 4px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.page-title { margin: 0 0 20px; }
.page-title h1 { font-family: Georgia, serif; letter-spacing: -.035em; margin: 0 0 6px; font-size: clamp(2.1rem, 4vw, 3.15rem); line-height: 1.04; }
.page-title p { color: var(--muted); margin: 0; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.form-panel { padding: 18px; min-width: 0; }
.form-panel h2 { font-size: 1.16rem; margin: 0 0 14px; }
.form-wide { grid-column: 1 / -1; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 650; }
.field input, .field textarea, .field select, .toolbar input { width: 100%; min-width: 0; padding: 9px 11px; min-height: 45px; border: 1px solid #dacec2; background-color: #fff; border-radius: 9px; color: var(--ink); }
.field textarea { resize: vertical; min-height: 76px; }
.span-2 { grid-column: 1 / -1; }
.amount { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 12px; }
.amount output, .amount strong { font-weight: 800; font-size: 1.16rem; }
.checkbox { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; font-weight: 620; }
.checkbox input { width: 19px; height: 19px; accent-color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 15px; }
.primary, .secondary, .chip { min-height: 44px; border-radius: 10px; padding: 8px 14px; font-weight: 700; }
.primary { border: 1px solid var(--accent); color: white; background: var(--accent); }
.primary:hover { background: #812c1b; }
.secondary, .chip { background: var(--white); border: 1px solid #dacec2; }
.secondary:hover, .chip:hover { background: #f7ebe0; }
.chip[aria-pressed="true"] { background: #f3dfd7; border-color: #c98874; color: #74321f; }
.toolbar, .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 13px; }
.toolbar input { flex: 1 1 160px; }
.toolbar-label { flex: 1 1 170px; }
.row-pill { display: inline-block; padding: 4px 8px; background: #f7e8e0; color: #813820; border-radius: 7px; font-weight: 700; font-size: 13px; margin-top: 4px; }
.stepper { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.stepper button { min-width: 38px; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #f8efe6; font-size: 20px; }
.stepper input { appearance: textfield; width: 52px; min-height: 42px; text-align: center; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; }
.stepper input::-webkit-inner-spin-button { appearance: none; }
.compact-select { max-width: 140px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); padding: 6px 8px; }
.photo-name { overflow-wrap: anywhere; }
.photo { width: min(100%, 370px); max-height: 245px; object-fit: contain; border-radius: 9px; }
.empty { margin: 0; padding: 20px; color: var(--muted); }
dialog { max-width: min(550px, calc(100% - 24px)); width: 100%; max-height: calc(100dvh - 24px); border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 19px; padding: 21px; }
dialog::backdrop { background: #251916a8; }
dialog h2 { margin-top: 0; }
dialog dl { margin: 0; }
dialog dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 9px 0; }
dialog dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 10; right: 17px; bottom: 17px; max-width: min(380px, calc(100vw - 34px)); pointer-events: none; background: #31231d; color: #fff7ed; padding: 12px 17px; border-radius: 11px; box-shadow: 0 4px 18px #36201d32; }
.toast:empty { display: none; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .rail, .top-caption { display: none; }
  .shell { margin: 0; }
  .mobile-brand { display: block; font-weight: 800; font-size: 1.1rem; }
  .topbar { min-height: 62px; padding: 10px 14px; }
  .role { gap: 5px; }
  .role span { font-size: 13px; }
  .role select { max-width: 154px; font-size: 14px; }
  main { padding: 16px 14px calc(90px + env(safe-area-inset-bottom)); }
  .hero { min-height: 186px; padding: 23px 19px; }
  .hero::before { opacity: .55; right: -272px; }
  .hero::after { display: none; }
  .tiles { gap: 8px; }
  .tile { grid-template-columns: 1fr; gap: 8px; min-height: 128px; padding: 12px; align-content: start; }
  .tile small { line-height: 1.24; }
  .tile-icon { width: 39px; height: 39px; border-radius: 11px; }
  .mobile-nav { z-index: 5; position: fixed; inset: auto 0 0; display: flex; justify-content: space-evenly; background: var(--white); border-top: 1px solid var(--line); padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); }
  .mobile-nav .nav-button { flex: 1; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 4px; color: var(--muted); text-align: center; font-size: 12px; min-width: 0; min-height: 47px; }
  .mobile-nav .nav-button[aria-current="page"] { background: #f3dfd7; color: #752e1e; }
  .mobile-nav .icon { width: 19px; height: 19px; }
  .form-layout { grid-template-columns: 1fr; gap: 9px; }
  .panel, .form-panel { border-radius: 14px; }
  .list-row, .entry { padding: 10px; gap: 8px; }
  .toast { bottom: calc(67px + env(safe-area-inset-bottom)); }
}
@media (max-width: 375px) {
  .role > span { display: none; }
  .stepper button { min-width: 33px; }
}
