:root {
  color-scheme: light;
  --ink: #232725;
  --muted: #69706b;
  --line: #d9ded8;
  --paper: #f2f3ef;
  --white: #ffffff;
  --graphite: #202421;
  --amber: #d59b32;
  --green: #2f6b4f;
  --red: #a74337;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 64px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--graphite); color: white; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: .1em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; color: var(--graphite); background: var(--amber); border-radius: 8px 8px 8px 2px; font-size: 17px; letter-spacing: 0; }
.brand-tag { padding: 4px 7px; border: 1px solid #65706a; border-radius: 5px; color: #d6ddd8; font-size: 10px; letter-spacing: .14em; }
.connection { display: flex; align-items: center; gap: 7px; color: #d6ddd8; font-size: 12px; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.connection.online .connection-dot { background: #72c394; }
.connection.offline .connection-dot { background: #ed806e; }
.main-content { width: min(100%, 980px); margin: 0 auto; padding: 26px 18px 38px; flex: 1; }
.footer { padding: 14px 18px 20px; text-align: center; color: #89918b; font-size: 11px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 7px 24px #1820190b; padding: 24px; }
.auth-panel { max-width: 460px; margin: min(9vh, 84px) auto 0; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(24px, 6vw, 32px); line-height: 1.16; }
h2 { margin-bottom: 14px; font-size: 20px; }
h3 { margin-bottom: 6px; font-size: 16px; }
.subhead { margin-bottom: 22px; color: var(--muted); line-height: 1.5; }
.form-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label, .field-label { color: #4e5751; font-size: 12px; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd2cb; border-radius: 8px; background: white; color: var(--ink); font-size: 16px; }
.field input:focus, .field select:focus { outline: 3px solid #d59b3233; border-color: var(--amber); }
.help { margin: -2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.button { min-height: 46px; padding: 10px 16px; border: 0; border-radius: 8px; color: white; background: var(--green); font-weight: 750; }
.button:hover { filter: brightness(1.06); }
.button:disabled { cursor: wait; opacity: .6; }
.button.secondary { color: var(--ink); background: #e8ece7; }
.button.ghost { min-height: 38px; padding: 7px 11px; color: white; background: transparent; border: 1px solid #647068; }
.button.danger { background: #a74337; }
.notice { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: #fff0e7; color: #803a2b; font-size: 13px; line-height: 1.4; }
.notice:empty { display: none; }
.top-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.top-heading h1 { margin-bottom: 5px; }
.user-line { color: var(--muted); font-size: 13px; }
.workspace { display: grid; gap: 18px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; }
.stat strong { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 11px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title h2 { margin: 0; }
.section-title small { color: var(--muted); }
.items-editor { display: grid; gap: 10px; }
.item-row { display: grid; grid-template-columns: .85fr repeat(4, 1fr); gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf9; }
.item-row .field input { min-height: 42px; padding: 8px; }
.item-row .field label { font-size: 10px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.stock-list { display: grid; gap: 10px; }
.package-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.package-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.package-number { font-weight: 850; letter-spacing: .02em; }
.package-meta { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.package-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.package-check { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green); }
.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.available { color: #285e42; background: #e2f1e7; }
.badge.shipped { color: #626962; background: #e9ece8; }
.users-list, .shipment-list { display: grid; gap: 8px; }
.user-card, .shipment-card { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.user-card strong, .shipment-card strong { display: block; font-size: 13px; }
.user-card small, .shipment-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.empty { padding: 20px 12px; border: 1px dashed #cbd2cb; border-radius: 10px; color: var(--muted); text-align: center; font-size: 13px; }
.poll-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10vh; color: var(--muted); }
.spinner { width: 19px; height: 19px; border: 2px solid #cad1cb; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); width: max-content; max-width: min(90vw, 480px); padding: 11px 15px; border-radius: 10px; color: white; background: var(--graphite); box-shadow: 0 8px 24px #0003; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 13px; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 620px) {
  .topbar { min-height: 58px; padding: 0 14px; }
  .brand { gap: 8px; font-size: 16px; }
  .main-content { padding: 18px 12px 30px; }
  .panel { padding: 18px 15px; border-radius: 12px; }
  .top-heading { align-items: center; }
  .top-heading h1 { font-size: 24px; }
  .user-line { font-size: 11px; }
  .stat { padding: 11px; }
  .stat strong { font-size: 19px; }
  .stat span { font-size: 10px; }
  .item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-row .field:first-child { grid-column: 1 / -1; }
}

.tabs{display:flex;gap:8px;overflow:auto;margin:0 0 20px;padding-bottom:4px}.tab{border:1px solid var(--line);border-radius:8px;background:white;padding:11px 16px;white-space:nowrap}.tab.active{background:var(--green);color:white;border-color:var(--green)}.spaced{margin-top:18px}summary{cursor:pointer;padding:12px 0;color:var(--green);font-weight:650}.actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.actions select{padding:10px;border:1px solid var(--line);border-radius:8px}.employee{border:1px solid var(--line);border-radius:10px;padding:10px 12px}.employee .user-card{border:0;padding:0}.auth-panel{max-width:500px;margin:6vh auto}a{color:var(--green)}button:focus-visible,summary:focus-visible{outline:3px solid var(--amber);outline-offset:3px}@media(max-width:620px){.user-card{align-items:flex-start;flex-wrap:wrap}.brand-tag{display:none}.tabs{margin-left:-2px;margin-right:-2px}.tab{padding:10px 13px}}
