@font-face { font-family: AnyaInter; src: url('/assets/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: AnyaInter; src: url('/assets/Inter-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: AnyaInter; src: url('/assets/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: LTRemark; src: url('/assets/LTRemark-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
:root {
  color-scheme: dark;
  font-family: "AnyaInter", Inter, "Segoe UI", system-ui, sans-serif;
  --bg: #191819;
  --nav: #201e20;
  --paper: #252325;
  --raised: #2c292c;
  --line: #3b373a;
  --muted: #ada6aa;
  --soft: #d0c9cc;
  --text: #f7f3f3;
  --accent: #f2c9d5;
  --accent-dark: #352027;
  --green: #9adaac;
  --red: #ffaaaa;
  --yellow: #f2ce8c;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; color: var(--text); background: var(--bg); font-size: 1rem; line-height: 1.48; }
button, input, select { font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, summary, a { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { padding: 0; border: 0; background: transparent; color: inherit; }
button:disabled { cursor: not-allowed; opacity: .48; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { color: var(--accent-dark); background: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.024em; }
h1 { font-family: LTRemark, Georgia, serif; font-size: clamp(2.15rem, 3.4vw, 3.1rem); line-height: 1.08; font-weight: 400; letter-spacing: -.021em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
small, .small { display: block; font-size: .82rem; }
.muted { color: var(--muted); }
.subtle { color: var(--soft); }
.mono, .amount, .elapsed { font-variant-numeric: tabular-nums; }
.code { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: .81rem; }
.spaced { margin-top: 16px; }
.gap-bottom { margin-bottom: 12px; }
.stack { display: grid; gap: 12px; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.align-start { align-items: flex-start; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn, input:not([type="checkbox"]), select { min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--raised); color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: .87rem; font-weight: 550; line-height: 1.25; padding: 8px 13px; text-decoration: none; }
.btn:hover, .btn:focus-visible { border-color: #746669; text-decoration: none; }
.btn.primary { color: var(--accent-dark); background: var(--accent); border-color: transparent; }
.btn.primary:hover { background: #ffe1e9; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--soft); }
.btn.danger { color: var(--red); }
.btn.compact { min-height: 35px; padding: 6px 9px; font-size: .8rem; }
.btn.icon { width: 42px; padding: 0; flex: 0 0 42px; }
input:not([type="checkbox"]), select { width: 100%; padding: 8px 11px; font-size: .91rem; }
input::placeholder { color: var(--muted); }
input[type="checkbox"] { width: 17px; height: 17px; flex-shrink: 0; margin: 0; accent-color: var(--accent); }
select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 54%, var(--muted) 54%), linear-gradient(135deg, var(--muted) 46%, transparent 46%); background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
.check-label { display: flex; align-items: center; gap: 8px; min-height: 34px; color: var(--soft); font-size: .87rem; }
.field { display: grid; gap: 5px; font-size: .82rem; color: var(--muted); min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; width: fit-content; padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--soft); font-size: .77rem; white-space: nowrap; }
.pill.good { color: var(--green); background: #26342b; border-color: #365442; }
.pill.warn { color: var(--yellow); background: #382e22; border-color: #554635; }
.pill.bad { color: var(--red); background: #3b272a; border-color: #62363b; }
.pill.live::before, .connection::before { display: block; width: 6px; height: 6px; content: ""; background: currentColor; border-radius: 50%; }
.skip-link { position: fixed; z-index: 8; top: 12px; left: 12px; padding: 8px; transform: translateY(-200%); background: var(--nav); }
.skip-link:focus { transform: translateY(0); }
.startup { display: grid; place-content: center; justify-items: center; gap: 12px; min-height: 100vh; color: var(--muted); }
.cover { min-height: 100svh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 20%, #33262d, transparent 71%), var(--bg); }
.login-card { width: min(100%, 440px); padding: clamp(24px, 6vw, 38px); background: var(--paper); border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 28px 60px #0005; }
.login-card .brand { margin-bottom: 28px; }
.login-card h1 { margin-bottom: 20px; font-size: 2rem; }
.login-card form { display: grid; gap: 14px; }
.captcha-image { display: block; max-width: 63%; height: auto; border-radius: 7px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 36px; }
.brand-mark { position: relative; display: block; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 9px; background: var(--accent); }
.brand-mark::before { position: absolute; inset: 8px; content: ""; background: var(--accent-dark); clip-path: polygon(0% 0%, 44% 0%, 44% 44%, 100% 44%, 100% 100%, 55% 100%, 55% 56%, 0% 56%); }
.brand-text { line-height: 1.12; }
.wordmark { display: block; width: 124px; max-width: 100%; height: auto; }
.brand-caption { display: block; margin-top: 4px; color: var(--muted); font-size: .73rem; letter-spacing: .035em; }
.shell { display: grid; grid-template-columns: 231px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 26px; height: 100dvh; padding: 28px 17px 19px; background: var(--nav); border-right: 1px solid var(--line); }
.sidebar .brand { margin-left: 10px; }
.nav { display: grid; gap: 16px; }
.nav-group { display: grid; gap: 4px; }
.nav-title { margin: 0 10px 5px; color: var(--muted); font-size: .71rem; letter-spacing: .07em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 8px 10px; border-radius: 8px; text-align: left; font-size: .88rem; color: var(--soft); white-space: nowrap; }
.nav-link:hover { background: var(--raised); }
.nav-link[aria-current="page"] { background: #382a32; color: var(--accent); font-weight: 650; }
.nav-icon { width: 17px; text-align: center; font-size: 1rem; opacity: .87; }
.sidebar-foot { display: grid; gap: 4px; margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line); }
.user-badge { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; background: #463734; color: var(--accent); }
.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 67px; gap: 14px; padding: 0 30px; border-bottom: 1px solid var(--line); }
.breadcrumb { color: var(--soft); font-size: .86rem; }
.connection { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .84rem; }
.connection.is-connected { color: var(--green); }
.main { margin: 0 auto; max-width: 1510px; padding: 30px 31px 50px; }
.page-head { margin-bottom: 24px; }
.page-head p { margin-top: 8px; font-size: .9rem; color: var(--muted); }
.mirror-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 14px; padding: 9px 12px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 9px; color: var(--soft); font-size: .82rem; }
.mirror-note div { display: flex; flex-wrap: wrap; gap: 3px 8px; }
.mirror-note strong { color: var(--text); }
.notice {
  position: fixed;
  z-index: 12;
  inset: auto 18px 18px auto;
  width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  color: #dcf8e4;
  background: #2c3b30;
  border: 1px solid #416147;
  border-radius: 12px;
  box-shadow: 0 9px 25px #0005;
}
.notice.is-error, .problem { color: var(--red); background: #3b272a; border-color: #62363a; }
.login-card { width: min(100%, 440px); }
.login-card .captcha-image { width: 190px; max-width: 100%; }
.login-error { color: var(--red); }
.sidebar { gap: 22px; }
.sidebar-foot .btn { width: 100%; }
.main { max-width: none; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; }
.page-head p { margin-top: 5px; }
.workspace { overflow: clip; }
.read-only { color: var(--accent); }
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 0 0 12px;
}
.search { display: flex; gap: 7px; flex: 1 1 285px; }
.search input { flex: 1; min-width: 0; }
.layout-select { width: auto; }
.toolbar-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.mobile-stages { display: none; }
.board-scroll { overflow-x: auto; padding-bottom: 6px; }
.board {
  display: grid;
  grid-template-columns: repeat(var(--columns, 5), minmax(180px, 1fr));
  align-items: start;
  gap: 10px;
}
.board[data-count="1"] { --columns: 1; }
.board[data-count="4"] { --columns: 4; }
.board[data-count="6"] { --columns: 6; }
.stage {
  display: grid;
  gap: 9px;
  min-height: 288px;
  align-content: start;
  padding: 8px;
  background: var(--nav);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.stage.is-drop { background: #382a32; border-color: #956d80; }
.stage-title { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding: 4px 5px; }
.stage-title h2 { font-size: .93rem; }
.stage-count { min-width: 25px; text-align: center; padding: 2px 4px; color: var(--muted); background: var(--raised); border-radius: 6px; font-size: .82rem; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.card:hover, .card:focus-within { border-color: #746669; }
.card.is-drag { opacity: .55; }
.card-open { display: grid; width: 100%; gap: 7px; padding: 10px; text-align: left; min-width: 0; user-select: none; }
.card-id { color: var(--accent); font-size: .96rem; font-weight: 600; }
.card-customer { overflow-wrap: anywhere; font-weight: 500; color: var(--text); }
.card-detail { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: .82rem; }
.card-delivery { color: var(--soft); }
.card-eta { color: var(--green); }
.card .bad { white-space: normal; }
.empty-stage { padding: 13px 6px; color: var(--muted); font-size: .85rem; }
.page-footer { display: flex; align-items: center; gap: 12px; padding-top: 10px; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--paper); border-radius: 13px; padding: 14px; }
.order-dialog {
  width: min(680px, 100%);
  max-width: calc(100vw - 24px);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  border: 0;
  border-left: 1px solid var(--line);
}
.order-dialog::backdrop { background: #100d11b0; }
.drawer-head { position: sticky; z-index: 2; top: 0; padding: 14px 17px; background: var(--nav); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font: 400 clamp(1.5rem, 4vw, 2.05rem)/1 LTRemark, Georgia, serif; }
.drawer-content { display: grid; gap: 11px; padding: 12px 15px 40px; }
.drawer-content .panel { display: grid; gap: 9px; }
.drawer-content .field { font-size: .87rem; }
.order-status { width: auto; max-width: 100%; }
.action-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.order-main-fields { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.order-info { display: grid; overflow-wrap: anywhere; gap: 2px; }
.order-original { color: var(--muted); font-size: .86rem; }
.product-add { display: flex; flex-wrap: wrap; gap: 7px; }
.product-add input { flex: 1 1 175px; min-width: 0; }
.product-add .btn { flex-shrink: 0; }
.product-help { color: var(--muted); font-size: .86rem; }
.product-result-error { color: var(--red); font-size: .9rem; }
.position-row { display: grid; gap: 8px; padding: 10px 0 8px; }
.position-row + .position-row, .shipment-row + .shipment-row { border-top: 1px solid var(--line); }
.position-main { display: flex; align-items: start; gap: 9px; min-width: 0; }
.position-img { width: 49px; height: 49px; flex: 0 0 49px; background: var(--raised); object-fit: contain; border-radius: 7px; }
.position-label { min-width: 0; overflow-wrap: anywhere; }
.position-label .field { width: 100%; }
.position-code { color: var(--muted); font-size: .82rem; }
.position-details { min-width: 0; display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.position-counts { display: flex; align-items: end; flex-wrap: wrap; gap: 6px 8px; }
.position-counts .field { flex: 0 1 110px; }
.stepper { display: grid; grid-template-columns: 32px minmax(31px, 1fr) 32px; align-items: stretch; gap: 1px; }
.stepper .btn { min-height: 40px; font-size: 1.08rem; padding: 0; }
.stepper input { min-width: 0; min-height: 40px; padding: 6px 1px; text-align: center; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; }
.position-desc { color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: .85rem; }
.problem { padding: 7px 9px; border: 1px solid #62363a; border-radius: 8px; overflow-wrap: anywhere; font-size: .89rem; }
.shipment-row { display: grid; padding: 7px 0; gap: 2px; overflow-wrap: anywhere; }
.order-history, .events { display: grid; gap: 8px; }
.event { display: grid; gap: 3px 12px; grid-template-columns: minmax(130px, 180px) 1fr; border-bottom: 1px solid var(--line); padding: 7px 0 10px; }
.event:last-child { border-bottom: 0; }
.event div { min-width: 0; overflow-wrap: anywhere; }
.user-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 8px; }
.roles { display: grid; gap: 10px; margin-bottom: 13px; }
.events, .roles { list-style: none; margin: 0; padding: 0; }
.locked-message { color: var(--yellow); }
@media (max-width: 790px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { z-index: 3; height: auto; gap: 6px; padding: 10px 12px 5px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin-left: 0; }
  .sidebar .brand-mark { display: none; }
  .sidebar .brand-caption, .nav-title { display: none; }
  .sidebar-foot { position: absolute; top: 7px; right: 12px; display: block; padding: 0; border: 0; }
  .sidebar-foot .signed-user { display: none; }
  .nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
  .nav-group { display: flex; gap: 4px; }
  .nav-link { padding: 5px 8px; min-height: 35px; }
  .topbar { min-height: 36px; padding: 0 12px; }
  .main { padding: 16px 12px 36px; }
  .page-head { margin-bottom: 12px; gap: 8px; }
  .page-head h1 { font-size: 2rem; }
  .page-head p { font-size: .85rem; }
  .layout-select { display: none; }
  .mobile-stages { display: flex; gap: 5px; padding: 2px 0 7px; overflow-x: auto; scrollbar-width: thin; }
  .mobile-stages .btn { flex: 0 0 auto; min-height: 36px; white-space: nowrap; }
  .mobile-stages [aria-pressed="true"] { color: var(--accent-dark); background: var(--accent); }
  .board, .board[data-count] { grid-template-columns: minmax(0, 1fr); }
  .stage:not(.is-mobile-current) { display: none; }
  .stage { min-height: 130px; }
  .stage-title { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .card-open { min-height: 84px; }
  .order-dialog { max-width: 100vw; border-left: 0; }
  .drawer-content { padding: 10px 10px 32px; }
  .event { grid-template-columns: minmax(0, 1fr); }
  .user-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .order-main-fields, .user-form { grid-template-columns: 1fr; }
  .order-main-fields > * { width: 100%; }
}
