:root {
  color-scheme: light;
  --page: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-tint: #edf8f7;
  --nav: #202a32;
  --nav-soft: #2b3740;
  --text: #17212b;
  --text-soft: #526273;
  --muted: #6d7b8b;
  --line: #d7e0e7;
  --line-strong: #b8c5cf;
  --teal: #087f78;
  --teal-dark: #056963;
  --teal-soft: #dff3f1;
  --blue: #2563eb;
  --blue-soft: #e8efff;
  --green: #16a34a;
  --green-soft: #e5f8eb;
  --amber: #ed8b00;
  --amber-soft: #fff3dc;
  --red: #d92d20;
  --red-soft: #fff0ee;
  --shadow-soft: 0 8px 24px rgba(27, 39, 51, 0.06);
  --shadow-drawer: -18px 0 44px rgba(27, 39, 51, 0.08);
  --sidebar-width: 216px;
  --drawer-width: 440px;
  font-family: "Segoe UI Variable", "Segoe UI", Aptos, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--page); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(8, 127, 120, 0.24);
  outline-offset: 2px;
}

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { letter-spacing: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.strong { font-weight: 700; }
.icon { flex: 0 0 auto; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  align-items: stretch;
}

.app-shell.drawer-open { grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--drawer-width); }

.desktop-sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: var(--nav);
  color: #f6f9fb;
  overflow: hidden;
}

