/* Shared ERP chrome. Loaded after the legacy page styles; label artwork is untouched. */
:root {
  --ink: #19332f;
  --muted: #61756e;
  --bg: #f3f6f4;
  --paper: #fff;
  --line: #dfe7e3;
  --nav: #183b35;
  --nav-soft: #254d44;
  --teal: #0c796c;
  --teal-soft: #e8f4ef;
  --orange: #b85d28;
  --red: #b8463a;
  --shadow: 0 3px 14px rgba(25, 51, 47, .045);
  --admin-card-radius: 14px;
  --admin-control-radius: 10px;
}
body { font-size: 15px; line-height: 1.55; }
.shell { grid-template-columns: 248px minmax(0, 1fr); }
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 28px 16px 22px;
  gap: 26px;
  border-right: 1px solid rgba(255, 255, 255, .04);
  scrollbar-width: thin;
  scrollbar-color: #52776b transparent;
}
.side .brand { padding: 0 10px 22px; border-bottom: 1px solid #35574d; gap: 14px; }
.side .brand strong { font-size: 19px; font-weight: 760; letter-spacing: .04em; }
.side .brand small { font-size: 12px; margin-top: 5px; color: #b6cdc3; letter-spacing: .08em; }
.side .brand-mark { width: 28px; height: 36px; border-color: #d3b77e; border-radius: 5px; }
.side .brand-mark::before { left: 8px; border-color: #d3b77e; }
.side .nav { gap: 8px; min-width: 0; }
.side .nav details.nav-group { border-radius: 11px; overflow: hidden; }
.side .nav-group[open] { background: #20483e; padding-bottom: 6px; }
.side .nav .nav-group-title {
  min-height: 47px;
  padding: 13px 14px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 650;
  color: #d4e5dc;
  letter-spacing: 0;
}
.side .nav summary.nav-group-title { display: flex; align-items: center; gap: 10px; list-style: none; }
.side .nav summary.nav-group-title::-webkit-details-marker { display: none; }
.side .nav summary.nav-group-title::after {
  content: '';
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 1.5px solid #9cbbb0;
  border-bottom: 1.5px solid #9cbbb0;
  transform: rotate(-45deg);
}
.side .nav .nav-group[open] > summary::after { transform: rotate(45deg); }
.side .nav button {
  width: calc(100% - 12px);
  min-height: 44px;
  margin: 2px 6px;
  padding: 10px 14px 10px 26px;
  border-radius: 8px;
  color: #c4dbd0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 550;
  transition: background-color .15s ease, color .15s ease;
}
.side .nav button:hover { color: #fff; background: #31594d; }
.side .nav button.active {
  color: #164b3f;
  background: #e8f4ed;
  box-shadow: inset 3px 0 #92bca5;
  font-weight: 750;
}
.side .nav button:focus-visible,
.side .nav summary:focus-visible { outline: 2px solid #e4c991; outline-offset: -3px; }
.side .nav-foot { padding: 20px 10px 0; border-color: #35574d; font-size: 12px; line-height: 1.65; color: #adc7ba; }
.side .nav-foot b { font-size: 13px; font-weight: 600; color: #e6f1eb; margin-bottom: 5px; }
.main { min-width: 0; padding: 24px 30px 42px; }
.topbar {
  min-height: 58px;
  padding: 0 0 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  gap: 18px;
}
.crumb { font-size: 12px; color: #6d8279; margin-bottom: 6px; letter-spacing: .025em; }
.topbar .crumb { display: none; }
.topbar h1 { color: var(--muted); font-size: 16px; line-height: 1.35; font-weight: 600; letter-spacing: 0; }
.top-actions { min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.topbar .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.35;
}
.topbar .btn.outline { border-color: #d9e4dd; background: #fff; color: #3f5f52; }
.topbar .btn.outline:hover { background: #edf5ef; border-color: #b7cfc0; }
.topbar .btn.quiet { color: #536f62; }
.topbar .btn:focus-visible { outline: 3px solid #afd7c9; outline-offset: 2px; }
.topbar .account { min-width: 0; gap: 12px; padding-left: 14px; margin-left: 3px; border-left: 1px solid #d5e2d9; }
.account-copy { min-width: 0; line-height: 1.35; }
.account-name { font-size: 14px; color: #234b3f; font-weight: 700; overflow-wrap: anywhere; }
.role-chip { margin-top: 4px; font-size: 12px; font-weight: 600; }
.connection { font-size: 12px; color: #678175; gap: 7px; padding: 6px 8px; }
.status-dot { box-shadow: 0 0 0 3px rgba(96, 134, 113, .09); }
.auth-screen { background: #173c33; padding: 24px; }
.auth-card { width: min(440px, 100%); padding: 36px; border-radius: 20px; border: 1px solid #d7e3da; box-shadow: 0 22px 65px #0d251f40; }
.auth-brand { gap: 14px; margin-bottom: 32px; }
.auth-brand strong { color: #1c4b3b; font-size: 21px; }
.auth-brand small { color: var(--muted); font-size: 13px; margin-top: 5px; }
.auth-card h1 { font-size: 26px; font-weight: 750; margin-bottom: 8px; }
.auth-card p { font-size: 15px; }
.auth-card .field { margin-top: 18px; }
.auth-card .field label { font-size: 15px; margin-bottom: 8px; }
.auth-card .field input { height: 50px; border-radius: 10px; font-size: 17px; }
.auth-card .btn { min-height: 50px; border-radius: 10px; font-size: 17px; margin-top: 24px; }
.auth-error { font-size: 14px; }
.erp-chat { border-radius: 16px; border-color: #d8e4dd; box-shadow: 0 14px 45px #173d3029; }
.erp-chat header { background: var(--nav); padding: 16px 18px; }
.erp-chat header strong { font-size: 18px; }
.erp-chat-log { background: #f4f7f4; }
.erp-chat-message { border-radius: 12px; background: #fff; color: #254a3b; box-shadow: 0 1px 3px #173d3008; line-height: 1.65; }
.erp-chat-message.user { background: #dfeee2; color: #1f4a37; }
.erp-chat-footer { border-color: #e2eae3; background: #fff; }
.erp-chat-footer textarea { border-radius: 10px; border-color: #ccddd0; }
.erp-chat-dock { border-color: #d3e2d6; background: #fff; box-shadow: 0 2px 20px #173d3014; }
.erp-chat-dock input { border-radius: 10px; background: #f6f8f5; }
.erp-ai-rail .erp-chat { border-radius: 0; border-left: 1px solid #dce7df; box-shadow: -4px 0 20px #1e463609; }
.erp-ai-rail .erp-chat header { color: #264f3d; border-color: #dfe8e1; }
.erp-ai-rail .erp-chat-log { background: #f5f8f4; }
.erp-chat-photo-menu { border-radius: 14px; border-color: #d9e6dc; box-shadow: 0 10px 34px #173d3024; }
.toast { border-radius: 10px; padding: 13px 18px; font-size: 15px; background: #234d3d; box-shadow: 0 7px 22px #183d3326; }
.toast.bad { background: #a84237; }
@media (min-width: 921px) {
  body:not(.erp-ai-rail):not(.packing-mode) .main { padding-right: 76px; }
  .erp-ai-rail .main { margin-right: 340px; }
  .erp-ai-rail .erp-chat { width: 320px; }
  .erp-ai-rail .erp-chat-photo-menu { right: 338px; }
  .erp-ai-rail .erp-chat header { gap: 12px; }
  .erp-ai-rail #erpChatClose {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #cbded1;
    border-radius: 9px;
    background: #f0f6f1;
    color: #315a45;
    font-size: 15px;
    font-weight: 650;
    flex-shrink: 0;
  }
  .erp-ai-rail #erpChatClose:hover { background: #e2eee5; }
  .erp-ai-rail #erpChatClose:focus-visible { outline: 3px solid #afd7c9; outline-offset: 2px; }
  .erp-chat-dock { border-radius: 12px 0 0 12px; }
  .erp-chat-dock #erpDockHistory { color: #32634e; font-size: 15px; }
  body.erp-has-chat-dock .main { padding-right: 68px; }
  body.erp-ai-rail .main { padding-right: 30px; }
}
@media (max-width: 1180px) and (min-width: 921px) {
  .shell { grid-template-columns: 222px minmax(0, 1fr); }
  .side { padding-left: 12px; padding-right: 12px; }
  .main { padding-left: 22px; padding-right: 22px; }
  .topbar { flex-wrap: wrap; gap: 14px; }
  .top-actions { margin-left: auto; }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: relative; display: block; width: 100%; height: auto; max-height: none; padding: 18px 16px 12px; overflow: hidden; border-right: 0; }
  .side .brand { padding: 0 4px 14px; margin-bottom: 10px; border-color: #35574d; }
  .side .brand strong { font-size: 18px; }
  .side .brand-mark { width: 23px; height: 29px; }
  .side .brand-mark::before { left: 6px; }
  .side .nav { display: flex; align-items: flex-start; overflow-x: auto; gap: 8px; padding: 0 0 6px; max-width: 100%; scrollbar-width: thin; scrollbar-color: #648575 transparent; }
  .side .nav details.nav-group { flex: 0 0 auto; min-width: 172px; max-width: min(260px, 90vw); }
  .side .nav .nav-group-title { min-height: 44px; padding: 12px; font-size: 15px; }
  .side .nav button { min-height: 44px; padding: 10px 14px; font-size: 15px; white-space: normal; }
  .side .nav-foot { display: none; }
  .main { padding: 22px 20px 36px; }
  .topbar { flex-wrap: wrap; min-height: 0; margin-bottom: 22px; padding-bottom: 18px; gap: 16px; }
  .topbar h1 { font-size: 18px; }
  .top-actions { flex: 1 1 auto; margin-left: auto; }
  .topbar .account { padding-left: 12px; }
  .erp-ai-rail .erp-chat { border-radius: 16px; }
  .erp-chat-dock { border-radius: 14px 14px 0 0; }
}
@media (max-width: 540px) {
  .side { padding: 14px 12px 9px; }
  .side .brand { padding-bottom: 12px; }
  .side .nav details.nav-group { min-width: 158px; }
  .side .nav .nav-group-title { font-size: 14px; }
  .main { padding: 18px 14px 32px; }
  .topbar h1 { font-size: 18px; }
  .crumb { font-size: 11px; margin-bottom: 5px; }
  .top-actions { width: 100%; justify-content: flex-start; gap: 8px; }
  .topbar .btn { min-height: 42px; padding: 9px 11px; font-size: 14px; }
  .topbar .account { flex: 1; justify-content: flex-end; margin-left: 0; padding-left: 0; border: 0; gap: 9px; }
  .account-copy { max-width: 130px; }
  .account-name { font-size: 13px; }
  .auth-screen { padding: 18px; }
  .auth-card { padding: 28px 24px; border-radius: 16px; }
  .erp-chat-dock { border-radius: 0; }
}
.packing-mode .shell { grid-template-columns: minmax(0, 1fr); }
.packing-mode .side { display: none; }
.packing-mode .topbar { min-height: 58px; padding-bottom: 16px; }
.packing-mode .topbar h1 { font-size: 18px; }
@media (prefers-reduced-motion: reduce) {
  .side .nav button { transition: none; }
}
