:root {
  color-scheme: light;
  --coal: #211f1c;
  --coal-soft: #302d29;
  --paper: #eeece6;
  --surface: #faf9f5;
  --line: #d8d3c8;
  --line-dark: #4a4640;
  --ink: #292722;
  --muted: #777166;
  --rust: #9e3e32;
  --rust-dark: #7d3028;
  --brass: #a17d46;
  --green: #537653;
  --radius: 3px;
  --display: "Bahnschrift", "Arial Narrow", "Franklin Gothic Medium", sans-serif;
  --body: "Segoe UI", "Trebuchet MS", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.45 var(--body); }
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 23px 15px 17px; color: #eeece6; background-color: var(--coal); background-image: repeating-linear-gradient(3deg, transparent 0 19px, #ffffff05 20px, transparent 21px), linear-gradient(90deg, #0002, transparent 32%, #ffffff05 74%, #0002); border-right: 1px solid #111; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-dark); }
.brand-mark { width: 43px; aspect-ratio: 1; position: relative; display: grid; place-items: center; border: 1px solid #aaa08f; border-radius: 50%; color: #f3efe6; font: 800 14px var(--display); letter-spacing: 0; }
.brand-mark::before { position: absolute; inset: 4px; content: ""; border: 1px solid #70685b; border-radius: 50%; }
.brand-copy strong { display: block; font: 800 14px/1.15 var(--display); letter-spacing: 0; text-transform: uppercase; }
.brand-copy small { display: block; margin-top: 4px; color: #aaa397; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; }
.nav-caption { margin: 23px 10px 8px; color: #9b9385; font-size: 9px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; }
.primary-nav { display: grid; gap: 3px; }
.nav-link { min-height: 39px; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-left: 2px solid transparent; color: #c9c4ba; border-radius: 1px; font-size: 12px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.nav-link:hover { color: #fff; background: #ffffff0b; }
.nav-link.is-active { color: #fff; border-left-color: #b24b3d; background: #ffffff0d; }
.nav-mark { width: 7px; height: 7px; border: 1px solid #8e877b; transform: rotate(45deg); }
.nav-link.is-active .nav-mark { border-color: #c97462; background: #9e3e32; }
.sidebar-foot { margin-top: auto; padding: 15px 10px 0; border-top: 1px solid var(--line-dark); color: #c5bfb3; font-size: 10px; line-height: 1.8; }
.sidebar-foot small { margin-left: 13px; color: #918a7f; font-size: 9px; letter-spacing: .5px; }
.status-pip { width: 6px; height: 6px; display: inline-block; margin: 0 7px 1px 0; border-radius: 50%; background: #718b60; box-shadow: 0 0 0 3px #718b6022; }
.main-area { min-width: 0; }
.topbar { height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 32px; border-bottom: 1px solid var(--line); background: #f7f6f1; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.breadcrumbs i { color: #b1aa9c; font-style: normal; }
.breadcrumbs strong { color: var(--ink); font-weight: 700; }
.user-menu { display: flex; align-items: center; gap: 9px; }
.user-badge { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #827a6d; border-radius: 50%; color: var(--coal); background: #e7e2d7; font: 800 13px var(--display); }
.user-name { font-size: 11px; font-weight: 700; }
.user-name small { display: block; color: var(--muted); font-size: 9px; font-weight: 500; }
.user-menu form { margin-left: 7px; padding-left: 13px; border-left: 1px solid var(--line); }
.text-button { padding: 5px 0; border: 0; color: #6d675c; background: none; font-size: 11px; font-weight: 650; }
.text-button:hover { color: var(--rust); }
.page-wrap { width: min(1450px, 100%); margin: 0 auto; padding: 29px 32px 50px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin-bottom: 6px; color: var(--rust); font-size: 9px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font: 800 29px/1.15 var(--display); letter-spacing: 0; text-transform: uppercase; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; border: 1px solid #c9c3b7; border-radius: var(--radius); color: #454138; background: #faf9f5; font-size: 11px; font-weight: 700; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.button:hover { border-color: #8d8679; background: #fff; }
.button-primary { border-color: var(--rust); color: #fff; background: var(--rust); }
.button-primary:hover { border-color: var(--rust-dark); color: #fff; background: var(--rust-dark); }
.button-quiet { background: transparent; }
.button-danger { border-color: #d8b8b2; color: #8c362d; background: transparent; }
.button-danger:hover { border-color: #a5483d; color: #7d3028; background: #f8efed; }
.button-small { min-height: 28px; padding: 0 9px; font-size: 10px; }
.button-wide { width: 100%; min-height: 42px; }
.button:disabled, button:disabled { cursor: not-allowed; opacity: .43; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 15px; }
.stat-card { min-height: 102px; padding: 15px 17px; border: 1px solid var(--line); border-top: 2px solid #80745f; background: #f8f7f2; }
.stat-card span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.stat-card strong { display: block; margin-top: 7px; font: 800 27px/1 var(--display); }
.stat-card small { display: block; margin-top: 5px; color: #8a8479; font-size: 9px; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.panel-heading { min-height: 59px; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font: 800 14px var(--display); letter-spacing: .2px; text-transform: uppercase; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.panel-body { padding: 14px 16px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 13px; }
.inline-link { color: var(--rust); font-size: 10px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.inline-link:hover { text-decoration: underline; }
.warehouse-list { display: grid; }
.warehouse-row { display: grid; grid-template-columns: minmax(115px, 1fr) minmax(70px, 1.2fr) 75px; align-items: center; gap: 12px; min-height: 49px; border-bottom: 1px solid #ebe8e1; }
.warehouse-row:last-child { border-bottom: 0; }
.warehouse-meta strong { display: block; font-size: 11px; }
.warehouse-meta small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.bar-track { height: 5px; overflow: hidden; background: #e7e3da; }
.bar-track span { height: 100%; display: block; background: var(--rust); }
.quantity-label { font: 750 11px var(--display); text-align: right; }
.movement-list { display: grid; }
.movement-row { min-height: 54px; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px 0; border-bottom: 1px solid #ebe8e1; }
.movement-row:last-child { border-bottom: 0; }
.movement-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--green); }
.dot-out { background: var(--rust); }
.dot-transfer { background: var(--brass); }
.movement-description strong { display: block; font-size: 10px; }
.movement-description small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.movement-amount { font: 750 11px var(--display); }
.amount-in { color: var(--green); }
.amount-out { color: var(--rust); }
.empty-state { padding: 19px 6px; color: var(--muted); font-size: 11px; text-align: center; }
.empty-state.compact { padding: 9px 0 15px; }
.empty-state.padded { padding: 26px 18px; }
.setup-banner { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 0 0 14px; padding: 18px 20px; border: 1px solid #c7b99f; border-left: 3px solid var(--brass); background: #f3efe5; }
.setup-banner h2 { margin: 0 0 5px; font: 800 16px var(--display); text-transform: uppercase; }
.setup-banner p { margin: 0; color: #6e675a; font-size: 11px; }
.role-hint { color: #74684f; font-size: 10px; }
.account-panel { margin-top: 13px; }
.user-create-panel { margin-bottom: 13px; }
.inline-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; padding: 13px 16px; }
.inline-form label { min-width: 190px; flex: 0 1 240px; }
.inline-form input { margin-top: 5px; }
.notice { margin-bottom: 15px; padding: 10px 13px; border: 1px solid #cbbd9e; border-left: 3px solid var(--brass); background: #f4efe3; color: #564d3b; font-size: 11px; }
.notice-error { border-color: #d8b4ad; border-left-color: var(--rust); background: #f8eeeb; color: #73332c; }
.notice-success { border-color: #b9c9b3; border-left-color: var(--green); background: #eff4ec; color: #39563a; }
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filter-bar label { min-width: 155px; flex: 0 1 190px; }
.filter-bar .search-field { min-width: 190px; flex: 1 1 230px; }
input, select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #d5d0c6; border-radius: var(--radius); outline: none; color: var(--ink); background: #fffefa; font-size: 11px; }
input:focus, select:focus { border-color: #948a78; box-shadow: 0 0 0 2px #87795c18; }
input::placeholder { color: #9b9589; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 10px 14px; color: #777166; background: #f4f2ec; font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
.data-table td { min-height: 42px; padding: 10px 14px; border-top: 1px solid #ebe8e1; font-size: 11px; vertical-align: middle; }
.data-table tbody tr:hover { background: #f7f5ef; }
.data-table td strong { font-size: 11px; }
.data-table .numeric { text-align: right; white-space: nowrap; }
.data-table .total-cell { font-weight: 800; }
.data-table .category-cell { color: #716b60; }
.data-table .low-stock { color: var(--rust); font-weight: 750; }
.table-subline { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.table-empty { padding: 27px 15px !important; color: var(--muted); text-align: center; }
.form-panel { width: min(780px, 100%); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 13px; padding: 17px; }
.form-grid label, .compact-form label, .item-create-form label, .stack-form label { display: grid; gap: 6px; color: #514d44; font-size: 10px; font-weight: 750; }
.form-grid label input, .form-grid label select { font-weight: 400; }
.span-all { grid-column: 1 / -1; }
.optional { color: var(--muted); font-weight: 400; }
.form-actions { display: flex; justify-content: end; padding-top: 4px; border-top: 1px solid #ebe8e1; }
.setup-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.manage-list { display: grid; }
.manage-row { min-height: 50px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #ebe8e1; }
.manage-row:last-child { border-bottom: 0; }
.manage-row.is-child { padding-left: 13px; }
.manage-row strong { display: block; font-size: 11px; }
.manage-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.manage-row form { flex: 0 0 auto; }
.manage-actions { display: flex; align-items: center; gap: 6px; }
.manage-edit { position: relative; }
.manage-edit summary { color: #665f53; font-size: 10px; font-weight: 700; cursor: pointer; }
.manage-edit form { position: absolute; z-index: 4; top: 22px; right: 0; width: 220px; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 5px 15px #211f1c20; text-align: left; }
.manage-edit label { display: grid; gap: 4px; color: #514d44; font-size: 9px; font-weight: 700; }
.manage-edit .button { justify-self: start; }
.item-actions { justify-content: end; }
.compact-form { display: grid; gap: 10px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.compact-form h3 { margin: 0 0 2px; font: 800 12px var(--display); text-transform: uppercase; }
.compact-form .button { justify-self: start; }
.section-gap { margin-top: 14px; }
.item-create-form { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); align-items: end; gap: 10px; padding: 3px 0 15px; }
.item-create-form .button { min-height: 36px; }
.inline-delete { display: inline-flex; }
.role-callout { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 13px; padding: 12px 15px; border: 1px solid var(--line); background: #f6f4ee; color: #716b60; font-size: 10px; }
.role-callout > strong { color: var(--ink); font: 800 12px var(--display); text-transform: uppercase; }
.role-callout b { color: #49453c; }
.role-tag { display: inline-block; padding: 3px 7px; border: 1px solid #d8d2c7; color: #625c51; background: #f5f2eb; font-size: 9px; font-weight: 750; }
.role-superadmin { border-color: #bda77b; color: #705222; background: #f3ecdc; }
.role-admin { border-color: #d3b0a7; color: #853e32; background: #f5eae7; }
.user-actions { display: flex; align-items: center; justify-content: end; gap: 7px; flex-wrap: wrap; }
.user-actions form { display: flex; align-items: center; gap: 5px; }
.user-actions select, .user-actions input { width: auto; min-width: 88px; height: 28px; font-size: 10px; }
.reset-details { position: relative; }
.reset-details summary { color: #6c6559; font-size: 10px; font-weight: 700; cursor: pointer; }
.reset-details form { position: absolute; z-index: 3; top: 24px; right: 0; width: 245px; padding: 9px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 5px 15px #211f1c20; }
.muted { color: var(--muted); font-size: 10px; }
.page-footnote { margin: 12px 0 0; color: var(--muted); font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.auth-body { min-height: 100vh; background: #e8e5dd; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, .82fr) minmax(390px, 1.18fr); }
.auth-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden; padding: 40px 30px; color: #eee9df; text-align: center; background-color: var(--coal); background-image: repeating-linear-gradient(3deg, transparent 0 23px, #ffffff06 24px, transparent 25px), linear-gradient(120deg, #161513, #302a23 62%, #201e1a); }
.auth-brand-panel::before, .auth-brand-panel::after { position: absolute; left: 10%; right: 10%; height: 1px; content: ""; background: #a8957155; }
.auth-brand-panel::before { top: 15%; }
.auth-brand-panel::after { bottom: 15%; }
.auth-emblem { width: 158px; height: 158px; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 1px solid #aaa08e; border-radius: 50%; box-shadow: inset 0 0 0 6px #211f1c, inset 0 0 0 7px #716858; color: #ddd6c9; }
.emblem-top, .emblem-bottom { color: #bdb4a4; font: 800 9px var(--display); letter-spacing: 1.8px; }
.emblem-mark { margin: 3px 0; font: 900 61px/.95 var(--display); letter-spacing: 0; }
.emblem-bottom { font-size: 8px; }
.auth-brand-title { margin-top: 24px; font: 800 19px/1.15 var(--display); letter-spacing: .8px; text-transform: uppercase; }
.auth-rule { width: 51px; height: 2px; margin: 17px auto 13px; background: var(--rust); }
.auth-brand-panel p { margin: 0; color: #e6dfd1; font-size: 10px; font-weight: 800; letter-spacing: 2px; }
.auth-brand-panel p span { display: block; margin-top: 5px; color: #a9a092; font-size: 9px; font-weight: 500; letter-spacing: 1px; }
.auth-panel-foot { position: absolute; bottom: 7%; color: #8f887c; font-size: 8px; letter-spacing: 1.7px; }
.auth-main { display: grid; place-items: center; padding: 35px; background-color: var(--paper); background-image: repeating-linear-gradient(0deg, #88795608 0 1px, transparent 1px 5px); }
.auth-card { width: min(390px, 100%); padding: 34px 32px; border: 1px solid #d6d0c3; border-top: 3px solid var(--rust); background: #faf9f5; box-shadow: 0 18px 44px #211f1c12; }
.auth-card h1 { margin-bottom: 7px; font-size: 27px; }
.auth-card .lead { margin: 0 0 22px; color: var(--muted); font-size: 11px; }
.stack-form { display: grid; gap: 14px; }
.stack-form label small { color: var(--muted); font-size: 9px; font-weight: 400; }
.stack-form input { height: 40px; }
.auth-switch { margin: 19px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.auth-switch a { color: var(--rust); font-weight: 750; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-footnote { margin-top: 25px; padding-top: 13px; border-top: 1px solid var(--line); color: #928b7f; font-size: 9px; text-align: center; }
.auth-card .notice { margin: 0 0 14px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 215px minmax(0, 1fr); }
  .page-wrap { padding-right: 23px; padding-left: 23px; }
  .topbar { padding-right: 23px; padding-left: 23px; }
  .content-grid { grid-template-columns: 1fr; }
  .item-create-form { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
}
@media (max-width: 700px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 10px 12px 0; border-right: 0; border-bottom: 1px solid #12110f; }
  .brand { padding: 0 4px 10px; border: 0; }
  .brand-mark { width: 34px; }
  .brand-copy strong { font-size: 12px; }
  .brand-copy small { font-size: 8px; }
  .nav-caption, .sidebar-foot { display: none; }
  .primary-nav { display: flex; overflow-x: auto; gap: 3px; padding: 2px 0 8px; scrollbar-width: thin; }
  .nav-link { min-height: 34px; flex: 0 0 auto; gap: 7px; padding: 6px 9px; border: 0; border-bottom: 2px solid transparent; font-size: 10px; white-space: nowrap; }
  .nav-link.is-active { border-bottom-color: #b24b3d; }
  .nav-mark { width: 6px; height: 6px; }
  .topbar { height: 47px; padding: 0 14px; }
  .breadcrumbs { gap: 6px; font-size: 9px; }
  .user-badge { width: 26px; height: 26px; font-size: 11px; }
  .user-name { display: none; }
  .user-menu form { margin-left: 2px; padding-left: 8px; }
  .page-wrap { padding: 20px 13px 34px; }
  .page-heading { align-items: start; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  h1 { font-size: 25px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-card { min-height: 88px; padding: 12px; }
  .stat-card strong { font-size: 23px; }
  .setup-banner { align-items: start; flex-direction: column; padding: 14px; }
  .setup-columns { grid-template-columns: 1fr; }
  .item-create-form { grid-template-columns: 1fr 1fr; }
  .item-create-form label:first-of-type, .item-create-form label:nth-of-type(2) { grid-column: 1 / -1; }
  .filter-bar { align-items: stretch; }
  .filter-bar .search-field, .filter-bar label { min-width: 100%; }
  .filter-bar .button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .span-all { grid-column: auto; }
  .warehouse-row { grid-template-columns: minmax(95px, 1fr) minmax(45px, .8fr) 55px; gap: 8px; }
  .panel-heading { padding-right: 12px; padding-left: 12px; }
  .panel-body { padding: 11px 12px; }
  .role-callout { align-items: start; flex-direction: column; gap: 6px; }
  .user-actions { justify-content: start; min-width: 170px; }
  .users-table td:last-child { min-width: 195px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 210px; padding: 20px; }
  .auth-brand-panel::before { top: 13%; }
  .auth-brand-panel::after { bottom: 13%; }
  .auth-emblem { width: 74px; height: 74px; box-shadow: inset 0 0 0 4px #211f1c, inset 0 0 0 5px #716858; }
  .emblem-top, .emblem-bottom { font-size: 6px; letter-spacing: 1px; }
  .emblem-mark { font-size: 29px; }
  .auth-brand-title { margin-top: 11px; font-size: 13px; }
  .auth-rule { margin: 9px auto 7px; }
  .auth-brand-panel p { font-size: 8px; }
  .auth-brand-panel p span { margin-top: 2px; font-size: 7px; }
  .auth-panel-foot { bottom: 5%; font-size: 7px; }
  .auth-main { padding: 24px 14px; }
  .auth-card { padding: 26px 21px; }
}