:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #171717;
  background: #f5f4f2;
  color-scheme: light;
  --ink: #171717;
  --muted: #5e5954;
  --accent: #ff7900;
  --border: #e1dcd5;
  --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #b94d00;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
svg { width: 21px; height: 21px; flex: none; }
h1, h2, h3, p { margin: 0; }
p { color: var(--muted); line-height: 1.55; }
.loading { padding: 36px; }
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: #111111; color: #fff; display: flex; flex-direction: column; padding: 29px 17px 20px; min-width: 0; }
.brand { display: flex; align-items: center; }
.brand-logo { display: block; width: 116px; height: auto; }
.sidebar .brand { justify-content: center; margin: 0 10px 31px; }
.nav-label { margin: 0 10px 12px; color: #c4bbb1; font-size: 10px; font-weight: 700; letter-spacing: .13em; }
nav { display: grid; gap: 5px; }
nav button { background: transparent; border: 1px solid transparent; color: #e4ded8; padding: 10px 11px; text-align: left; border-radius: 9px; display: flex; gap: 11px; align-items: center; font-weight: 600; }
nav button:hover { background: #24211e; }
nav button[aria-current] { background: #302319; color: #fff7ee; border-color: #66401f; }
nav button[aria-current] svg { color: #ff7900; }
.profile { margin-top: auto; padding: 17px 2px 0; border-top: 1px solid #3b332c; display: grid; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 5px; }
.profile strong, .profile small { display: block; overflow-wrap: anywhere; }
.profile strong { font-size: 13px; }
.profile small { font-size: 11px; color: #c9c0b7; margin-top: 3px; }
.avatar { background: #ff7900; color: #171717; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.profile .icon-button { color: #e4ded8; }
.profile .icon-button:hover { background: #302319; }
.notification-button { position: relative; }
.notification-count { position: absolute; right: -4px; top: -3px; min-width: 17px; padding: 2px 4px; border-radius: 12px; background: var(--accent); color: var(--ink); font-size: 10px; font-weight: 800; }
.notification-list { display: grid; gap: 12px; list-style: none; padding: 0; margin: 0; }
.notification-list li { border-bottom: 1px solid var(--border); padding: 0 0 10px; }
.notification-list small { display: block; color: var(--muted); margin-top: 4px; }
.topline { min-height: 64px; padding: 10px 34px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; background: #fcfbfa; }
.topline strong { color: var(--ink); }
.slash { padding: 0 5px; color: #827a72; }
.top-tag { display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.top-tag i, .badge i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.top-tag i { color: #b94d00; }
.content { max-width: 1480px; margin: 0 auto; padding: 40px 34px 52px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 26px; }
.eyebrow { display: inline-block; font-size: 11px; letter-spacing: .15em; color: #9b4300; font-weight: 800; }
.page-head h1 { font-size: clamp(36px, 5vw, 52px); letter-spacing: -.055em; line-height: 1.1; margin: 6px 0 8px; font-weight: 750; }
.page-head p { font-size: 15px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 41px; padding: 9px 15px; font-size: 14px; font-weight: 700; border: 1px solid transparent; border-radius: 8px; white-space: nowrap; }
.button svg { width: 18px; height: 18px; }
.primary { background: var(--accent); color: #171717; }
.primary:hover:not(:disabled) { background: #ff951f; }
.secondary { background: var(--white); color: var(--ink); border-color: var(--border); }
.secondary:hover:not(:disabled) { background: #fff3e6; }
.destructive { background: #a02731; color: white; }
.destructive:hover { background: #821e27; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 15px; display: flex; align-items: center; gap: 11px; min-height: 80px; }
.metric-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 9px; color: #964100; background: #ffead5; }
.metric-icon.pending, .badge.pending { color: #78510c; background: #f9f0d7; }
.metric-icon.partial, .badge.partial { color: #8a3900; background: #ffe2c9; }
.metric-icon.prepared, .badge.prepared { color: #2b5970; background: #e7f1f7; }
.metric-icon.delivered, .badge.delivered { color: #285b40; background: #e7f2e8; }
.metric { text-align: left; color: var(--ink); }
.metric:hover, .metric[aria-pressed="true"] { border-color: var(--accent); }
.metric-label > span { color: var(--muted); display: block; font-size: 12px; font-weight: 600; }
.metric strong { display: block; font-size: 24px; line-height: 1.12; margin-top: 3px; letter-spacing: -.045em; }
.records { background: white; border-radius: 13px; border: 1px solid var(--border); overflow: hidden; }
.record-head { display: flex; justify-content: space-between; align-items: center; gap: 13px; padding: 19px 20px; }
.record-head h2 { font-size: 18px; letter-spacing: -.025em; }
.record-head p { font-size: 13px; margin-top: 4px; }
.tools { display: flex; align-items: center; gap: 9px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.report-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; padding: 20px; border-bottom: 1px solid var(--border); }
.report-filters label { display: grid; gap: 6px; min-width: 0; font-size: 13px; font-weight: 650; }
.report-filters input, .report-filters select { min-width: 0; }
.report-detail { margin-top: 20px; }
.record-link { background: transparent; padding: 0; border: 0; font-weight: 750; color: #964100; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.record-link:hover { color: var(--ink); }
input, select, textarea { width: 100%; min-height: 40px; background: #fff; border: 1px solid #d7cfc6; color: var(--ink); border-radius: 8px; padding: 8px 10px; }
textarea { resize: vertical; }
.tools select { width: auto; font-size: 13px; }
.search { display: flex; align-items: center; padding-left: 9px; border: 1px solid #d7cfc6; border-radius: 8px; color: var(--muted); }
.search svg { width: 17px; height: 17px; }
.search input { border: 0; min-height: 38px; width: min(17vw, 175px); font-size: 13px; background: transparent; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
thead { color: #615952; background: #f7f4f0; font-size: 12px; }
th, td { padding: 12px 15px; border-top: 1px solid #ece6df; }
th:first-child, td:first-child { padding-left: 20px; }
tbody tr:hover { background: #fffaf5; }
.actions { text-align: right; white-space: nowrap; padding-right: 18px; }
.icon-button { display: inline-grid; place-items: center; background: transparent; color: #6d4b2e; border: 0; border-radius: 7px; width: 32px; height: 32px; vertical-align: middle; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover { background: #fff0df; }
.icon-button.danger:hover { background: #faecec; color: #9c2730; }
.badge { display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.empty { text-align: center; min-height: 245px; display: grid; align-content: center; justify-items: center; gap: 7px; padding: 24px; border-top: 1px solid #ece6df; }
.empty span { background: #ffead5; color: #964100; border-radius: 12px; display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: 4px; }
.empty h3 { font-size: 16px; }
.empty p { font-size: 14px; }
dialog { width: min(550px, calc(100% - 26px)); max-height: calc(100dvh - 30px); padding: 0; border: 1px solid var(--border); border-radius: 15px; color: var(--ink); box-shadow: 0 18px 60px #00000036; }
dialog::backdrop { background: #000000a6; }
.wide-dialog { width: min(940px, calc(100% - 26px)); }
.dialog-form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.dialog-form header, .dialog-form footer { padding: 15px 20px; display: flex; align-items: center; gap: 9px; }
.dialog-form header { justify-content: space-between; border-bottom: 1px solid var(--border); }
.dialog-form header h2 { font-size: 21px; }
.dialog-form footer { justify-content: flex-end; border-top: 1px solid var(--border); }
.dialog-body { overflow: auto; padding: 19px 20px; }
.dialog-body, .form-stack { display: grid; gap: 14px; }
.dialog-body label, .form-stack label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
.password-field { display: grid; gap: 6px; }
.password-field small { color: var(--muted); }
.password-control { display: flex; gap: 8px; align-items: center; }
.password-control input { min-width: 0; }
label small { color: var(--muted); font-weight: 400; }
fieldset { min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
legend { padding: 0 4px; font-weight: 650; font-size: 14px; }
.dialog-body .checkbox { display: flex; align-items: center; gap: 7px; margin: 4px 0; }
.checkbox input { width: 16px; min-height: 16px; accent-color: var(--green); }
.order-lines { display: grid; gap: 8px; margin-bottom: 10px; }
.order-destinations { display: grid; gap: 12px; }
.order-destination > label { margin-bottom: 10px; }
.order-detail-center h3 { font-size: 15px; margin-bottom: 8px; }
.order-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.fulfillment-line { display: grid; gap: 9px; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); }
.fulfillment-line input:disabled { background: #f5f4f2; }
.fulfillment-selection { grid-column: 1 / -1; }
.fulfillment-batch { display: grid; gap: 9px; background: #f8f6f3; }
.fulfillment-batch button { justify-self: start; }
.batch-message { font-size: 13px; }
.batch-message:empty { display: none; }
.order-line { display: grid; grid-template-columns: minmax(0, 1fr) 74px 32px; gap: 7px; align-items: center; }
.form-error { font-size: 13px; color: #8c2631; background: #fff0f1; padding: 8px 10px; border-radius: 7px; }
#notice:not(:empty) { position: fixed; z-index: 2; bottom: 16px; right: 16px; max-width: calc(100% - 32px); padding: 12px 16px; background: #111111; color: white; border-radius: 9px; box-shadow: 0 8px 25px #00000035; font-size: 14px; }
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { background: #111111; color: white; display: grid; align-content: space-between; gap: 30px; padding: clamp(27px, 6vw, 85px); border-bottom: 5px solid var(--accent); }
.auth-art .brand-logo { width: clamp(125px, 13vw, 185px); }
.art-message { padding: 45px 0; }
.auth-art .eyebrow { color: #ff7900; }
.auth-art h1 { font-size: clamp(42px, 6vw, 90px); line-height: 1; letter-spacing: -.075em; margin: 15px 0; }
.auth-art p { color: #ddd4ca; max-width: 350px; }
.auth-panel { display: grid; place-items: center; padding: 30px; }
.auth-card { width: min(100%, 395px); }
.auth-card h2 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.055em; margin: 6px 0; }
.auth-card > p { margin-bottom: 20px; }
@media (max-width: 970px) {
  .shell { grid-template-columns: 180px minmax(0, 1fr); }
  .content, .topline { padding-inline: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .shell { display: block; }
  .sidebar { padding: 12px; display: grid; grid-template-columns: 1fr auto; gap: 13px; }
  .sidebar .brand { justify-content: flex-start; margin: 0; }
  .sidebar .brand-logo { width: 57px; }
  .nav-label, .topline { display: none; }
  nav { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; }
  nav button { flex: 1 0 78px; }
  nav button { justify-content: center; padding: 7px 3px; gap: 4px; font-size: 12px; }
  nav button svg { width: 16px; height: 16px; }
  .profile { border: 0; padding: 0; margin: 0; grid-template-columns: repeat(3, auto); }
  .profile > div { display: none; }
  .content { padding: 21px 12px 32px; }
  .page-head { flex-wrap: wrap; margin-bottom: 17px; }
  .record-head { flex-wrap: wrap; padding: 13px; }
  .tools { width: 100%; }
  .search { flex: 1; min-width: 90px; }
  .search input { width: 100%; }
  .metrics { gap: 7px; }
  .metric { min-height: 61px; padding: 8px; gap: 7px; }
  .metric-icon { width: 32px; height: 32px; }
  .auth { grid-template-columns: 1fr; align-content: start; }
  .auth-art { gap: 15px; }
  .auth-art .brand-logo { width: 72px; }
  .art-message { padding: 0; }
}