.brand-lockup {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.brand-lockup div { display: grid; gap: 1px; min-width: 0; }
.brand-lockup strong { font-size: 17px; line-height: 1.2; }
.brand-lockup span:not(.brand-mark) { color: #dce5ea; font-size: 14px; }
.brand-lockup small { color: #91a0ad; font-size: 11px; }

.desktop-nav { display: grid; gap: 4px; margin-top: 32px; }
.nav-divider { height: 1px; background: #45525c; margin: 12px 6px; }

.nav-link {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #d9e2e8;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.nav-link:hover { background: var(--nav-soft); color: #fff; }
.nav-link.active {
  position: relative;
  background: var(--teal);
  color: #fff;
  font-weight: 650;
}
.nav-link.active::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 0;
  width: 3px;
  height: 28px;
  background: #53d7ca;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.sidebar-account {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #e8eef2;
  text-align: left;
  cursor: pointer;
}
.sidebar-account:hover, .sidebar-account.active { border-color: #45525c; background: var(--nav-soft); }
.sidebar-account > span:first-child {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dff3f1;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
}
.sidebar-account > span:nth-child(2) { min-width: 0; display: grid; gap: 1px; }
.sidebar-account strong, .sidebar-account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: 11px; }
.sidebar-account small { color: #aebbc5; font-size: 10px; }

.sequence-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 2px 8px;
  padding: 16px 6px 0;
  border-top: 1px solid #45525c;
}

/* Authentication and access */
.auth-view {
  position: fixed;
  inset: 0;
  z-index: 200;
  min-width: 320px;
  min-height: 100vh;
  overflow: auto;
  background: var(--nav);
}
.login-view {
  display: grid;
  grid-template-columns: minmax(420px, 1.3fr) minmax(440px, .7fr);
}
.login-view::before {
  content: "";
  min-height: 100vh;
  background: #162028 url('/static/assets/inventory-labels.png') center / cover no-repeat;
}
.auth-card {
  width: min(470px, calc(100% - 48px));
  align-self: center;
  justify-self: center;
  padding: 34px;
  border-color: #cbd6de;
  box-shadow: 0 24px 70px rgba(8, 15, 20, .22);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.auth-brand > div { display: grid; gap: 1px; }
.auth-brand strong { font-size: 15px; }
.auth-brand span:not(.brand-mark) { color: var(--muted); font-size: 12px; }
.auth-heading { margin-bottom: 22px; }
.auth-heading h1 { margin-bottom: 6px; font-size: 28px; line-height: 1.15; }
.auth-heading p { margin: 0; color: var(--muted); }
.auth-tabs { margin-bottom: 18px; }
.auth-tabs .admin-tab { flex: 1; justify-content: center; gap: 7px; }
.auth-tabs .admin-tab:disabled { color: #9aa6b1; cursor: not-allowed; }
.auth-tab-panel:focus { outline: 0; }
.auth-form, .password-form { display: grid; gap: 16px; }
.auth-form-actions { display: grid; gap: 13px; justify-items: stretch; }
.auth-submit { width: 100%; }
.auth-form-actions .link-button { justify-self: center; }
.auth-form-actions .link-button:disabled { color: #9aa6b1; cursor: not-allowed; }
.auth-alternative { position: relative; display: grid; gap: 12px; margin-top: 20px; padding-top: 19px; border-top: 1px solid var(--line); }
.auth-alternative > span { position: absolute; top: -9px; left: 50%; padding: 0 9px; background: #fff; color: var(--muted); font-size: 11px; transform: translateX(-50%); }
.auth-passkey-button { width: 100%; }
.security-heading-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 6px; background: var(--teal-soft); color: var(--teal); }
.auth-feedback {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 16px;
  padding: 11px 12px;
  border-left: 3px solid currentColor;
  background: var(--surface-soft);
  font-size: 12px;
}
.auth-feedback.tone-danger { color: var(--red); background: var(--red-soft); }
.auth-feedback.tone-success { color: var(--green); background: var(--green-soft); }
.auth-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: var(--text-soft);
}

.password-settings-view { min-height: calc(100vh - 124px); display: grid; place-items: center; }
.auth-view .password-settings-view { min-height: 100vh; padding: 24px; background: var(--page); }
.password-surface { width: min(520px, 100%); padding: 28px; }
.password-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.password-heading-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 6px; background: var(--teal-soft); color: var(--teal); }
.password-heading h2 { margin: 0 0 4px; font-size: 21px; }
.password-heading p { margin: 0; color: var(--muted); }
.password-heading small { display: block; margin-top: 4px; color: var(--text-soft); }
.password-requirements { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-soft); color: var(--text-soft); font-size: 12px; }

.profile-view { max-width: 980px; display: grid; gap: 14px; }
.profile-summary { min-height: 116px; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 20px; }
.profile-avatar { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); font-size: 20px; font-weight: 800; }
.profile-identity h2 { margin: 0 0 3px; font-size: 20px; }
.profile-identity p { margin: 0 0 9px; color: var(--muted); }
.profile-identity > div { display: flex; flex-wrap: wrap; gap: 7px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 14px; }
.profile-details, .profile-permissions { overflow: hidden; }
.profile-form-body { display: grid; gap: 14px; padding: 18px 20px; }
.profile-metadata, .user-admin-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 4px 0 0; }
.profile-metadata div, .user-admin-metadata div { min-width: 0; }
.profile-metadata dt, .user-admin-metadata dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.profile-metadata dd, .user-admin-metadata dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.profile-actions { padding: 12px 20px; border-top: 1px solid var(--line); }
.profile-permissions ul { display: grid; gap: 10px; margin: 0; padding: 18px 20px; list-style: none; }
.profile-permissions li { display: flex; align-items: flex-start; gap: 8px; color: var(--text-soft); }
.profile-permissions li .icon { color: var(--green); }
.account-security { overflow: hidden; }
.security-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.security-section-heading > div { display: grid; gap: 3px; }
.security-section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.security-section-heading .security-heading-icon { flex: 0 0 auto; margin: 0; }
.security-loading { display: flex; align-items: center; gap: 9px; padding: 22px; color: var(--muted); }
.account-security > .auth-feedback { margin: 16px 20px 0; }
.security-lock-note { display: flex; align-items: flex-start; gap: 9px; margin: 16px 20px 0; padding: 11px 12px; border-left: 3px solid #b17813; background: var(--amber-soft); color: #825b13; font-size: 12px; }
.security-factor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.security-factor-card { min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.security-factor-card + .security-factor-card { border-left: 1px solid var(--line); }
.security-factor-card > header { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; align-items: start; }
.security-factor-card > header > span, .security-factor-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; background: var(--teal-soft); color: var(--teal-dark); }
.security-factor-card h3 { margin: 0 0 3px; font-size: 15px; }
.security-factor-card p { margin: 0; color: var(--muted); font-size: 12px; }
.security-factor-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.security-factor-row { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); background: var(--surface-soft); }
.security-factor-row > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.security-factor-row strong, .security-factor-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.security-factor-row small { color: var(--muted); font-size: 10px; }
.security-factor-state { min-height: 42px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.security-factor-state > small { margin-right: auto; color: var(--muted); }
.security-confirm-form { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); background: var(--surface-soft); }
.security-confirm-form > div:first-child { display: grid; gap: 2px; }
.security-confirm-form > div:first-child small { color: var(--muted); }
.security-confirm-form .form-actions { padding: 0; border: 0; }
.totp-setup { display: grid; gap: 14px; }
.totp-setup-grid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; }
.totp-setup-grid img { width: 150px; height: 150px; padding: 5px; border: 1px solid var(--line); background: #fff; }
.totp-setup-grid > div { min-width: 0; display: grid; gap: 7px; }
.totp-setup-grid small { color: var(--muted); }
.totp-setup-grid code { padding: 8px; background: var(--surface-soft); font: 650 11px/1.5 "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.recovery-codes { display: grid; gap: 14px; padding: 14px; border: 1px solid #d2a54e; background: #fffaf0; }
.recovery-codes ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 22px; margin: 0; padding-left: 28px; }
.recovery-codes li { font-size: 12px; user-select: all; }
.security-unavailable { color: var(--muted); }

.user-admin-view {
  max-width: none;
  height: calc(100vh - 112px);
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 62px;
  overflow: hidden;
}
.user-admin-rail { grid-column: 1; grid-row: 1 / span 2; border-right: 1px solid var(--line); background: var(--surface-soft); }
.user-admin-toolbar { min-height: 62px; display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.user-search { min-width: 0; height: 40px; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); }
.user-search input { min-width: 0; border: 0; outline: 0; background: transparent; }
.user-admin-count { min-height: 38px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.user-admin-list { max-height: calc(100vh - 212px); overflow: auto; }
.user-admin-row { width: 100%; min-height: 82px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 17px; align-items: center; gap: 9px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.user-admin-row:hover { background: #fff; }
.user-admin-row.selected { background: var(--surface-tint); box-shadow: inset 3px 0 var(--teal); }
.user-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #e7edf1; color: var(--text-soft); font-size: 11px; font-weight: 800; }
.user-row-copy { min-width: 0; display: grid; gap: 2px; }
.user-row-copy strong, .user-row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-copy small { color: var(--muted); font-size: 10px; }
.user-row-copy em { color: var(--teal-dark); font-size: 10px; font-style: normal; }
.user-admin-row .status-mark { font-size: 9px; }
.user-admin-main { grid-column: 2; grid-row: 1; min-width: 0; overflow: auto; padding-bottom: 22px; }
.user-admin-heading { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.user-admin-heading > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.user-admin-heading h2 { width: 100%; margin: 0; font-size: 19px; }
.user-admin-section { padding: 20px; border-bottom: 1px solid var(--line); }
.subsection-heading { margin-bottom: 14px; }
.subsection-heading h3 { margin: 0; font-size: 14px; }
.subsection-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.user-active-toggle { align-self: end; min-height: 42px; }
.admin-form-grid.user-account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.permission-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.permission-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.permission-group legend { margin-bottom: 9px; color: var(--text-soft); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.permission-option { position: relative; min-width: 220px; cursor: pointer; }
.permission-option > input { position: absolute; opacity: 0; pointer-events: none; }
.permission-option > span { min-height: 72px; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-content: center; gap: 3px 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.permission-option > span > .icon { grid-row: 1 / span 2; align-self: center; padding: 2px; border: 1px solid var(--line-strong); border-radius: 4px; color: transparent; }
.permission-option strong { font-size: 12px; line-height: 1.35; }
.permission-option small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.permission-option input:checked + span { border-color: #88c9c4; background: var(--teal-soft); }
.permission-option input:checked + span > .icon { border-color: var(--teal); background: var(--teal); color: #fff; }
.permission-option input:focus-visible + span { outline: 3px solid rgba(8,127,120,.24); outline-offset: 2px; }
.permission-option input:disabled + span { border-color: #dfe5e9; background: #f1f4f6; color: #72808d; }
.permission-option input:disabled:checked + span { border-color: #b9d7d4; background: #e5efee; }
.permission-option input:disabled + span > .icon { border-color: #aeb9c2; background: #aeb9c2; color: #fff; }
.permission-option:has(input:disabled) { cursor: not-allowed; }
.user-admin-empty { display: grid; place-items: center; padding: 30px; }
.temporary-credential { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 14px 20px 0; padding: 12px; border-left: 3px solid var(--amber); background: var(--amber-soft); }
.temporary-credential > span { color: #9a5b00; }
.temporary-credential > div { min-width: 0; display: grid; gap: 3px; }
.temporary-credential small { color: #7d560f; }
.temporary-credential strong { overflow-wrap: anywhere; font-size: 14px; }
.sequence-footer span { grid-column: 1; color: #aebbc5; font-size: 11px; }
.sequence-footer strong { grid-column: 1; color: #fff; font-size: 14px; }
.sequence-footer button {
  grid-column: 2;
  grid-row: 1 / span 2;
  border: 0;
  background: transparent;
  color: #c7d1d8;
  cursor: pointer;
}

.main-column { min-width: 0; min-height: 100vh; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 76px;
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 590px) minmax(160px, 0.7fr);
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.page-identity { min-width: 0; }
.page-identity h1 { margin: 0; font-size: 23px; line-height: 1.15; font-weight: 720; }
.page-identity p { margin: 4px 0 0; color: var(--muted); font-size: 12px; text-transform: none; }

.global-search {
  height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}
.global-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 127, 120, 0.12); }
.global-search svg { color: var(--muted); }
.global-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.global-search input::placeholder { color: #7d8996; }
.global-search kbd {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted);
  font: 12px/1 "Cascadia Mono", Consolas, monospace;
}

.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

.button, .icon-button, .link-button, .icon-text-button {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 650;
  white-space: nowrap;
}
.button.small { min-height: 34px; padding: 0 10px; font-size: 12px; }
.button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.button.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.button.secondary { background: #fff; border-color: var(--line-strong); color: var(--text); }
.button.secondary:hover { background: var(--surface-soft); border-color: #90a1ae; }
.button.tertiary { background: transparent; border-color: transparent; color: var(--teal); }
.button.danger { background: var(--red); border-color: var(--red); color: #fff; }
.button.danger-quiet { background: #fff; border-color: #efb3ad; color: var(--red); }
.button:disabled { opacity: 0.48; cursor: not-allowed; }

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.icon-button.quiet { border-color: var(--line); background: #fff; color: var(--text-soft); }
.icon-button.quiet:hover { background: var(--surface-soft); color: var(--text); }
.icon-button.primary { background: var(--teal); color: #fff; }
.icon-button.success-button { border-color: #82c8a0; background: var(--green-soft); color: var(--green); }

.link-button, .icon-text-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--teal);
  font-weight: 650;
}
.link-button:hover, .icon-text-button:hover { text-decoration: underline; }

.mobile-topbar, .mobile-bottom-nav { display: none; }

.app-content { min-height: calc(100vh - 76px); padding: 20px 24px 28px; }
.page-view { width: 100%; max-width: 1540px; margin: 0 auto; }

.page-loading {
  min-height: 360px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
}
.button-spinner {
  width: 17px;
  height: 17px;
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.surface {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.section-heading {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 { margin: 0; font-size: 16px; font-weight: 700; }

.toast-region {
  position: fixed;
  top: 86px;
  right: 22px;
  z-index: 100;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  min-height: 52px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 8px 14px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(27, 39, 51, 0.14);
  pointer-events: auto;
}
.toast-ok { border-left-color: var(--green); color: #176534; }
.toast-info { border-left-color: var(--teal); color: var(--text); }
.toast-error { border-left-color: var(--red); color: #9f2218; }
.toast .icon-button { width: 32px; height: 32px; border: 0; }

/* Dashboard */
.dashboard-view { display: grid; gap: 16px; }
.state-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.state-segment {
  position: relative;
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 4px 8px;
  padding: 10px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.state-segment:last-child { border-right: 0; }
.state-segment:hover { background: var(--surface-soft); }
.segment-label { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 12px; }
.segment-label i, .status-mark i, .active-indicator i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #748291;
}
.segment-label i.tone-success, .tone-success i { background: var(--green); }
.segment-label i.tone-info, .tone-info i { background: var(--blue); }
.segment-label i.tone-warning, .tone-warning i { background: var(--amber); }
.segment-label i.tone-danger, .tone-danger i { background: var(--red); }
.state-segment > strong { grid-column: 1; font: 700 20px/1 "Cascadia Mono", Consolas, monospace; }
.state-segment > .icon { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); }

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1.22fr);
  grid-template-areas: "tasks activity" "categories recent";
  gap: 14px;
  align-items: start;
}
.task-surface { grid-area: tasks; }
.activity-surface { grid-area: activity; }
.category-distribution { grid-area: categories; }
.recently-added { grid-area: recent; }
.task-list, .timeline-list { display: grid; }
.task-row {
  position: relative;
  min-height: 82px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 66px 20px;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.task-row:hover { background: var(--surface-soft); }
.task-row::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; background: transparent; }
.task-row.task-warning::before { background: var(--amber); }
.task-row.task-danger::before { background: var(--red); }
.task-row:last-child { border-bottom: 0; }
.task-icon { color: var(--text-soft); }
.task-copy { display: grid; gap: 3px; min-width: 0; }
.task-copy strong { font-size: 14px; }
.task-copy small { color: var(--muted); overflow-wrap: anywhere; }
.task-count { display: grid; justify-items: end; }
.task-count strong { font: 700 20px/1 "Cascadia Mono", Consolas, monospace; }
.task-count small { color: var(--muted); font-size: 10px; }
.task-healthy { color: var(--text-soft); }

.timeline-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 105px 18px;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.timeline-row:last-child { border-bottom: 0; }
.timeline-row:hover { background: var(--surface-soft); }
.timeline-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #73808c; }
.timeline-icon.tone-info { background: var(--blue); }
.timeline-icon.tone-success { background: var(--green); }
.timeline-icon.tone-warning { background: var(--amber); }
.timeline-icon.tone-danger { background: var(--red); }
.timeline-copy, .timeline-meta { display: grid; gap: 2px; min-width: 0; }
.timeline-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-copy small, .timeline-meta small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-meta { justify-items: end; font-size: 11px; }

.compact-surface { overflow: hidden; }
.distribution-row, .recent-asset-row {
  width: 100%;
  min-height: 37px;
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.distribution-row { grid-template-columns: 155px minmax(60px, 1fr) 20px; }
.distribution-row:hover, .recent-asset-row:hover { background: var(--surface-soft); }
.distribution-row progress { width: 100%; height: 5px; border: 0; border-radius: 2px; overflow: hidden; appearance: none; }
.distribution-row progress::-webkit-progress-bar { background: #e6ecef; }
.distribution-row progress::-webkit-progress-value { background: var(--teal); }
.distribution-row progress::-moz-progress-bar { background: var(--teal); }
.recent-asset-row { grid-template-columns: 120px minmax(0, 1fr) 78px; }
.recent-asset-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.recent-asset-row small { justify-self: end; color: var(--muted); }

/* Registry */
.registry-view { display: grid; gap: 12px; }
.mobile-registry-search { display: none; }
.registry-command-row { display: flex; align-items: center; gap: 14px; }
.segmented { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.segment-button {
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
}
.segment-button:last-child { border-right: 0; }
.segment-button:hover { background: var(--surface-soft); }
.segment-button.active { background: var(--surface-tint); color: var(--teal-dark); font-weight: 700; box-shadow: inset 0 -2px var(--teal); }
.registry-count { margin-left: auto; color: var(--muted); }
.registry-count strong { color: var(--text); }
.mobile-filter-button { display: none; }

.registry-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.registry-filters label { min-width: 180px; }
.clear-filter-button { margin-left: 2px; }
.export-inline { margin-left: auto; }

label.field, .registry-filters label, .compact-field {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}
input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}
input::placeholder, textarea::placeholder { color: #8a96a2; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 127, 120, 0.1); }
input:disabled, select:disabled, textarea:disabled { background: #f1f4f6; color: #83909c; cursor: not-allowed; }
textarea { resize: vertical; }
label.field small { color: var(--muted); font-weight: 400; }

.registry-table-surface { overflow: hidden; box-shadow: none; }
.table-scroll { overflow: auto; }
.asset-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.asset-table th {
  height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}
.asset-table th:nth-child(1) { width: 132px; }
.asset-table th:nth-child(2) { width: 225px; }
.asset-table th:nth-child(3) { width: 120px; }
.asset-table th:nth-child(4) { width: 150px; }
.asset-table th:nth-child(5) { width: 65px; }
.asset-table th:nth-child(6) { width: 170px; }
.asset-table th:nth-child(7) { width: 105px; }
.drawer-open .registry-count,
.drawer-open .export-inline,
.drawer-open .desktop-refresh { display: none; }
.drawer-open .asset-table th:nth-child(5),
.drawer-open .asset-table td:nth-child(5),
.drawer-open .asset-table th:nth-child(7),
.drawer-open .asset-table td:nth-child(7) { display: none; }
.drawer-open .asset-table th:nth-child(1) { width: 125px; }
.drawer-open .asset-table th:nth-child(2) { width: 205px; }
.drawer-open .asset-table th:nth-child(3) { width: 110px; }
.drawer-open .asset-table th:nth-child(4) { width: 130px; }
.drawer-open .asset-table th:nth-child(6) { width: 155px; }
.asset-table td { height: 68px; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.asset-table tbody tr { cursor: pointer; background: #fff; }
.asset-table tbody tr:hover { background: var(--surface-soft); }
.asset-table tbody tr.selected { background: var(--surface-tint); box-shadow: inset 3px 0 var(--teal); }
.asset-table td strong, .asset-table td small { display: block; }
.asset-table td small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.status-mark { display: inline-flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 11px; font-weight: 650; white-space: nowrap; }
.status-mark i { width: 8px; height: 8px; }
.table-footer { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 13px; color: var(--muted); font-size: 11px; }
.asset-mobile-list { display: none; }

.empty-state { display: grid; place-items: center; min-height: 150px; padding: 24px; color: var(--muted); text-align: center; }
.empty-state.compact { min-height: 72px; padding: 14px; }

/* Drawer */
.asset-drawer-root {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-drawer);
}
.drawer-shell { height: 100%; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); overflow: hidden; }
.drawer-header { min-height: 112px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 20px 14px; }
.drawer-header h2 { margin: 10px 0 0; font-size: 17px; line-height: 1.3; }
.drawer-number-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.drawer-number-row > .mono { font-size: 17px; font-weight: 700; }
.drawer-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 20px 16px; border-bottom: 1px dashed var(--line-strong); }
.drawer-actions .button { min-width: 0; padding: 0 8px; font-size: 12px; }
.retired-notice { margin: 0 20px 16px; padding: 10px; border: 1px solid #efc1bd; background: var(--red-soft); color: #98251c; }
.drawer-tabs { display: flex; border-bottom: 1px solid var(--line); }
.drawer-tab { min-height: 46px; padding: 0 17px; border: 0; border-bottom: 3px solid transparent; background: #fff; color: var(--text-soft); cursor: pointer; }
.drawer-tab:hover { color: var(--text); }
.drawer-tab.active { border-bottom-color: var(--teal); color: var(--teal-dark); font-weight: 700; }
.drawer-content { min-height: 0; overflow: auto; }
.drawer-section { padding: 18px 20px 30px; }
.drawer-section > h3 { font-size: 14px; }
.drawer-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.drawer-section-heading h3 { margin: 0; font-size: 14px; }
.asset-data-grid { display: grid; gap: 0; margin: 0; }
.asset-data-grid > div { display: grid; grid-template-columns: 138px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid #edf1f3; }
.asset-data-grid dt { color: var(--muted); font-size: 11px; }
.asset-data-grid dd { margin: 0; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.asset-note { margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.asset-note span { color: var(--muted); font-size: 11px; }
.asset-note p { margin: 5px 0 0; font-size: 12px; white-space: pre-wrap; }
.asset-history { display: grid; }
.history-row { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; padding: 0 0 22px; }
.history-row::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 0; width: 1px; background: var(--line); }
.history-row:last-child::before { display: none; }
.history-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 2px solid var(--teal); border-radius: 50%; background: #fff; }
.history-row div { display: grid; gap: 3px; }
.history-row strong { font-size: 12px; }
.history-row small, .history-row > span:last-child { color: var(--muted); font-size: 10px; }
.history-row p { margin: 3px 0 0; color: var(--text-soft); font-size: 11px; }
.document-qr { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px dashed var(--line-strong); }
.document-qr img { width: 112px; height: 112px; padding: 6px; border: 1px solid var(--line); background: #fff; }
.document-qr div { display: grid; gap: 6px; }
.document-qr .mono { font-size: 15px; font-weight: 700; }
.document-qr small { color: var(--muted); }
.document-row { min-height: 64px; display: grid; grid-template-columns: 26px minmax(0, 1fr) 18px; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); color: var(--teal); text-decoration: none; }
.document-row span { display: grid; gap: 2px; }
.document-row strong { font-size: 13px; }
.document-row small { color: var(--muted); font-size: 10px; }
.handover-documents { display: grid; gap: 10px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.handover-documents-title { display: grid; gap: 4px; }
.handover-documents-title h3 { margin: 0; font-size: 13px; }
.handover-documents-title small { color: var(--muted); font-size: 10px; }
.handover-document { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 6px; background: var(--surface-soft); }
.handover-document.confirmed { border-left-color: var(--green); }
.handover-document > strong { font-size: 12px; }
.handover-document > small { color: var(--muted); font-size: 10px; }
.handover-document-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.handover-document-heading > small { color: var(--muted); font-size: 9px; }
.handover-status { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 3px 7px; border-radius: 999px; background: var(--green-soft); color: #137a37; font-size: 10px; font-weight: 700; }
.handover-document.pending .handover-status, .handover-status.pending { background: var(--amber-soft); color: #8a5100; }
.handover-document-actions { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 6px; }
.handover-upload { cursor: pointer; }
.handover-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
.attachment-inline-preview { max-width: 100%; display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--teal); font: inherit; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.asset-attachments { display: grid; gap: 10px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.asset-attachment-card { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 10px; border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 6px; background: var(--surface-soft); }
.asset-attachment-card.empty { border-left-color: var(--line-strong); }
.asset-attachment-thumbnail { width: 70px; height: 70px; grid-row: 1 / span 2; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; overflow: hidden; cursor: pointer; }
.asset-attachment-thumbnail img { width: 100%; height: 100%; display: block; object-fit: cover; }
.asset-attachment-file-icon { width: 70px; height: 70px; grid-row: 1 / span 2; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--teal); }
.asset-attachment-copy { min-width: 0; display: grid; align-content: center; gap: 4px; }
.asset-attachment-copy strong { font-size: 12px; }
.asset-attachment-copy small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.asset-attachment-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.attachment-upload { cursor: pointer; }
.attachment-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
.document-reference { display: grid; gap: 5px; padding-top: 18px; }
.document-reference span { color: var(--muted); font-size: 11px; }

/* Receipt */
.receive-view { display: grid; gap: 18px; }
.wizard-steps { max-width: 840px; display: flex; align-items: center; margin: 2px auto 0; }
.wizard-step { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.wizard-step > span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; font-weight: 700; }
.wizard-step strong { font-size: 12px; white-space: nowrap; }
.wizard-step.active { color: var(--text); }
.wizard-step.active > span { border-color: var(--teal); background: var(--teal); color: #fff; }
.wizard-step.done { color: var(--teal); }
.wizard-step.done > span { border-color: var(--teal); color: var(--teal); }
.wizard-step:disabled { cursor: default; }
.wizard-connector { height: 1px; flex: 1; min-width: 40px; margin: 0 14px; background: var(--line-strong); }
.wizard-step.done + .wizard-connector { background: var(--teal); }

.receipt-layout { display: grid; grid-template-columns: minmax(0, 860px) minmax(260px, 320px); justify-content: center; gap: 22px; align-items: stretch; }
.wizard-surface { min-height: 500px; display: grid; align-content: start; padding: 24px; box-shadow: none; }
.wizard-section-heading { margin-bottom: 24px; }
.wizard-section-heading.inline { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.wizard-section-heading h2 { margin: 0; font-size: 18px; }
.wizard-section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.mode-control { width: fit-content; display: inline-flex; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.mode-control button { min-height: 40px; padding: 0 14px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--text-soft); cursor: pointer; }
.mode-control button:last-child { border-right: 0; }
.mode-control button.active { background: var(--surface-tint); color: var(--teal-dark); font-weight: 700; }
.wizard-fields, .form-grid, .operation-fields { display: grid; gap: 14px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }
.wizard-actions, .form-actions, .result-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 26px; }
.wizard-actions.align-end { justify-content: flex-end; }
.category-fields-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.subsection-heading, .admin-subheading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.subsection-heading h3, .admin-subheading h3 { margin: 0; font-size: 14px; }
.subsection-heading span, .admin-subheading span { color: var(--muted); font-size: 10px; }
.check-field { min-height: 40px; display: flex; align-items: center; gap: 9px; padding-top: 17px; color: var(--text-soft); font-size: 12px; }
.check-field input { width: 17px; min-height: 17px; accent-color: var(--teal); }
.optional-details { margin-top: 20px; border-top: 1px dashed var(--line-strong); }
.optional-details summary { min-height: 52px; display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 650; cursor: pointer; list-style: none; }
.optional-details summary::-webkit-details-marker { display: none; }
.optional-details[open] summary .icon { transform: rotate(180deg); }
.optional-details .wizard-fields, .optional-details .field { margin-bottom: 12px; }
.unit-table { margin-top: 20px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.unit-table-head, .unit-row { display: grid; grid-template-columns: 54px minmax(180px, 1fr) minmax(160px, 0.8fr); gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.unit-table-head { background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 700; }
.unit-row:last-child { border-bottom: 0; }
.unit-row input { min-height: 36px; }

.receipt-aside { padding: 22px; border-left: 1px solid var(--line); background: #fff; }
.receipt-number-block { display: grid; gap: 6px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.receipt-number-block > span { color: var(--text-soft); font-size: 11px; }
.receipt-number-block small { margin-top: 13px; color: var(--muted); }
.receipt-number-block strong { font-size: 21px; }
.toggle-line { min-height: 44px; display: flex; align-items: center; gap: 9px; color: var(--text-soft); font-size: 12px; cursor: pointer; }
.toggle-line > input, .mini-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
  pointer-events: none;
}
.toggle-line > span, .mini-toggle > span { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 12px; background: #c8d2da; transition: 150ms ease; }
.toggle-line > span::after, .mini-toggle > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: 150ms ease; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.toggle-line > input:checked + span, .mini-toggle > input:checked + span { background: var(--teal); }
.toggle-line > input:checked + span::after, .mini-toggle > input:checked + span::after { transform: translateX(16px); }
.toggle-line > input:focus-visible + span, .mini-toggle > input:focus-visible + span { outline: 3px solid rgba(8,127,120,.22); outline-offset: 2px; }
.aside-help { display: block; margin: -3px 0 12px 47px; color: var(--muted); }
.compact-field { margin: 8px 0 16px; }
.label-preview { display: grid; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.label-preview > span { color: var(--text-soft); font-size: 12px; font-weight: 650; }
.label-preview > small { color: var(--muted); text-align: center; font-size: 10px; }
.label-paper { min-height: 232px; display: grid; justify-items: center; align-content: center; gap: 10px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.label-paper small { color: var(--text); font-weight: 700; }
.label-paper strong { font-size: 18px; }
.label-paper span { text-align: center; font-size: 12px; }
.label-paper img { width: 88px; height: 88px; }
.review-surface { align-content: start; }
.review-list { display: grid; margin: 0; }
.review-list > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-list dt { color: var(--muted); }
.review-list dd { margin: 0; font-weight: 650; }
.review-note { display: flex; align-items: center; gap: 9px; margin-top: 20px; padding: 12px; border: 1px solid #bed0e7; background: #f4f8fd; color: #355574; }
.receive-result-view { display: grid; place-items: center; min-height: 620px; }
.result-panel { width: min(760px, 100%); display: grid; justify-items: center; padding: 38px; text-align: center; }
.result-icon { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.result-panel h2 { margin: 18px 0 6px; }
.result-panel > p { color: var(--muted); }
.created-list { width: 100%; display: grid; margin: 18px 0; border: 1px solid var(--line); border-radius: 6px; }
.created-list > div { min-height: 54px; display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.created-list > div:last-child { border-bottom: 0; }
.created-list a { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-weight: 650; text-decoration: none; }

/* Operations */
.operations-view { display: grid; gap: 12px; }
.operation-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 920px; border-bottom: 1px solid var(--line); }
.operation-tabs.tabs-1 { grid-template-columns: minmax(0, 1fr); }
.operation-tabs.tabs-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.operation-tabs.tabs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.operation-tab { min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--text-soft); cursor: pointer; }
.operation-tab:hover { color: var(--text); }
.operation-tab.active { border-bottom-color: var(--teal); color: var(--teal); font-weight: 700; }
.other-operation-choice { display: flex; gap: 8px; }
.operation-scan {
  max-width: 920px;
  min-height: 78px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.operation-camera-button { display: grid; place-items: center; height: 100%; padding: 0; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--text-soft); cursor: pointer; }
.operation-camera-button:hover, .operation-camera-button:focus-visible { background: var(--teal-soft); color: var(--teal-dark); outline: 0; }
.operation-scan label { display: grid; gap: 1px; padding: 8px 16px; }
.operation-scan label small { color: var(--muted); }
.operation-scan input { min-height: 34px; padding: 0; border: 0; box-shadow: none; font: 700 24px/1.1 "Cascadia Mono", Consolas, monospace; }
.operation-scan input:focus { box-shadow: none; }
.operation-scan > button { margin-right: 7px; }
.scan-found-line { max-width: 920px; min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid #b6dfc4; background: #f2fbf5; color: #167037; }
.operation-empty { max-width: 920px; min-height: 360px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; overflow: hidden; }
.operation-empty div { display: grid; align-content: center; gap: 7px; padding: 34px; }
.operation-empty h2 { margin: 0; }
.operation-empty p { max-width: 450px; color: var(--muted); }
.operation-empty img { width: 100%; height: 100%; object-fit: cover; border-left: 1px solid var(--line); }
.operation-layout { display: grid; grid-template-columns: minmax(250px, 330px) minmax(450px, 1fr) minmax(250px, 320px); gap: 14px; align-items: start; }
.operation-asset, .operation-form { padding: 18px; box-shadow: none; }
.operation-asset-heading { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.operation-asset-heading h2 { margin: 8px 0 0; font-size: 15px; }
.operation-asset-heading .mono { font-size: 15px; font-weight: 700; }
.operation-asset dl { display: grid; margin: 14px 0; }
.operation-asset dl > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.operation-asset dt { color: var(--muted); font-size: 10px; }
.operation-asset dd { margin: 2px 0 0; font-size: 12px; font-weight: 600; }
.operation-asset > img { display: block; width: 92px; height: 92px; margin: 18px auto 0; padding: 5px; border: 1px solid var(--line); }
.operation-form h2 { margin: 0 0 20px; font-size: 16px; }
.operation-consequence { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; padding: 11px; border: 1px solid #bed0e7; background: #f4f8fd; color: #355574; font-size: 12px; }
.operation-preview { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #f9fbfb; }
.operation-preview.tone-border-danger { border-color: #efb3ad; background: #fff9f8; }
.operation-preview > span { display: block; padding: 5px 2px 10px; color: var(--muted); font-size: 11px; }
.operation-preview > div { padding: 15px; border: 1px solid var(--line); background: #fff; }
.operation-preview h3 { margin: 16px 0 4px; font-size: 15px; }
.operation-preview p { color: var(--muted); font-size: 11px; }
.operation-preview hr { margin: 18px 0; border: 0; border-top: 1px solid var(--line); }
.operation-preview > div > small { color: var(--muted); }
.operation-preview ul { display: grid; gap: 10px; padding: 0; margin: 12px 0 0; list-style: none; }
.operation-preview li { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.operation-result { max-width: 760px; min-height: 430px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 40px; text-align: center; }
.operation-result h2 { margin: 10px 0 0; }
.operation-result > p { max-width: 560px; color: var(--muted); }
.result-summary { min-width: 360px; display: grid; justify-items: center; gap: 8px; padding: 16px; border: 1px solid var(--line); }

/* Categories */
.categories-view {
  width: auto;
  min-height: calc(100vh - 124px);
  display: grid;
  grid-template-columns: 300px minmax(480px, 1fr) 310px;
  grid-template-rows: minmax(0, 1fr) 58px;
  margin: -20px -24px -28px;
  background: #fff;
}
.category-rail { grid-column: 1; grid-row: 1; min-height: 0; border-right: 1px solid var(--line); overflow: hidden; }
.category-search { height: 66px; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.category-search svg { color: var(--muted); }
.category-search input { border: 0; box-shadow: none; }
.category-mobile-add { display: none; }
.admin-category-list { height: calc(100vh - 190px); overflow: auto; }
.admin-category-row { width: 100%; min-height: 68px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 18px; align-items: center; gap: 8px; padding: 9px 13px 9px calc(13px + var(--category-depth, 0) * 16px); border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; }
.category-depth-0 { --category-depth: 0; }
.category-depth-1 { --category-depth: 1; }
.category-depth-2 { --category-depth: 2; }
.category-depth-3 { --category-depth: 3; }
.category-depth-4 { --category-depth: 4; }
.category-depth-5 { --category-depth: 5; }
.category-depth-6 { --category-depth: 6; }
.category-depth-7 { --category-depth: 7; }
.category-depth-8 { --category-depth: 8; }
.category-depth-9 { --category-depth: 9; }
.category-depth-10 { --category-depth: 10; }
.admin-category-row:hover { background: var(--surface-soft); }
.admin-category-row.selected { background: var(--surface-tint); box-shadow: inset 3px 0 var(--teal); }
.admin-category-row > span:nth-child(2) { display: grid; gap: 2px; }
.admin-category-row small { color: var(--muted); font-size: 10px; }
.category-device-icon { color: var(--text-soft); }
.category-main { grid-column: 2; grid-row: 1; min-width: 0; padding: 22px 26px 32px; overflow: auto; }
.category-main-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.category-main-header > div { display: flex; align-items: center; gap: 10px; }
.category-main-header h2 { margin: 0; font-size: 20px; }
.category-path { flex-basis: 100%; order: 3; color: var(--muted); font-size: 10px; }
.code-label { padding: 3px 7px; border-radius: 4px; background: #e9eef2; color: #41505f; font: 700 10px/1.3 "Cascadia Mono", Consolas, monospace; }
.active-indicator { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.active-indicator i { background: var(--green); }
.admin-tabs { display: flex; margin-top: 18px; border-bottom: 1px solid var(--line); }
.admin-tab { min-height: 42px; padding: 0 12px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--text-soft); cursor: pointer; }
.admin-tab.active { border-bottom-color: var(--teal); color: var(--teal); font-weight: 700; }
.admin-settings-form, .admin-fields-editor { padding-top: 20px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.system-fields, .category-rules, .custom-field-admin { padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.system-field-row { min-height: 38px; display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; padding: 0 4px; color: var(--text-soft); font-size: 12px; }
.system-field-row span { display: flex; align-items: center; gap: 8px; }
.system-field-row small { color: var(--muted); }
.category-rules .toggle-line { width: fit-content; }
.admin-field-head, .admin-field-row { display: grid; grid-template-columns: 24px minmax(0, 1.4fr) minmax(0, .7fr) minmax(96px, .9fr) 70px 40px; gap: 7px; align-items: center; }
.admin-field-head { min-height: 34px; padding: 0 7px; border: 1px solid var(--line); border-bottom: 0; background: var(--surface-soft); color: var(--muted); font-size: 10px; }
.admin-field-head > span:nth-child(n + 5) { justify-self: center; text-align: center; }
.admin-field-row { position: relative; min-height: 54px; padding: 7px; border: 1px solid var(--line); border-bottom: 0; }
.admin-field-row:last-of-type { border-bottom: 1px solid var(--line); }
.admin-field-row input, .admin-field-row select { min-width: 0; min-height: 36px; padding-inline: 8px; font-size: 11px; }
.drag-handle { display: grid; place-items: center; color: var(--muted); cursor: grab; }
.mini-toggle { display: grid; place-items: center; cursor: pointer; }
.mini-toggle > span { width: 34px; height: 20px; }
.mini-toggle > span::after { width: 14px; height: 14px; }
.mini-toggle > input:checked + span::after { transform: translateX(14px); }
.admin-field-row .mini-toggle, .admin-field-row .icon-button { justify-self: center; }
.admin-field-row .icon-button { width: 34px; height: 34px; color: var(--red); }
.field-options-input { grid-column: 2 / -1; }
.field-type-help { grid-column: 2 / -1; color: var(--muted); font-size: 10px; }
.attachment-field { grid-column: span 2; }
.attachment-field input[type="file"] { padding: 7px; background: var(--surface-soft); }
.attachment-field small { color: var(--muted); overflow-wrap: anywhere; }
.custom-field-admin > .button { margin-top: 10px; }
.category-preview { grid-column: 3; grid-row: 1; min-width: 0; padding: 22px 18px; border-left: 1px solid var(--line); overflow: auto; }
.preview-form { display: grid; gap: 14px; }
.preview-form h4 { margin: 6px 0 -2px; font-size: 12px; }
.preview-form .check-field { padding-top: 0; }
.admin-savebar { grid-column: 1 / -1; grid-row: 2; position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 8px 18px; border-top: 1px solid var(--line); background: #fff; }
.user-admin-view > .admin-savebar { grid-column: 2; grid-row: 2; }
.admin-savebar > span { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.admin-savebar.dirty > span { color: #9a5b00; }
.admin-savebar > div { display: flex; gap: 8px; }

/* Settings */
.settings-view {
  max-width: none;
  height: calc(100vh - 124px);
  min-height: calc(100vh - 124px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  grid-template-rows: minmax(0, 1fr) 62px;
  align-items: start;
  gap: 14px;
}
.settings-loading { grid-column: 1 / -1; min-height: 340px; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 28px; color: var(--muted); text-align: center; }
.settings-loading > .icon { color: var(--teal); }
.settings-loading p { max-width: 520px; margin: 0; }
.smtp-settings-main { grid-column: 1; grid-row: 1; min-width: 0; overflow: auto; }
.smtp-settings-heading { min-height: 88px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.settings-heading-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 6px; background: var(--teal-soft); color: var(--teal); }
.smtp-settings-heading h2, .smtp-status-panel h2 { margin: 0; font-size: 18px; }
.smtp-settings-heading p, .smtp-status-panel header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.smtp-enabled-toggle { justify-self: end; white-space: nowrap; }
.smtp-settings-main > .auth-feedback { margin: 16px 20px 0; }
.smtp-form-section { padding: 20px; border-bottom: 1px solid var(--line); }
.smtp-form-section:last-child { border-bottom: 0; }
.subsection-heading.with-icon { display: flex; align-items: flex-start; justify-content: flex-start; gap: 9px; }
.subsection-heading.with-icon > span { color: var(--teal); }
.smtp-form-grid { display: grid; gap: 14px; }
.smtp-form-grid.server-grid { grid-template-columns: minmax(180px, 1.2fr) minmax(210px, 1.3fr) minmax(100px, .6fr) minmax(130px, .8fr); }
.smtp-form-grid.identity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.smtp-plain-warning { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 12px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: #7d560f; }
.smtp-plain-warning > .icon { margin-top: 1px; }
.smtp-plain-warning > div { display: grid; gap: 3px; }
.smtp-plain-warning span { font-size: 12px; }
.smtp-password-fieldset { min-width: 0; margin: 20px 0 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); }
.smtp-password-fieldset legend { padding: 0; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.smtp-password-state { display: flex; align-items: center; gap: 7px; margin: 8px 0 12px; color: var(--muted); font-size: 12px; }
.smtp-password-state > .icon { color: var(--teal); }
.smtp-password-actions { display: grid; grid-template-columns: repeat(3, minmax(145px, 1fr)); gap: 8px; }
.smtp-password-choice { position: relative; min-width: 0; cursor: pointer; }
.smtp-password-choice > input { position: absolute; opacity: 0; pointer-events: none; }
.smtp-password-choice > span { min-height: 62px; display: grid; align-content: center; gap: 3px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.smtp-password-choice strong { font-size: 12px; }
.smtp-password-choice small { color: var(--muted); font-size: 11px; }
.smtp-password-choice input:checked + span { border-color: #88c9c4; background: var(--teal-soft); box-shadow: inset 3px 0 var(--teal); }
.smtp-password-choice input:focus-visible + span { outline: 3px solid rgba(8,127,120,.24); outline-offset: 2px; }
.smtp-password-choice input:disabled + span { border-color: #dfe5e9; background: #f1f4f6; color: #7c8995; }
.smtp-password-choice input:disabled + span small { color: #87939e; }
.smtp-password-choice:has(input:disabled) { cursor: not-allowed; }
.smtp-password-value { max-width: 520px; margin-top: 14px; }
.smtp-status-panel { grid-column: 2; grid-row: 1; min-width: 0; position: sticky; top: 96px; overflow: hidden; }
.smtp-status-panel > header { min-height: 88px; display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.smtp-status-summary { min-height: 72px; display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.smtp-status-summary > i { width: 10px; height: 10px; border-radius: 50%; background: #748291; }
.smtp-status-summary.tone-success > i { background: var(--green); }
.smtp-status-summary.tone-warning > i { background: var(--amber); }
.smtp-status-summary.tone-danger > i { background: var(--red); }
.smtp-status-summary > div { min-width: 0; display: grid; gap: 3px; }
.smtp-status-summary small { color: var(--muted); overflow-wrap: anywhere; }
.smtp-status-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.smtp-status-metadata div { min-width: 0; }
.smtp-status-metadata dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.smtp-status-metadata dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.smtp-test-section { padding: 18px; }
.smtp-test-section .subsection-heading { margin-bottom: 10px; }
.smtp-test-result { display: flex; align-items: flex-start; gap: 9px; padding: 11px; border-left: 3px solid #748291; background: var(--surface-soft); }
.smtp-test-result.tone-success { border-left-color: var(--green); color: #176534; background: var(--green-soft); }
.smtp-test-result.tone-danger { border-left-color: var(--red); color: #9f2218; background: var(--red-soft); }
.smtp-test-result > div { min-width: 0; display: grid; gap: 3px; }
.smtp-test-result small, .smtp-test-result time { overflow-wrap: anywhere; font-size: 11px; }
.smtp-test-result time { color: var(--muted); }
.smtp-test-recipient { display: flex; align-items: flex-start; gap: 7px; margin: 14px 0 10px; color: var(--text-soft); font-size: 12px; overflow-wrap: anywhere; }
.smtp-test-recipient > span { min-width: 0; }
.smtp-test-button { width: 100%; }
.smtp-test-requirement { display: block; margin-top: 7px; color: var(--muted); text-align: center; }
.smtp-savebar { grid-column: 1 / -1; grid-row: 2; }

/* Inventory label pool */
.labels-view { display: grid; gap: 14px; }
.label-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.label-summary-card {
  position: relative;
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.label-summary-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #71808e; }
.label-summary-card.available::before { background: var(--green); }
.label-summary-card.assigned::before { background: var(--blue); }
.label-summary-card.today::before { background: var(--teal); }
.label-summary-card span { color: var(--text-soft); font-size: 12px; font-weight: 650; }
.label-summary-card strong { font: 750 25px/1.1 "Cascadia Mono", Consolas, monospace; }
.label-summary-card small { color: var(--muted); }
.labels-surface { overflow: hidden; box-shadow: none; }
.labels-toolbar {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 360px);
  align-items: center;
  gap: 18px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.labels-toolbar h2 { margin: 0; font-size: 16px; }
.labels-toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.labels-mobile-generate { display: none; }
.label-search {
  min-height: 40px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
}
.label-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 127, 120, 0.1); }
.label-search input { min-height: 38px; padding: 0; border: 0; box-shadow: none; }
.label-search input:focus { box-shadow: none; }
.labels-filter-row { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.labels-filter-row > span { color: var(--muted); font-size: 12px; }
.labels-filter-row .segment-button { display: inline-flex; align-items: center; gap: 8px; }
.labels-filter-row .segment-button span { min-width: 22px; padding: 2px 6px; border-radius: 10px; background: #e8edf1; color: var(--text-soft); font: 700 10px/1.35 "Cascadia Mono", Consolas, monospace; }
.labels-filter-row .segment-button.active span { background: var(--teal-soft); color: var(--teal-dark); }
.label-table { width: 100%; min-width: 1040px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.label-table th { height: 42px; padding: 0 12px; border-bottom: 1px solid var(--line-strong); background: #fff; color: var(--text-soft); font-size: 11px; text-align: left; white-space: nowrap; }
.label-table th:nth-child(1) { width: 180px; }
.label-table th:nth-child(2) { width: 155px; }
.label-table th:nth-child(3) { width: 120px; }
.label-table th:nth-child(4) { width: 260px; }
.label-table th:nth-child(5) { width: 170px; }
.label-table th:nth-child(6) { width: 170px; }
.label-table td { height: 70px; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.label-table tbody tr:last-child td { border-bottom: 0; }
.label-table tbody tr:hover { background: var(--surface-soft); }
.label-table td > small, .label-table td > span:not(.label-status) { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.label-number { font-size: 14px; }
.label-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.label-status i { width: 7px; height: 7px; border-radius: 50%; }
.label-status.available { background: var(--green-soft); color: #176534; }
.label-status.available i { background: var(--green); }
.label-status.assigned { background: var(--blue-soft); color: #194eb6; }
.label-status.assigned i { background: var(--blue); }
.label-asset-link { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 18px; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.label-asset-link:hover strong { color: var(--teal); text-decoration: underline; }
.label-asset-link span { min-width: 0; display: grid; gap: 2px; }
.label-asset-link strong, .label-asset-link small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-asset-link small { color: var(--muted); font-size: 10px; }
.label-asset-link .icon { color: var(--muted); }
.label-unassigned { color: var(--muted); font-style: italic; }
.label-action-cell { text-align: right; }
.label-actor { color: var(--text-soft); }
.label-mobile-list { display: none; }
.labels-footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.labels-footer > span { display: inline-flex; align-items: center; gap: 6px; }
.labels-footer strong { color: var(--text); }
.labels-error { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid #efb3ad; border-left: 3px solid var(--red); border-radius: 6px; background: var(--red-soft); color: #9f2218; }
.labels-error .link-button { margin-left: auto; color: #9f2218; }
.generate-labels-modal { width: min(520px, 100%); }
.label-format-preview { display: grid; gap: 4px; padding: 17px; border-left: 3px solid var(--teal); background: var(--surface-tint); }
.label-format-preview > span { color: var(--text-soft); font-size: 11px; font-weight: 650; text-transform: uppercase; }
.label-format-preview > strong { font-size: 25px; color: var(--teal-dark); }
.label-format-preview > small { color: var(--muted); }
.generate-count-field { margin-top: 18px; }
.generate-count-field input { max-width: 150px; font: 700 18px/1 "Cascadia Mono", Consolas, monospace; }
.generate-label-note { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 9px; margin-top: 18px; padding: 12px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--text-soft); }
.generate-label-note .icon { color: var(--teal); }
.generate-label-note p { margin: 0; font-size: 12px; }

/* Exports */
.exports-view { max-width: 980px; display: grid; gap: 14px; }
.export-surface { overflow: hidden; }
.export-intro { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.export-intro h2 { margin: 0; font-size: 18px; }
.export-intro p { margin: 6px 0 0; color: var(--muted); }
.data-health { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-weight: 650; white-space: nowrap; }
.export-list { display: grid; }
.export-row { min-height: 82px; display: grid; grid-template-columns: 32px minmax(0, 1fr) 55px 20px; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.export-row:last-child { border-bottom: 0; }
.export-row:hover { background: var(--surface-soft); }
.export-row > .icon { color: var(--teal); }
.export-row span { display: grid; gap: 4px; }
.export-row small { color: var(--muted); }
.export-row em { padding: 4px 7px; border-radius: 4px; background: #e9eef2; color: var(--text-soft); font: normal 700 10px/1 "Cascadia Mono", Consolas, monospace; text-align: center; }
.export-note { display: flex; gap: 12px; padding: 16px; border-left: 3px solid var(--teal); background: #fff; }
.export-note > span { color: var(--teal); }
.export-note p { margin: 5px 0 0; color: var(--muted); }

/* Modals and mobile sheet */
.modal-backdrop { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 22px; background: rgba(17, 26, 33, 0.48); }
.modal-panel { width: min(820px, 100%); max-height: calc(100vh - 44px); display: grid; grid-template-rows: auto minmax(0, 1fr); border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 24px 70px rgba(17,26,33,.22); overflow: hidden; }
.modal-header { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.modal-header span { color: var(--teal); font-size: 11px; }
.modal-header h2 { margin: 3px 0 0; font-size: 18px; }
.modal-body { min-height: 0; overflow: auto; padding: 18px; }
.edit-section { margin-bottom: 22px; }
.edit-section h3 { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.modal-actions { position: sticky; bottom: -18px; display: flex; justify-content: flex-end; gap: 8px; margin: 12px -18px -18px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fff; }
.attachment-preview-modal { width: min(1040px, 100%); height: min(820px, calc(100vh - 44px)); grid-template-rows: auto minmax(0, 1fr) auto; }
.attachment-preview-body { min-height: 0; display: grid; place-items: center; padding: 16px; background: #edf1f3; overflow: auto; }
.attachment-preview-image { max-width: 100%; max-height: 100%; display: block; object-fit: contain; background: #fff; box-shadow: var(--shadow-soft); }
.attachment-preview-pdf { width: 100%; height: 100%; min-height: 520px; border: 1px solid var(--line); background: #fff; }
.attachment-preview-modal > .modal-actions { position: static; margin: 0; }

.mobile-more-sheet { display: none; }

.camera-scanner-backdrop { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 20px; background: rgba(9, 16, 21, .76); }
.camera-scanner-panel { width: min(620px, 100%); max-height: calc(100vh - 40px); display: grid; grid-template-rows: auto minmax(260px, 1fr) auto auto; border-radius: 8px; background: #fff; box-shadow: 0 24px 80px rgba(0, 0, 0, .4); overflow: hidden; }
.camera-scanner-panel > header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.camera-scanner-panel > header span { color: var(--teal); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.camera-scanner-panel > header h2 { margin: 3px 0 0; font-size: 18px; }
.camera-preview { position: relative; min-height: 300px; display: grid; place-items: center; background: #10171c; overflow: hidden; }
.camera-preview video { width: 100%; height: 100%; min-height: 300px; display: block; object-fit: cover; }
.camera-scan-frame { position: absolute; inset: 50% auto auto 50%; width: min(72%, 390px); aspect-ratio: 1.6; border: 2px solid rgba(255,255,255,.92); border-radius: 8px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); transform: translate(-50%, -50%); }
.camera-scan-frame::after { content: ""; position: absolute; left: 7%; right: 7%; top: 50%; height: 2px; background: #2cf0df; box-shadow: 0 0 12px rgba(44,240,223,.9); }
.camera-scanner-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9px; background: rgba(16,23,28,.72); color: #fff; }
.camera-scanner-panel > p { margin: 0; padding: 12px 16px; color: var(--muted); font-size: 12px; }
.camera-scanner-error { display: flex; align-items: flex-start; gap: 9px; margin: 12px 16px 0; padding: 10px 12px; border-left: 3px solid var(--red); background: var(--red-soft); color: #9f2218; font-size: 12px; }
.camera-scanner-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px 16px; }

@media (max-width: 1320px) {
  :root { --drawer-width: 390px; }
  .app-header { grid-template-columns: minmax(150px, .55fr) minmax(280px, 500px) minmax(140px, .55fr); padding-inline: 18px; gap: 14px; }
  .app-content { padding-inline: 18px; }
  .asset-table th:nth-child(5), .asset-table td:nth-child(5), .asset-table th:nth-child(7), .asset-table td:nth-child(7) { display: none; }
  .categories-view { grid-template-columns: 260px minmax(430px, 1fr) 280px; margin-inline: -18px; }
  .operation-layout { grid-template-columns: minmax(230px, 290px) minmax(400px, 1fr); }
  .operation-preview { grid-column: 1 / -1; display: none; }
  .admin-form-grid.user-account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smtp-form-grid.server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1185px) and (min-width: 761px) {
  .categories-view { grid-template-columns: 240px minmax(0, 1fr); }
  .category-preview { display: none; }
}

@media (max-width: 1050px) and (min-width: 761px) {
  :root { --sidebar-width: 74px; --drawer-width: 410px; }
  .desktop-sidebar { padding-inline: 9px; }
  .brand-lockup { justify-content: center; padding: 0; }
  .brand-lockup div, .nav-link span, .sequence-footer span, .sequence-footer strong, .sequence-footer button { display: none; }
  .sidebar-account { grid-template-columns: 34px; justify-content: center; }
  .sidebar-account > span:nth-child(2), .sidebar-account > .icon { display: none; }
  .desktop-nav { margin-top: 24px; }
  .nav-link { justify-content: center; padding: 0; }
  .nav-divider { margin-inline: 3px; }
  .app-header { grid-template-columns: minmax(145px, .5fr) minmax(260px, 1fr) auto; }
  .header-primary span { display: none; }
  .dashboard-main-grid { grid-template-columns: 1fr; grid-template-areas: "tasks" "activity" "categories" "recent"; }
  .task-surface { min-height: auto; }
  .state-strip { grid-template-columns: repeat(5, minmax(115px, 1fr)); overflow-x: auto; }
  .registry-command-row { align-items: flex-start; flex-wrap: wrap; }
  .saved-views { max-width: 100%; overflow-x: auto; }
  .registry-filters { flex-wrap: wrap; }
  .registry-filters label { flex: 1 1 170px; }
  .receipt-layout { grid-template-columns: minmax(0, 1fr) 270px; }
  .operation-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .categories-view { grid-template-columns: 240px minmax(0, 1fr); }
  .category-preview { display: none; }
  .admin-field-head, .admin-field-row { grid-template-columns: 26px minmax(0, 1.1fr) minmax(0, .8fr) minmax(96px, .9fr) 70px 42px; }
  .admin-form-grid.user-account-grid { grid-template-columns: 1fr; }
  .settings-view { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 62px; }
  .smtp-settings-main { grid-column: 1; grid-row: 1; }
  .smtp-status-panel { grid-column: 1; grid-row: 2; position: static; }
  .smtp-savebar { grid-column: 1; grid-row: 3; }
  .label-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) and (min-width: 761px) {
  .user-admin-view { grid-template-columns: 240px minmax(0, 1fr); }
  .permission-groups { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --sidebar-width: 0px; --drawer-width: 100vw; }
  body { padding-bottom: 72px; background: #fff; }
  .app-shell, .app-shell.drawer-open { display: block; min-height: auto; }
  .desktop-sidebar, .app-header { display: none; }
  .main-column { min-height: auto; }
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    height: 66px;
    display: grid;
    grid-template-columns: minmax(92px, 1fr) auto minmax(92px, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.98);
  }
  .mobile-brand { display: flex; align-items: center; gap: 8px; }
  .mobile-brand span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: var(--teal); color: #fff; font-weight: 800; }
  .mobile-brand strong { font-size: 11px; }
  .mobile-topbar h1 { margin: 0; font-size: 19px; text-align: center; }
  .mobile-topbar > button { justify-self: end; }
  .app-content { min-height: calc(100vh - 138px); padding: 14px 12px 24px; }
  .toast-region { top: 74px; right: 10px; width: calc(100vw - 20px); }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    height: 72px;
    display: grid;
    grid-template-columns: repeat(var(--mobile-nav-count, 5), minmax(0, 1fr));
    padding: 6px 4px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.98);
    box-shadow: 0 -8px 26px rgba(27,39,51,.07);
  }
  .mobile-nav-link { min-width: 0; display: grid; place-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
  .mobile-nav-link.active { color: var(--teal); font-weight: 700; }

  .state-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .state-segment { min-width: 142px; min-height: 68px; scroll-snap-align: start; }
  .dashboard-main-grid { display: grid; grid-template-columns: 1fr; grid-template-areas: "tasks" "activity" "categories" "recent"; }
  .task-surface { min-height: auto; }
  .task-row { grid-template-columns: 28px minmax(0, 1fr) 48px 18px; min-height: 78px; padding-inline: 11px; }
  .task-copy small { display: none; }
  .timeline-row { grid-template-columns: 34px minmax(0, 1fr) 18px; }
  .timeline-meta { display: none; }
  .distribution-row { grid-template-columns: 130px minmax(50px,1fr) 20px; }
  .recently-added { display: none; }
  .section-heading { min-height: 50px; }

  .registry-view { gap: 12px; }
  .mobile-registry-search { min-height: 44px; display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
  .mobile-registry-search svg { color: var(--muted); }
  .mobile-registry-search input { min-height: 40px; padding: 0; border: 0; box-shadow: none; }
  .registry-command-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .saved-views { grid-column: 1 / -1; grid-row: 2; width: 100%; overflow-x: auto; }
  .segment-button { flex: 1 0 auto; }
  .registry-count { margin: 0; align-self: center; }
  .mobile-filter-button { display: inline-flex; }
  .registry-filters { display: none; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
  .registry-filters.mobile-open { display: grid; }
  .registry-filters label { min-width: 0; }
  .registry-filters .button { width: 100%; }
  .export-inline { margin: 0; }
  .table-scroll, .table-footer { display: none; }
  .asset-mobile-list { display: grid; }
  .registry-table-surface { border-inline: 0; border-radius: 0; margin-inline: -12px; box-shadow: none; }
  .asset-mobile-row {
    position: relative;
    min-height: 112px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26px;
    align-content: center;
    gap: 4px 8px;
    padding: 14px 42px 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    text-align: left;
    cursor: pointer;
  }
  .asset-mobile-row.selected { background: var(--surface-tint); box-shadow: inset 3px 0 var(--teal); }
  .asset-mobile-row .mono, .asset-mobile-row strong, .asset-mobile-row .status-mark, .asset-mobile-row small { grid-column: 1; }
  .asset-mobile-row .mono { font-size: 13px; }
  .asset-mobile-row strong { font-size: 15px; }
  .asset-mobile-row small { color: var(--muted); }
  .mobile-row-chevron { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); }

  .labels-view { gap: 10px; }
  .label-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .label-summary-card { min-height: 86px; padding: 11px 12px; box-shadow: none; }
  .label-summary-card span { font-size: 10px; }
  .label-summary-card strong { font-size: 21px; }
  .label-summary-card small { font-size: 9px; }
  .labels-surface { margin-inline: -12px; border-inline: 0; border-radius: 0; }
  .labels-toolbar { min-height: auto; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px 12px 12px; }
  .labels-toolbar h2 { font-size: 15px; }
  .labels-toolbar p { font-size: 10px; }
  .labels-mobile-generate { display: inline-flex; min-height: 38px; padding-inline: 10px; }
  .label-search { grid-column: 1 / -1; }
  .labels-filter-row { min-height: 54px; padding: 8px 12px; overflow-x: auto; }
  .labels-filter-row .segmented { flex: 1 0 auto; }
  .labels-filter-row > span { display: none; }
  .label-mobile-list { display: grid; }
  .label-mobile-card { display: grid; gap: 12px; padding: 15px 14px; border-bottom: 1px solid var(--line); background: #fff; }
  .label-mobile-card:last-child { border-bottom: 0; }
  .label-mobile-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .label-mobile-heading > strong { font-size: 15px; }
  .label-mobile-assignment { min-width: 0; }
  .label-mobile-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
  .label-mobile-meta span { min-width: 0; display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
  .label-mobile-card > .button { width: 100%; }
  .labels-footer { align-items: flex-start; flex-direction: column; padding-inline: 14px; }
  .generate-labels-modal .modal-body { padding-top: 16px; }
  .label-format-preview > strong { font-size: 22px; }
  .generate-count-field input { max-width: 100%; }

  .asset-drawer-root { position: fixed; inset: 0 0 72px; z-index: 90; height: auto; width: 100%; border: 0; box-shadow: none; }
  .drawer-header { min-height: 92px; padding: 15px 14px 10px; }
  .drawer-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 14px; }
  .drawer-tabs { overflow-x: auto; }
  .drawer-tab { flex: 1; padding-inline: 10px; }
  .drawer-section { padding-inline: 14px; }
  .asset-data-grid > div { grid-template-columns: 120px minmax(0, 1fr); }
  .attachment-field { grid-column: 1; }
  .asset-attachment-card { grid-template-columns: 58px minmax(0, 1fr); }
  .asset-attachment-thumbnail, .asset-attachment-file-icon { width: 58px; height: 58px; }
  .asset-attachment-actions { grid-column: 1 / -1; }

  .wizard-steps { justify-content: center; overflow: hidden; }
  .wizard-step { min-width: 0; }
  .wizard-step strong { display: none; }
  .wizard-connector { min-width: 30px; max-width: 70px; }
  .receipt-layout { display: flex; flex-direction: column; }
  .receipt-aside { order: -1; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
  .receipt-number-block { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding-bottom: 10px; }
  .receipt-number-block > span, .receipt-number-block small { grid-column: 1; margin: 0; }
  .receipt-number-block strong { grid-column: 2; grid-row: 1 / span 2; font-size: 15px; }
  .receipt-aside .toggle-line, .receipt-aside .aside-help, .receipt-aside .compact-field { display: none; }
  .label-preview { display: none; }
  .wizard-surface { min-height: auto; padding: 18px 14px; border-inline: 0; margin-inline: -12px; border-radius: 0; }
  .wizard-fields.two-columns, .wizard-fields.three-columns, .form-grid.two-columns, .form-grid.three-columns, .operation-fields.two-columns { grid-template-columns: 1fr; }
  .wizard-section-heading.inline { align-items: flex-start; }
  .mode-control { width: 100%; }
  .mode-control button { flex: 1; padding-inline: 8px; }
  .unit-table-head, .unit-row { grid-template-columns: 42px minmax(0, 1fr); }
  .unit-table-head span:nth-child(3), .unit-row input:nth-child(3) { grid-column: 2; }
  .wizard-actions { position: sticky; bottom: 76px; z-index: 4; margin: 20px -14px -18px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fff; }
  .wizard-actions .button { flex: 1; min-width: 0; padding-inline: 10px; }
  .review-list > div { grid-template-columns: 110px minmax(0, 1fr); }
  .created-list > div { grid-template-columns: 1fr; justify-items: start; }
  .result-actions { flex-direction: column; width: 100%; }
  .result-actions .button { width: 100%; }

  .operation-tabs { width: 100%; overflow: hidden; }
  .operation-tab { min-width: 0; gap: 0; padding-inline: 3px; font-size: 12px; }
  .operation-tab svg { display: none; }
  .operation-scan { grid-template-columns: 44px minmax(0, 1fr) 46px; min-height: 68px; }
  .operation-scan input { font-size: 18px; }
  .operation-empty { grid-template-columns: 1fr; min-height: 420px; margin-inline: -12px; border-inline: 0; border-radius: 0; }
  .operation-empty div { padding: 24px 18px; }
  .operation-empty img { height: 190px; border: 0; border-top: 1px solid var(--line); }
  .operation-layout { grid-template-columns: 1fr; }
  .operation-asset { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 8px; }
  .operation-asset-heading, .operation-asset > .status-mark, .operation-asset dl { grid-column: 1; }
  .operation-asset > img { grid-column: 2; grid-row: 1 / span 3; width: 76px; height: 76px; margin: 0; }
  .operation-asset dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .operation-form { padding: 16px 14px; }
  .operation-preview { display: none; }
  .operation-result { min-height: 480px; padding: 24px 14px; }
  .result-summary { min-width: 0; width: 100%; }

  .categories-view { min-height: auto; display: block; margin: -14px -12px -24px; }
  .category-rail { border-right: 0; }
  .category-search { height: 58px; grid-template-columns: 20px minmax(0, 1fr) 38px; padding-right: 8px; }
  .category-mobile-add { display: grid; }
  .admin-category-list { height: auto; max-height: 250px; border-bottom: 1px solid var(--line); overflow: auto; }
  .admin-category-row { min-height: 62px; }
  .category-main { padding: 18px 14px 100px; }
  .category-main-header { align-items: flex-start; }
  .category-main-header > div { flex-wrap: wrap; }
  .category-main-header .icon-text-button { font-size: 0; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-field-head { display: none; }
  .admin-field-row { grid-template-columns: 24px minmax(0, 1fr) 40px; gap: 8px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
  .admin-field-row input[name="field_label"], .admin-field-row input[name="field_key"], .admin-field-row select, .admin-field-row .field-options-input { grid-column: 2; }
  .admin-field-row .mini-toggle { grid-column: 3; grid-row: 1; }
  .admin-field-row .icon-button { grid-column: 3; grid-row: 2; }
  .drag-handle { grid-row: 1 / span 3; }
  .category-preview { display: none; }
  .admin-savebar { position: fixed; left: 0; right: 0; bottom: 72px; z-index: 70; padding: 8px 10px; }
  .admin-savebar > span { font-size: 10px; }
  .admin-savebar .button { min-height: 38px; padding-inline: 10px; font-size: 11px; }

  .export-intro { align-items: flex-start; flex-direction: column; }
  .export-row { grid-template-columns: 28px minmax(0, 1fr) 42px; padding-inline: 14px; }
  .export-row > .icon:last-child { display: none; }

  .login-view { display: grid; grid-template-columns: 1fr; min-height: 100vh; background: #fff; }
  .login-view::before { display: none; }
  .auth-card { width: 100%; min-height: 100vh; display: grid; align-content: center; padding: 26px 20px; border: 0; border-radius: 0; box-shadow: none; }
  .auth-brand { margin-bottom: 28px; }
  .auth-heading h1 { font-size: 25px; }
  .auth-view .password-settings-view { padding: 0; }
  .password-surface { min-height: 100vh; display: grid; align-content: center; padding: 24px 18px; border: 0; border-radius: 0; box-shadow: none; }
  .password-form .form-actions { flex-direction: column; }
  .password-form .button { width: 100%; }

  .profile-summary { grid-template-columns: 50px minmax(0, 1fr); padding: 16px 14px; }
  .profile-avatar { width: 50px; height: 50px; font-size: 16px; }
  .profile-summary > .button { grid-column: 1 / -1; width: 100%; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-metadata { grid-template-columns: 1fr; }
  .profile-actions { flex-direction: column; }
  .profile-actions .button { width: 100%; }
  .security-factor-grid { grid-template-columns: 1fr; }
  .security-factor-card { padding: 16px 14px; }
  .security-factor-card + .security-factor-card { border-left: 0; border-top: 1px solid var(--line); }
  .totp-setup-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .totp-setup-grid > div { width: 100%; }
  .recovery-codes ol { grid-template-columns: 1fr; }
  .security-confirm-form .form-actions, .recovery-codes .form-actions { flex-direction: column; }
  .security-confirm-form .button, .recovery-codes .button { width: 100%; }

  .camera-scanner-backdrop { padding: 0; background: #10171c; }
  .camera-scanner-panel { width: 100%; max-height: none; min-height: 100dvh; grid-template-rows: auto minmax(320px, 1fr) auto auto; border-radius: 0; }
  .camera-preview, .camera-preview video { min-height: 320px; }
  .camera-scanner-actions { flex-direction: column; }
  .camera-scanner-actions .button { width: 100%; }

  .user-admin-view { width: calc(100% + 24px); height: auto; min-height: auto; display: block; margin: -14px -12px -24px; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
  .user-admin-rail, .user-admin-main, .user-admin-view > .admin-savebar { grid-column: auto; grid-row: auto; }
  .user-admin-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .user-admin-list { max-height: 245px; }
  .user-admin-main { padding-bottom: 100px; overflow: visible; }
  .user-admin-heading { align-items: flex-start; padding: 14px; }
  .user-admin-heading .button { min-width: 42px; font-size: 0; }
  .user-admin-section { padding: 16px 14px; }
  .admin-form-grid.user-account-grid { grid-template-columns: 1fr; }
  .permission-groups, .permission-grid { grid-template-columns: 1fr; }
  .permission-option { min-width: 220px; }
  .permission-option > span { min-height: 62px; }
  .user-admin-metadata { grid-template-columns: 1fr; }
  .temporary-credential { grid-template-columns: 28px minmax(0, 1fr); margin: 12px 14px 0; }
  .temporary-credential .button { grid-column: 1 / -1; width: 100%; }

  .settings-view { min-height: auto; display: block; padding-bottom: 92px; }
  .smtp-settings-main, .smtp-status-panel, .smtp-savebar { grid-column: auto; grid-row: auto; }
  .smtp-settings-main, .smtp-status-panel { border-inline: 0; border-radius: 0; box-shadow: none; }
  .smtp-settings-heading { grid-template-columns: 40px minmax(0, 1fr); padding: 14px; }
  .settings-heading-icon { width: 40px; height: 40px; }
  .smtp-enabled-toggle { grid-column: 1 / -1; justify-self: start; }
  .smtp-settings-main > .auth-feedback { margin: 14px 14px 0; }
  .smtp-form-section { padding: 18px 14px; }
  .smtp-form-grid.server-grid, .smtp-form-grid.identity-grid, .smtp-password-actions { grid-template-columns: 1fr; }
  .smtp-password-choice { min-width: 0; }
  .smtp-status-panel { margin-top: 14px; }
  .smtp-status-metadata { grid-template-columns: 1fr; }
  .smtp-savebar { position: fixed; left: 0; right: 0; bottom: 72px; }

  .modal-backdrop { align-items: end; padding: 0; }
  .modal-panel { width: 100%; max-height: calc(100vh - 38px); border-radius: 6px 6px 0 0; }
  .attachment-preview-modal { height: calc(100vh - 38px); }
  .attachment-preview-body { padding: 8px; }
  .attachment-preview-pdf { min-height: 360px; }
  .modal-body { padding: 14px; }
  .modal-actions { bottom: -14px; margin-inline: -14px; margin-bottom: -14px; padding-inline: 14px; }

  .mobile-more-sheet { display: block; position: fixed; inset: 0; z-index: 110; }
  .sheet-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(17,26,33,.44); }
  .sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 14px calc(18px + env(safe-area-inset-bottom)); border-radius: 8px 8px 0 0; background: #fff; }
  .sheet-handle { width: 44px; height: 4px; margin: 0 auto 14px; border-radius: 2px; background: #ccd5dc; }
  .sheet-panel h2 { font-size: 17px; }
  .sheet-panel > button:not(.sheet-scrim) { width: 100%; min-height: 66px; display: grid; grid-template-columns: 26px minmax(0, 1fr) 18px; align-items: center; gap: 10px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; }
  .sheet-panel > button span { display: grid; gap: 2px; }
  .sheet-panel > button small { color: var(--muted); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
