:root {
  color-scheme: light;
  --canvas: #f5f7fa;
  --surface: #fff;
  --ink: #172433;
  --muted: #526275;
  --line: #dce3eb;
  --blue: #204fb8;
  --sidebar: #192738;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
.workspace { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
main { width: min(100%, 1370px); padding: 46px clamp(20px, 4vw, 58px); margin-inline: auto; min-width: 0; }
.guest main { min-height: 100vh; display: grid; place-items: center; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 26px 15px 16px;
  background: var(--sidebar); color: #eef4fc; display: flex; flex-direction: column; min-width: 0;
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 720; line-height: 1.25; color: inherit; }
.sidebar .brand { margin: 0 7px 35px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; color: #c1ccda; margin-top: 5px; font-weight: 450; font-size: 12px; }
.mark { display: grid; place-items: center; width: 35px; height: 35px; flex: none; border-radius: 6px; background: #3260c5; color: white; font-size: 23px; }
nav { display: grid; gap: 4px; }
nav a {
  display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 8px 11px;
  border-radius: 5px; color: #d1dce9; font-size: 14px; font-weight: 550;
}
nav a:hover, nav a[aria-current] { text-decoration: none; background: #2a3d55; color: #fff; }
nav a[aria-current] { box-shadow: inset 3px 0 #83aaff; }
.account { display: flex; gap: 9px; align-items: center; margin-top: auto; border-top: 1px solid #3c4b5e; padding: 15px 5px 0; }
.avatar { display: grid; place-items: center; width: 31px; height: 31px; flex: none; background: #35485f; border-radius: 5px; font-size: 11px; font-weight: 700; }
.username { font-size: 13px; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.icon-button { padding: 6px; min-height: 0; background: transparent; color: inherit; border-color: transparent; }
.icon-button:hover { background: #35485f; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(29px, 3.2vw, 39px); line-height: 1.13; letter-spacing: -.037em; overflow-wrap: anywhere; }
h2 { font-size: 16px; line-height: 1.3; letter-spacing: -.012em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid #4d80ed; outline-offset: 3px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-header p { color: var(--muted); margin-top: 7px; }
.page-header .eyebrow { font-size: 13px; font-weight: 650; color: var(--blue); margin: 0 0 7px; }
.back { display: inline-block; margin-bottom: 15px; font-weight: 600; font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; margin-bottom: 20px; min-width: 0; }
.panel-header { display: flex; gap: 13px; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-header a { font-size: 14px; font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 23px; }
.metric { display: grid; padding: 18px 20px; margin: 0; color: var(--muted); font-weight: 550; gap: 7px; }
.metric:hover { text-decoration: none; border-color: #9ab2dd; }
.metric-icon { display: grid; place-items: center; margin-bottom: 5px; width: 35px; height: 35px; border-radius: 5px; background: #edf2ff; color: var(--blue); }
.metric strong { color: var(--ink); font-size: 30px; font-weight: 730; line-height: 1.1; font-variant-numeric: tabular-nums; }
.table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 20px; vertical-align: middle; }
th { background: #f7f9fc; color: var(--muted); font-size: 12px; font-weight: 670; white-space: nowrap; }
td { font-size: 14px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
tbody tr:hover { background: #fafbfe; }
.row-title { color: var(--ink); font-weight: 650; }
.row-title:hover { color: var(--blue); }
.code { color: #45566b; font-family: ui-monospace, monospace; font-size: 12px; white-space: nowrap; }
.muted, small { color: var(--muted); }
.end { text-align: right; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 4px; background: #edf1f5; color: #394d63; font-size: 12px; font-weight: 650; white-space: nowrap; }
.tag.accent { background: #eaf0ff; color: #234a9d; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 20px; overflow-wrap: anywhere; }
.list-row + .list-row, .upload { border-top: 1px solid var(--line); }
.file-info small { display: block; margin-top: 3px; }
.empty { padding: 23px 20px; color: var(--muted); }
.detail, .form-panel { padding: 21px; }
.detail dl { display: flex; margin: 0; gap: 40px; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 3px 0 0; font-weight: 650; }
.detail .note { margin-top: 14px; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; }
.stack { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 630; min-width: 0; }
input, textarea, select, button { font: inherit; }
input, textarea, select { width: 100%; padding: 8px 10px; border: 1px solid #bdcad8; border-radius: 5px; color: var(--ink); background: white; min-height: 39px; }
textarea { resize: vertical; }
button, .button {
  display: inline-flex; gap: 6px; align-items: center; justify-content: center;
  min-height: 39px; padding: 7px 12px; border: 1px solid #bdcad8; border-radius: 5px;
  background: white; color: var(--ink); font-size: 14px; font-weight: 650; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: #eef2f8; text-decoration: none; }
.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.primary:hover { background: #163f9a; }
.subtle { border-color: transparent; color: #973a3a; background: transparent; }
.actions { display: flex; }
.search { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.search input { width: min(240px, 45vw); }
.search svg { color: var(--muted); }
.alert { color: #842626; background: #fff3f2; padding: 11px; border: 1px solid #f3ceca; border-radius: 4px; margin: 13px 0; }
.login { padding: 28px; width: min(100%, 410px); margin: 0; }
.login h1 { margin: 24px 0 19px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 780px) {
  .workspace { display: block; }
  .sidebar { height: auto; position: relative; padding: 13px 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
  .sidebar .brand { margin: 0; }
  .sidebar nav { grid-row: 2; grid-column: span 2; display: flex; flex-wrap: wrap; }
  .account { margin: 0; border: 0; padding: 0; grid-row: 1; grid-column: 2; }
  main { padding-block: 27px; }
}
@media (max-width: 520px) {
  .page-header { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .metrics { gap: 7px; }
  .metric { padding: 10px; font-size: 12px; }
  .metric strong { font-size: 23px; }
  nav a { gap: 5px; padding-inline: 8px; }
  th, td { padding-inline: 12px; }
  .account .username { max-width: 75px; }
}

.page-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail .stock-summary { margin: 0 0 12px; flex-wrap: wrap; }
.detail dl + .stock-summary { margin-top: 16px; }
.row-meta { display: block; margin-top: 2px; }
.order-product-files { padding: 14px 20px; }
.order-attachments { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; overflow-wrap: anywhere; }
.order-attachments small { display: block; color: var(--muted); }
.order-action { margin-bottom: 12px; display: flex; align-items: center; gap: 10px;}
.shortage { color: #973a3a; }
