:root {
  --ink: #241c17;
  --ink-soft: #6f6259;
  --paper: #f6f3ed;
  --surface: #fffdf9;
  --line: #e7dfd4;
  --orange: #e76628;
  --orange-dark: #bd4819;
  --orange-soft: #fff0e6;
  --green: #47745e;
  --green-soft: #e9f3ed;
  --gold: #bb7b19;
  --gold-soft: #fff5db;
  --red: #b74236;
  --red-soft: #fcebea;
  --shadow: 0 14px 40px rgba(61, 42, 29, .07);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100%; color: var(--ink); background: var(--paper); font-family: "Noto Sans Thai", "Thonburi", "Leelawadee UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 264px; display: flex; flex-direction: column; padding: 30px 22px 22px; color: #f9f4ed; background: #231b16; }
.brand, .login-brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--orange); font-size: 15px; font-weight: 900; letter-spacing: -.04em; box-shadow: 0 8px 20px rgba(231, 102, 40, .28); }
.brand strong, .login-brand strong { display: block; font-size: 18px; line-height: 1.05; }
.brand small, .login-brand small { display: block; margin-top: 4px; color: #a99c91; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.main-nav { display: grid; gap: 6px; margin-top: 54px; }
.main-nav a { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 12px; color: #b9afa8; font-size: 14px; font-weight: 650; transition: .18s ease; }
.main-nav a:hover { color: white; background: rgba(255,255,255,.06); }
.main-nav a.active { color: white; background: rgba(231,102,40,.16); }
.nav-dot { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; }
.main-nav a.active .nav-dot { border-color: var(--orange); background: var(--orange); box-shadow: 0 0 0 4px rgba(231,102,40,.12); }
.sidebar-foot { margin-top: auto; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); }
.user-card { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #3b281c; background: #f5c479; font-weight: 800; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { color: white; font-size: 13px; }
.user-copy small { margin-top: 3px; color: #9f938b; font-size: 11px; }
.logout-button { margin-top: 16px; padding: 0; color: #a99c91; background: none; border: 0; cursor: pointer; font-size: 12px; }
.logout-button:hover { color: white; }

.main-content { min-height: 100vh; margin-left: 264px; }
.mobile-header { display: none; }
.page-wrap { width: min(1240px, calc(100% - 64px)); margin: 0 auto; padding: 46px 0 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.page-heading h1 { margin: 5px 0 4px; font-size: clamp(30px, 3.2vw, 45px); line-height: 1.14; letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.eyebrow { display: block; color: var(--orange-dark); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.light { color: #f3ad79; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 750; font-size: 13px; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--orange); box-shadow: 0 9px 22px rgba(231,102,40,.2); }
.button.primary:hover { background: var(--orange-dark); }
.button.secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button.ghost { color: var(--ink-soft); background: transparent; }
.button.wide { width: 100%; }
.messages { position: fixed; top: 18px; left: calc(264px + 50%); z-index: 60; transform: translateX(-50%); }
.message { min-width: 300px; padding: 12px 18px; border: 1px solid #bcd8c8; border-radius: 12px; color: #315a46; background: #eff9f3; box-shadow: var(--shadow); font-size: 13px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.metric-card { min-height: 158px; display: flex; flex-direction: column; justify-content: flex-end; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 28px rgba(61,42,29,.03); }
.metric-card small { color: var(--ink-soft); font-weight: 650; }
.metric-card strong { margin: 7px 0 3px; font: 800 38px/1.1 Georgia, serif; }
.metric-card span { color: #96877c; font-size: 11px; }
.metric-card.accent { color: white; border-color: #d95a22; background: linear-gradient(145deg, #f07839, #d8531f); box-shadow: 0 14px 34px rgba(210,83,31,.2); }
.metric-card.accent small, .metric-card.accent span { color: rgba(255,255,255,.78); }
.metric-card.warning strong { color: var(--red); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 9px 30px rgba(61,42,29,.035); }
.panel.span-two { grid-row: span 2; }
.panel-head { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.025em; }
.panel-head > a { color: var(--orange-dark); font-size: 12px; font-weight: 750; }
.recipe-table { padding: 8px; }
.recipe-row { display: grid; grid-template-columns: 48px minmax(180px, 1fr) auto 120px; gap: 14px; align-items: center; padding: 13px 14px; border-radius: 14px; }
.recipe-row:hover { background: #faf6f0; }
.recipe-thumb { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #8d4b25; background: #f5dfc8; font: 800 18px Georgia, serif; }
.recipe-main strong, .recipe-main small, .cost strong, .cost small { display: block; }
.recipe-main strong { font-size: 14px; }
.recipe-main small, .cost small { margin-top: 3px; color: #91847b; font-size: 10px; }
.cost { text-align: right; }
.cost strong { font-size: 13px; }
.status { display: inline-flex; align-items: center; width: max-content; padding: 5px 9px; border-radius: 999px; color: #755c30; background: var(--gold-soft); font-size: 9px; font-weight: 850; letter-spacing: .04em; }
.status.approved { color: #35604b; background: var(--green-soft); }
.status.review { color: #7b5a19; background: var(--gold-soft); }
.status.draft { color: #726760; background: #f0ece7; }
.status.archived { color: #8a3d36; background: var(--red-soft); }
.alert-list { display: grid; padding: 8px; }
.alert-list a { display: flex; justify-content: space-between; align-items: center; padding: 12px 13px; border-radius: 12px; }
.alert-list a:hover { background: var(--red-soft); }
.alert-list span strong, .alert-list span small { display: block; }
.alert-list span strong { font-size: 13px; }
.alert-list span small { color: var(--ink-soft); font-size: 10px; }
.alert-list b { color: var(--red); font-size: 13px; }
.calm-state { display: grid; justify-items: center; padding: 34px 18px 38px; text-align: center; }
.calm-mark { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 11px; border-radius: 50%; color: var(--green); background: var(--green-soft); font-weight: 900; }
.calm-state p { margin: 3px 0 0; color: var(--ink-soft); font-size: 12px; }
.activity-list { display: grid; padding: 13px 20px 20px; }
.activity-list > div { display: grid; grid-template-columns: 12px 1fr; gap: 10px; position: relative; }
.activity-list > div:not(:last-child)::after { position: absolute; top: 17px; bottom: -8px; left: 4px; width: 1px; content: ""; background: var(--line); }
.activity-dot { z-index: 1; width: 9px; height: 9px; margin-top: 5px; border: 2px solid var(--surface); border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 1px #efb694; }
.activity-list p { margin: 0 0 14px; color: var(--ink-soft); font-size: 11px; }
.activity-list p strong { color: var(--ink); }
.activity-list p small { display: block; margin-top: 2px; color: #a99b91; }
.empty-state { display: grid; justify-items: center; padding: 48px 24px; text-align: center; }
.empty-state > span { color: #d6c8bc; font: 800 36px Georgia, serif; }
.empty-state h2, .empty-state h3 { margin: 7px 0 4px; }
.empty-state p { max-width: 430px; margin: 0 0 17px; color: var(--ink-soft); font-size: 13px; }
.empty-state a:not(.button) { color: var(--orange-dark); font-weight: 700; }
.empty-state.large { margin-top: 20px; }

.filter-bar { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 22px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,249,.72); }
.filter-bar label { display: grid; gap: 5px; }
.filter-bar label > span { color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.filter-bar .search-field { flex: 1; }
.filter-bar input, .filter-bar select { height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: white; }
.filter-bar input:focus, .filter-bar select:focus { border-color: #ed9b6d; box-shadow: 0 0 0 3px rgba(231,102,40,.1); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.recipe-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 9px 28px rgba(61,42,29,.035); transition: .2s ease; }
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-image { position: relative; height: 190px; background-size: cover; background-position: center; }
.card-image.placeholder, .detail-image.placeholder { display: grid; place-items: center; color: #a65328; background: radial-gradient(circle at 68% 30%, rgba(255,255,255,.55), transparent 24%), linear-gradient(145deg, #f7dfc8, #edbd92); }
.card-image.placeholder > span, .detail-image.placeholder > span { font: 800 58px Georgia, serif; }
.card-image .status { position: absolute; top: 13px; right: 13px; backdrop-filter: blur(10px); }
.card-copy { padding: 18px; }
.card-copy > small { color: var(--orange-dark); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.card-copy h2 { margin: 5px 0 2px; font-size: 18px; letter-spacing: -.025em; }
.card-copy > p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.branch-scope { margin-top: 7px!important; color: var(--green)!important; font-weight: 750; }
.cost-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.cost-split span:last-child { padding-left: 12px; border-left: 1px solid var(--line); }
.cost-split small, .cost-split strong { display: block; }
.cost-split small { color: var(--ink-soft); font-size: 9px; }
.cost-split strong { margin-top: 2px; font-size: 16px; }
.danger-text { color: var(--red)!important; }

.breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; color: #978a80; font-size: 11px; }
.breadcrumb a:hover { color: var(--orange-dark); }
.recipe-hero { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.4fr); gap: 34px; align-items: center; }
.detail-image { aspect-ratio: 4/3; overflow: hidden; border-radius: 24px; background-size: cover; background-position: center; box-shadow: var(--shadow); }
.hero-meta { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; color: var(--ink-soft); font-size: 10px; }
.hero-copy h1 { margin: 12px 0 0; font-size: clamp(34px, 4.5vw, 58px); line-height: 1.06; letter-spacing: -.055em; }
.hero-copy .english-name { margin: 5px 0 12px; color: var(--orange-dark); font: italic 18px Georgia, serif; }
.hero-copy > p:last-of-type { max-width: 650px; color: var(--ink-soft); line-height: 1.75; }
.hero-actions { display: flex; gap: 9px; margin-top: 20px; }
.detail-metrics { display: grid; grid-template-columns: repeat(5, 1fr); margin: 34px 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.detail-metrics > div { padding: 17px 20px; }
.detail-metrics > div:not(:last-child) { border-right: 1px solid var(--line); }
.detail-metrics small, .detail-metrics strong { display: block; }
.detail-metrics small { color: var(--ink-soft); font-size: 9px; }
.detail-metrics strong { margin-top: 3px; font-size: 17px; }
.detail-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(250px,.7fr); gap: 18px; align-items: start; }
.detail-main, .detail-aside { display: grid; gap: 18px; }
.batch-chip { padding: 6px 10px; border-radius: 999px; color: var(--ink-soft); background: #f3eee7; font-size: 10px; }
.data-table { padding: 8px; }
.table-head, .table-row { display: grid; gap: 12px; align-items: center; }
.ingredient-lines .table-head, .ingredient-lines .table-row { grid-template-columns: 1fr 150px 100px; }
.table-head { padding: 10px 13px; color: #93867c; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.table-row { padding: 13px; border-top: 1px solid #eee8df; font-size: 12px; }
.table-row strong, .table-row small { display: block; }
.table-row small { margin-top: 3px; color: #988b80; font-size: 9px; }
.table-total { display: flex; justify-content: space-between; padding: 14px 13px 10px; border-top: 1px solid var(--line); font-size: 12px; }
.table-empty { padding: 32px; color: var(--ink-soft); text-align: center; font-size: 12px; }
.sop-panel { overflow: hidden; }
.step-list { padding: 14px 22px 28px; }
.sop-step { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 16px; position: relative; padding: 16px 0; }
.sop-step:not(:last-child)::before { position: absolute; top: 55px; bottom: -7px; left: 20px; width: 1px; content: ""; background: var(--line); }
.step-number { z-index: 1; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #efbf9f; border-radius: 50%; color: var(--orange-dark); background: var(--orange-soft); font: 800 13px Georgia, serif; }
.step-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.step-heading h3 { margin: 7px 0 0; font-size: 17px; }
.step-content > p { color: #5e534b; font-size: 13px; line-height: 1.75; }
.step-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.step-tags span { padding: 5px 8px; border-radius: 8px; color: #7a685b; background: #f2ede6; font-size: 9px; font-weight: 750; white-space: nowrap; }
.step-photo { width: 100%; max-height: 360px; object-fit: cover; border-radius: 15px; }
.step-photo.placeholder { min-height: 130px; display: grid; place-items: center; border: 1px dashed #d8c9bc; color: #9a8d83; background: #faf7f3; font-size: 11px; }
.quality-note, .corrective-note { margin-top: 11px; padding: 12px 14px; border-left: 3px solid var(--green); border-radius: 0 10px 10px 0; background: var(--green-soft); }
.corrective-note { border-left-color: var(--gold); background: var(--gold-soft); }
.quality-note strong, .corrective-note strong { font-size: 10px; }
.quality-note p, .corrective-note p { margin: 2px 0 0; color: var(--ink-soft); font-size: 11px; }
.compact-panel { padding: 20px; }
.definition-list { margin: 12px 0 0; }
.definition-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 11px; }
.definition-list dt { color: var(--ink-soft); }
.definition-list dd { margin: 0; text-align: right; font-weight: 650; }
.revision-list { display: grid; margin-top: 10px; }
.revision-list > div { display: grid; grid-template-columns: 36px 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.revision-list > div > strong { color: var(--orange-dark); font: 800 13px Georgia, serif; }
.revision-list span { font-size: 10px; }
.revision-list small { display: block; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }

.master-table .table-head, .master-table .table-row { grid-template-columns: 1.25fr 1.2fr .45fr .8fr .85fr 50px; }
.branch-table .table-head, .branch-table .table-row { grid-template-columns: 1.15fr .75fr .8fr .65fr .7fr 50px; }
.table-panel { overflow: hidden; }
.master-table .table-row.disabled { opacity: .5; }
.text-link { color: var(--orange-dark); font-size: 11px; font-weight: 750; }
.form-page.narrow { max-width: 920px; }
.editor-form { display: grid; gap: 18px; }
.form-section { padding: 26px; }
.section-title { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; margin-bottom: 24px; }
.section-title > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--orange-dark); background: var(--orange-soft); font: 800 12px Georgia, serif; }
.section-title h2 { margin: 0; font-size: 20px; }
.section-title p { margin: 2px 0 0; color: var(--ink-soft); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid.compact { gap: 13px; }
.field-wrap { min-width: 0; }
.field-wrap.wide { grid-column: 1/-1; }
.field-wrap > label, .formset-row label, .step-form-card label { display: grid; gap: 6px; color: #5f534b; font-size: 11px; font-weight: 700; }
.field-wrap label b { color: var(--orange); }
.form-control, .login-form input, .login-card input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #ded4ca; border-radius: 10px; outline: none; color: var(--ink); background: white; }
.checkbox-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 12px; margin: 0; padding: 12px; border: 1px solid #ded4ca; border-radius: 12px; background: white; list-style: none; }
.checkbox-list label { display: flex; gap: 7px; align-items: center; color: #5f534b; font-size: 11px; font-weight: 700; }
textarea.form-control { min-height: 84px; resize: vertical; }
.form-control:focus, .login-form input:focus, .login-card input:focus { border-color: #eb9462; box-shadow: 0 0 0 3px rgba(231,102,40,.11); }
.file-input { width: 100%; padding: 9px; border: 1px dashed #d7c7ba; border-radius: 10px; background: #fbf8f3; }
.checkbox { accent-color: var(--orange); }
.help-text { display: block; margin-top: 5px; color: #9a8d83; font-size: 9px; }
.field-error, .errorlist { display: block; margin: 4px 0 0; color: var(--red); font-size: 10px; }
.form-alert { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #efc0bc; border-radius: 10px; color: #913b33; background: var(--red-soft); font-size: 11px; }
.formset { display: grid; gap: 10px; }
.formset-head { display: grid; grid-template-columns: 1.35fr .7fr 1fr 45px; gap: 12px; padding: 0 13px; color: #94867c; font-size: 9px; text-transform: uppercase; }
.formset-row { display: grid; grid-template-columns: 1.35fr .7fr 1fr 45px; gap: 12px; position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fcfaf6; }
.dual-select { display: grid; grid-template-columns: 1fr auto 1fr; gap: 7px; align-items: end; }
.dual-select > span { padding-bottom: 13px; color: #a99b91; font-size: 9px; }
.quantity-fields { display: grid; grid-template-columns: 1fr .72fr; gap: 7px; }
.delete-field { display: flex; align-items: center; }
.delete-label { width: max-content; margin-top: 8px; color: var(--red)!important; }
.row-errors { grid-column: 1/-1; color: var(--red); font-size: 10px; }
.row-errors ul { margin: 4px 0; }
.add-row-button { width: max-content; padding: 8px 0; border: 0; color: var(--orange-dark); background: none; cursor: pointer; font-size: 11px; font-weight: 800; }
.step-form-card { display: grid; grid-template-columns: 75px 1fr; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fcfaf6; }
.step-form-number input { text-align: center; font-weight: 800; }
.inline-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sticky-actions { position: sticky; bottom: 14px; z-index: 15; display: flex; justify-content: flex-end; gap: 10px; width: max-content; margin-left: auto; padding: 8px; border: 1px solid rgba(221,211,201,.85); border-radius: 15px; background: rgba(255,253,249,.9); box-shadow: 0 12px 30px rgba(49,34,24,.12); backdrop-filter: blur(12px); }

.login-body { min-height: 100vh; background: #231b16; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(430px,1.05fr) minmax(420px,.95fr); }
.login-story { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; padding: 46px 56px; color: white; background: radial-gradient(circle at 80% 20%, rgba(231,102,40,.23), transparent 28%), radial-gradient(circle at 15% 90%, rgba(245,196,121,.11), transparent 25%), #231b16; }
.login-story::after { position: absolute; right: -110px; bottom: 70px; width: 370px; height: 370px; content: ""; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); }
.story-copy { z-index: 1; max-width: 650px; }
.story-copy h1 { margin: 12px 0 18px; font-size: clamp(50px, 6vw, 86px); line-height: .98; letter-spacing: -.065em; }
.story-copy p { max-width: 520px; color: #bcb0a7; font-size: 16px; line-height: 1.8; }
.login-proof { z-index: 1; display: flex; gap: 24px; flex-wrap: wrap; color: #a99d94; font-size: 10px; }
.login-proof strong { display: block; margin-bottom: 2px; color: #f7f0ea; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 34px; background: var(--paper); }
.login-card { width: min(420px, 100%); }
.login-card h2 { margin: 8px 0 3px; font-size: 34px; letter-spacing: -.04em; }
.login-card > .muted { margin: 0 0 26px; font-size: 13px; }
.login-form { display: grid; gap: 9px; }
.login-form label { margin-top: 7px; color: #62564e; font-size: 11px; font-weight: 750; }
.login-form input { min-height: 49px; }
.login-form .button { margin-top: 12px; min-height: 49px; }
.forgot-link { display: block; margin-top: 18px; color: var(--orange-dark); text-align: center; font-size: 11px; font-weight: 700; }
.security-note { margin-top: 45px; color: #a2968c; text-align: center; font-size: 9px; }
.login-body.simple { display: grid; place-items: center; padding: 30px; background: var(--paper); }
.login-card.standalone { padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.brand.compact { margin-bottom: 38px; color: var(--ink); }

.sidebar-overlay { display: none; }
@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .card-grid { grid-template-columns: repeat(2,1fr); }
  .detail-metrics { grid-template-columns: repeat(3,1fr); }
  .detail-metrics > div { border-bottom: 1px solid var(--line); }
  .master-table .table-head, .branch-table .table-head { display: none; }
  .master-table .table-row { grid-template-columns: 1.3fr 1fr .5fr .8fr; }
  .branch-table .table-row { grid-template-columns: 1.2fr .8fr .8fr .7fr; }
  .master-table .table-row > span:nth-child(5), .branch-table .table-row > span:nth-child(5) { display: none; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { position: fixed; inset: 0; z-index: 25; display: block; background: rgba(25,19,15,.42); backdrop-filter: blur(2px); }
  .main-content { margin-left: 0; }
  .mobile-header { position: sticky; top: 0; z-index: 20; height: 58px; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; border-bottom: 1px solid rgba(222,212,202,.85); background: rgba(246,243,237,.9); backdrop-filter: blur(12px); }
  .menu-button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 11px; }
  .mobile-brand { color: var(--orange-dark); font-weight: 900; }
  .mobile-brand span { margin-left: 3px; color: var(--ink); font-size: 11px; }
  .page-wrap { width: min(100% - 34px, 720px); padding-top: 28px; }
  .dashboard-grid, .detail-layout { grid-template-columns: 1fr; }
  .panel.span-two { grid-row: auto; }
  .recipe-hero { grid-template-columns: 1fr; }
  .detail-image { max-height: 430px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; }
  .messages { left: 50%; }
}
@media (max-width: 640px) {
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .metric-grid, .card-grid, .form-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 132px; }
  .recipe-row { grid-template-columns: 44px 1fr auto; }
  .recipe-row .status { display: none; }
  .recipe-row .cost { grid-column: 2/4; display: flex; gap: 8px; align-items: baseline; text-align: left; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar .button { width: 100%; }
  .detail-metrics { grid-template-columns: repeat(2,1fr); }
  .detail-metrics > div { border-right: 1px solid var(--line); }
  .detail-metrics > div:nth-child(even) { border-right: 0; }
  .hero-actions { flex-direction: column; }
  .form-section { padding: 18px; }
  .checkbox-list { grid-template-columns: 1fr; }
  .formset-head { display: none; }
  .formset-row { grid-template-columns: 1fr; }
  .dual-select { grid-template-columns: 1fr; }
  .dual-select > span { padding: 0; text-align: center; }
  .step-form-card { grid-template-columns: 1fr; }
  .step-form-number { width: 90px; }
  .inline-pair { grid-template-columns: 1fr 1fr; }
  .master-table .table-row { grid-template-columns: 1fr 1fr; }
  .branch-table .table-row { grid-template-columns: 1fr 1fr; }
  .master-table .table-row > span:nth-child(3) { display: none; }
  .ingredient-lines .table-head, .ingredient-lines .table-row { grid-template-columns: 1fr 100px; }
  .ingredient-lines .table-head span:last-child, .ingredient-lines .table-row span:last-child { display: none; }
  .sticky-actions { width: 100%; bottom: 8px; }
  .sticky-actions .button { flex: 1; }
}

