:root {
  color-scheme: light;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: #172a3f;
  background: #f2f6fb;
  --navy: #102b49;
  --blue: #0054e9;
  --app-header-blue: #0054e9;
  --line: #cdd9e5;
  --muted: #526a81;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.frame { width: min(100% - 32px, 780px); margin-inline: auto; }
.top { background: var(--app-header-blue); color: #fff; }
.heading { display: flex; align-items: center; gap: 14px; padding-block: 18px; }
.wordmark {
  display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px;
  border-radius: 9px; background: #0b69c1; object-fit: cover;
}
.title { min-width: max-content; flex: 1; }
.title span { display: block; color: #e4efff; font-size: .825rem; font-weight: 650; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.25rem, 3.8vw, 1.8rem); line-height: 1.2; }
h2 { font-size: 1.24rem; line-height: 1.3; }
h3 { font-size: 1rem; }
.workspace { padding-block: 22px 38px; }
.panel { background: #fff; border: 1px solid #dae3ee; border-radius: 13px; padding: 18px; box-shadow: 0 3px 14px #102b490a; }
label { display: block; font-size: .92rem; font-weight: 700; margin-bottom: 5px; }
input, select, textarea, button { border-radius: 7px; font: inherit; }
input, select, textarea { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #9fb3c7; color: inherit; background: #fff; }
select {
  appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, #426381 50%), linear-gradient(135deg, #426381 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
button { cursor: pointer; border: 1px solid transparent; font-weight: 700; padding: 8px 13px; white-space: nowrap; }
.primary { background: var(--blue); color: #fff; }
.outline { border-color: #9fb9d3; background: #fff; color: #004e9c; }
.light { background: transparent; color: #fff; }
button:disabled, input:disabled, select:disabled { opacity: .65; cursor: default; }
:is(button, input, select):focus-visible { outline: 3px solid #1685ee; outline-offset: 2px; }

#administrationsForm label, #employeeAccessForm label, #userForm label { margin-top: 10px; }
#administrationsList, #employeeAccessList, #usersList { max-height: 25vh; overflow-y: auto; margin-block: 12px; }
#administrationsList button, #employeeAccessList button, #usersList button { width: 100%; text-align: left; white-space: normal; }
#administrationsList small, #employeeAccessList small, #usersList small { display: block; font-weight: normal; }
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  min-height: 100vh;
  color: #17324a;
}
.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 38px;
  overflow: hidden;
  padding: clamp(32px, 4vw, 58px);
  color: white;
  background:
    radial-gradient(circle at 85% 22%, #379dcf66, transparent 28%),
    linear-gradient(145deg, #063b60 0%, #075d8d 58%, #0879ab 100%);
}
.login-brand-panel::before,
.login-brand-panel::after {
  position: absolute;
  border: 1px solid #ffffff20;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.login-brand-panel::before { width: 580px; height: 580px; left: -330px; bottom: -340px; }
.login-brand-panel::after { width: 460px; height: 460px; right: -270px; top: -180px; }
.brand-lockup {
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 15px;
  font-weight: 760;
}
.brand-lockup img { width: min(220px, 55%); height: auto; }
.brand-lockup span { border-left: 1px solid #ffffff66; padding-left: 15px; }
.login-brand-copy { position: relative; z-index: 1; padding-block: 28px 44px; }
.login-brand-copy h1 { max-width: 510px; font-size: clamp(2.35rem, 4.4vw, 3.75rem); line-height: 1.04; letter-spacing: -.042em; }
.login-brand-copy > p { margin-top: 16px; }
.demo-entry { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.demo-entry canvas { display: block; width: 120px; height: 120px; padding: 5px; background: white; border-radius: 9px; image-rendering: pixelated; }
.demo-entry small { display: block; max-width: 195px; margin-top: 8px; color: white; }
.demo-button { min-height: 44px; background: #ffca4f; color: #093d62; }
.demo-badge { padding: 5px 9px; border: 1px solid #bdd5ec; border-radius: 20px; color: #fff; font-size: .78rem; white-space: normal; }
.demo-suggestions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; color: var(--muted); font-size: .85rem; }
.demo-suggestions button { min-height: 36px; font-size: .85rem; }
.login-version { color: #e0eff8; font-size: .81rem; }
.login-form-panel { display: grid; place-items: center; padding: clamp(22px, 4vw, 54px); background: #f8fafb; }
.login-card {
  width: min(100%, 470px);
  border: 1px solid #dce6ed;
  border-radius: 26px;
  padding: clamp(22px, 3.2vw, 42px);
  background: white;
  box-shadow: 0 16px 46px #18426017;
}
.login-card h2 { font-size: 1.925rem; letter-spacing: -.035em; }
.login-card h2 + p { color: var(--muted); margin-block: 6px 16px; }
.login-card form { display: grid; gap: 14px; }
.login-card label { color: #2c485e; font-weight: 680; }
.login-card input:not([type="checkbox"]) {
  min-height: 46px;
  background: #fbfcfd;
  border-color: #afc0ce;
  border-radius: 11px;
}
.connection-settings { min-width: 0; margin: 0; padding: 11px 12px; border: 1px solid #dce6ed; border-radius: 12px; }
.login-credentials { display: grid; min-width: 0; margin: 0; padding: 0; border: 0; gap: 14px; }
.connection-settings legend { color: #2c485e; font-size: .91rem; font-weight: 730; padding-inline: 5px; }
.connection-grid { display: grid; grid-template-columns: minmax(0, 1fr) 77px; gap: 10px; align-items: end; }
.secure-connection { margin-top: 9px; color: var(--muted); font-size: .86rem; }
.password-field { position: relative; }
.password-field input { padding-right: 95px; }
.password-toggle { position: absolute; top: 0; right: 0; height: 100%; background: transparent; color: #086ca5; font-size: .87rem; }
.remember { display: flex; align-items: center; gap: 8px; margin: 1px 0; }
.remember input { width: 18px; height: 18px; margin: 0; flex: 0 0 18px; accent-color: #086ca5; }
.login-card .primary { min-height: 46px; background: #086ca5; border-radius: 11px; }
.login-card .primary:hover:not(:disabled) { background: #075885; }
.login-card-version { display: none; margin-top: 10px; text-align: right; color: var(--muted); font-size: .81rem; }
.scope { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; margin-bottom: 16px; }
.scope-info { display: grid; overflow-wrap: anywhere; }
#liveTenantGroup strong { display: block; }
.overline { color: #004e9c; font-weight: 740; font-size: .86rem; }
.secondary { color: var(--muted); font-size: .87rem; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; }
.quantity-control { display: flex; flex: 1; min-width: 0; gap: 6px; align-items: stretch; }
.quantity-control input { flex: 1; min-width: 0; appearance: textfield; -moz-appearance: textfield; }
.quantity-control input::-webkit-inner-spin-button, .quantity-control input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.quantity-control .quantity-adjust { flex: 0 0 44px; min-width: 44px; min-height: 44px; padding: 0; font-size: 1.2rem; }
.scan-icon { display: none; }
.result-list { margin-top: 10px; border-top: 1px solid var(--line); }
.result-list button { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; text-align: left; background: #fff; padding: 9px 4px; white-space: normal; color: var(--navy); border-bottom: 1px solid var(--line); border-radius: 0; }
.result-list button > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.result-stock { flex-shrink: 0; color: var(--muted); font-size: .86rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.result-stock strong { color: var(--navy); font-size: .95rem; }
.result-list button:hover { background: #edf5fd; }
.notice { margin: 10px 0; font-size: .93rem; color: var(--muted); min-height: 0; }
.notice:empty { display: none; }
.scanner-dialog .notice.error { padding: 14px; border: 2px solid #bd302b; border-radius: 8px; background: #fff0ef; color: #861b17; font-size: 1rem; font-weight: 750; }
.notice.success { color: #00684f; font-weight: 700; }
.error, .notice.error { color: #96231f; }
.error:empty { display: none; }
.article { margin-top: 12px; }
.article-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.article-identity { display: flex; align-items: center; gap: 12px; min-width: 0; overflow-wrap: anywhere; }
.article-photo {
  width: clamp(62px, 13vw, 106px); aspect-ratio: 1; flex-shrink: 0;
  border: 1px solid #dae3ee; border-radius: 8px;
}
.live-article-photo {
  display: grid; place-items: center; overflow: hidden;
  background: #f7f8fa; color: var(--muted); text-align: center;
}
.live-article-photo img { width: 100%; height: 100%; object-fit: contain; }
.live-article-photo span { padding: .25rem; font-size: .75rem; line-height: 1.15; }
.article-code { color: var(--blue); letter-spacing: .04em; font-weight: 750; margin-bottom: 2px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-block: 12px; }
.facts div { background: #eff5fb; border-radius: 7px; padding: 8px 11px; }
dt { color: var(--muted); font-size: .86rem; }
dd { margin: 0; font-size: 1.15rem; font-weight: 780; }
.locations { list-style: none; margin: 4px 0 12px; padding: 0; color: var(--muted); }
.locations li { padding: 3px 0; }
.locations-toggle { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 0; color: inherit; background: transparent; text-align: left; white-space: normal; }
.locations-chevron { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: 0 4px 4px 0; }
.locations-toggle[aria-expanded="false"] .locations-chevron { transform: rotate(-45deg); margin: 0 4px 0 0; }
.location-search-wrap { flex: 1; min-width: 0; position: relative; }
.location-results { position: absolute; z-index: 15; inset: calc(100% + 4px) 0 auto; max-height: 220px; overflow-y: auto; border: 1px solid #aac1d9; border-radius: 7px; background: #fff; box-shadow: 0 8px 20px #102b4929; }
.location-results button { display: block; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 0; background: white; color: #172a3f; text-align: left; white-space: normal; }
.location-results button:hover, .location-results button[aria-selected="true"] { background: #e6efff; color: #0047be; }
.location-results small { display: block; color: #526a81; font-weight: 400; }
.location-results p { padding: 10px; color: #526a81; font-size: .9rem; }
.location-help { display: block; margin: 5px 0 12px; }
.location-scan-error { margin: 12px 0 0; padding: 12px; border: 2px solid #bd302b; border-radius: 8px; background: #fff0ef; color: #861b17; font-weight: 750; }
#locationScanForm { margin-top: 12px; }
.history { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.history-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 8px; margin-bottom: 4px; }
.history-entry { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.history-entry small { display: block; font-size: .86rem; }
.history-entry button { font-size: .88rem; padding: 5px 9px; }
.danger { color: #9a211d; }
.primary.danger { background: #9a211d; color: #fff; }
dialog { color: inherit; width: min(calc(100% - 32px), 435px); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
dialog::backdrop { background: #102b4977; }
dialog p { margin-block: 7px 12px; }
.actions { margin-top: 14px; justify-content: flex-end; flex-wrap: wrap; }
.share-dialog {
  position: fixed; inset: 78px max(16px, calc((100vw - 780px) / 2)) auto auto; z-index: 20; margin: 0; width: min(calc(100vw - 32px), 332px); max-height: calc(100dvh - 94px); overflow-y: auto;
  text-align: center; background: #fff; box-shadow: 0 12px 32px #102b4938;
}
.share-dialog .actions { justify-content: center; }
.menu-open { min-width: 44px; min-height: 44px; font-size: 1.15rem; }
.settings-menu {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(86vw, 300px); max-width: 300px;
  height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; overflow-y: auto;
  border: 0; border-right: 1px solid #d6e0ea; border-radius: 0; background: #fff;
  overscroll-behavior: contain; box-shadow: 0 8px 26px #102b4920;
}
.menu-brand { display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 18px 20px; color: #fff; background: var(--app-header-blue); }
.menu-brand img { width: 44px; height: 44px; border-radius: 10px; }
.menu-brand div { flex: 1; min-width: 0; }
.menu-brand strong, .menu-brand span { display: block; }
.menu-brand strong { font-size: 1rem; }
.menu-brand span { font-size: .73rem; letter-spacing: .035em; }
.menu-close { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; background: transparent; color: #fff; font-size: 1.15rem; }
.menu-close:hover { background: #ffffff20; }
.settings-menu nav { min-height: calc(100dvh - 84px); display: flex; flex-direction: column; padding: 14px 12px; }
.menu-group-label { margin: 15px 12px 9px; color: #7a8aa0; font-size: .7rem; font-weight: 800; letter-spacing: .055em; }
.settings-menu .menu-item { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 48px; padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; color: #445a76; font-size: .92rem; font-weight: 600; text-align: left; white-space: normal; }
.settings-menu .menu-item svg { width: 20px; height: 20px; flex: 0 0 20px; color: #73869e; }
.settings-menu .menu-item:hover { background: #f0f5fc; }
.settings-menu .menu-item[aria-current="page"] { background: #e6efff; color: #0053e5; }
.settings-menu .menu-item[aria-current="page"] svg { color: #0053e5; }
.settings-menu .menu-logout, .settings-menu .menu-logout svg { color: #b3293b; }
.menu-spacer { flex: 1; min-height: 24px; }
.menu-preference { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; padding: 12px; border: 1px solid #d6e0ea; border-radius: 9px; color: #445a76; font-size: .85rem; }
.menu-preference input { appearance: none; flex: 0 0 38px; width: 38px; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 12px; background: #b7c5d5; cursor: pointer; }
.menu-preference input::after { display: block; width: 18px; height: 18px; margin: 2px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #102b4944; content: ''; transition: transform .15s; }
.menu-preference input:checked { background: #0756df; }
.menu-preference input:checked::after { transform: translateX(16px); }
.menu-context { padding: 9px 12px 14px; color: #526a81; overflow-wrap: anywhere; }
.menu-context span, .menu-context strong, .menu-context small { display: block; }
.menu-context span, .menu-context small { font-size: .74rem; }
.menu-context strong { color: #172a3f; font-size: .9rem; }

.menu-status { margin: 12px; font-size: .85rem; }
.management-panel > h2 { margin-bottom: 14px; }
.management-panel .result-list button { display: block; padding: 12px 8px; }
.management-panel .result-list small { overflow-wrap: anywhere; }
.management-panel .result-list { max-height: min(45vh, 500px); }
@media (min-width: 860px) {
  body.sidebar-open { padding-left: 300px; }
  .settings-menu { box-shadow: none; }
}
#joinPasswordField { margin-top: 12px; }
.recent-dialog, .scanner-dialog { width: min(calc(100% - 24px), 650px); }
.recent-dialog .result-list { max-height: min(52vh, 500px); overflow-y: auto; }
.recent-dialog .result-stock { text-align: right; white-space: nowrap; }
.recent-dialog .result-stock small { display: block; white-space: normal; font-size: .79rem; }
.recent-dialog .recent-location { display: block; margin-top: 3px; color: #0756b7; font-size: .84rem; font-weight: 700; }
.scan-camera { display: flex; align-items: flex-start; flex-direction: column; gap: 7px; margin-block: 10px 0; }
.scan-camera video { width: 100%; max-height: 37vh; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #102b49; }
.scanner-dialog { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.scanner-dialog .history-heading { margin-bottom: 12px; }
.scanner-dialog .article { box-shadow: none; }
.share-url { display: block; color: #086ca5; overflow-wrap: anywhere; }
#qrCode { display: block; width: min(100%, 158px); height: auto; margin: 8px auto; image-rendering: pixelated; }
#shareStatus { min-height: 1.3em; margin: 5px 0 0; }
@media (max-width: 820px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); align-content: start; background: #f8fafb; }
  .login-brand-panel { gap: 16px; padding: 23px clamp(15px, 6vw, 42px); }
  .brand-lockup img { width: min(168px, 54%); }
  .login-brand-copy { padding: 0; }
  .login-brand-copy h1 { font-size: clamp(1.62rem, 6vw, 2rem); }
  .login-version { display: none; }
  .login-card-version { display: block; }
  .login-form-panel { padding: 15px; }
}
@media (max-width: 540px) {
  .heading { gap: 9px; }
  .heading .wordmark { display: none; }
  .heading button { padding-inline: 8px; }
  .heading h1 { font-size: 1.13rem; }
  .heading { flex-wrap: wrap; }
  .heading .title { flex: 1 1 9rem; }
  .scope { gap: 8px 12px; }
  .panel { padding: 13px; }
  .row button { padding-inline: 9px; }
  .count > .row { flex-direction: column; align-items: stretch; }
  .count > .row > button { width: 100%; }
  #scanLaunch { min-width: 44px; min-height: 44px; }
  #scanLaunch .scan-label { display: none; }
  #scanLaunch .scan-icon { display: inline; font-size: 1.15rem; }
}
@media (max-width: 360px) {
  .heading { gap: 6px; }
  .heading .title { flex-basis: 6rem; }
  .heading h1 { font-size: 1rem; }
  .scope { grid-template-columns: minmax(0, 1fr); }
}

.relation-results { max-height: 220px; overflow-y: auto; margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 7px; }
.relation-results button { display: flex !important; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 12px !important; }
.relation-results button small { flex-shrink: 0; }

.stock-warning { margin: 12px 0; padding: 11px 13px; border: 1px solid #e8c680; border-radius: 8px; background: #fff7e2; color: #704700; font-weight: 650; }
