:root {
  --ink: #152033;
  --muted: #647084;
  --line: #d6deea;
  --soft: #f3f6fb;
  --paper: #ffffff;
  --blue: #0055a4;
  --blue-dark: #003e7e;
  --blue-soft: #e8f1fb;
  --gold: #f6b221;
  --gold-dark: #bb7a05;
  --green: #14805e;
  --red: #b42318;
  --amber: #9a6506;
  --teal: #007b83;
  --shadow: 0 18px 48px rgba(0, 62, 126, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: #edf2f8;
  color: var(--ink);
  font-family: "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-screen,
.auth-loading {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(0, 62, 126, 0.9), rgba(0, 85, 164, 0.78) 58%, rgba(187, 122, 5, 0.72)),
    url("https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
}

.login-screen[hidden],
.auth-loading[hidden] {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
  border-top: 5px solid var(--gold);
}

.login-brand {
  color: var(--ink);
  margin-bottom: 22px;
}

.login-brand p {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--ink);
  text-transform: none;
}

.login-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.login-browser-hint {
  border: 1px solid rgba(250, 178, 15, 0.65);
  border-radius: 8px;
  background: rgba(250, 178, 15, 0.12);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  margin: 12px 0 0;
  padding: 10px;
}

.login-detail {
  margin: 8px 0 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
}

.app-shell.locked {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--blue-dark);
  color: #fff;
  padding: 24px 18px;
  border-right: 5px solid var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 52px;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
}

.brand p {
  color: #c8d8eb;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  border-radius: 7px;
  color: #d9e5f2;
  background: transparent;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: inset 4px 0 0 var(--gold);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 22px;
}

.sidebar-signout {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 800;
}

.sidebar-signout:hover {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.14);
}

.software-version {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 700;
  margin: 10px 0 0;
  text-align: center;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar-title {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 10px;
  align-items: center;
  min-width: 0;
}

.topbar-title .eyebrow,
.topbar-title h2 {
  grid-column: 1;
}

.mobile-top-brand {
  display: none;
  width: 38px;
  height: 44px;
}

.mobile-top-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.icon-button.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  border-radius: 999px;
  background: currentColor;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.signed-in {
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 310px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 0 12px;
}

.scan-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.scan-box input,
.search-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.scan-icon-button {
  width: 42px;
  padding: 0;
}

.scan-icon-button svg {
  display: block;
  width: 20px;
  height: 20px;
  margin: auto;
  fill: currentColor;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
  border-radius: 7px;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0 6px;
}

.icon-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  min-width: 42px;
}

.mobile-editor-close {
  display: none;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric {
  min-height: 104px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(0, 62, 126, 0.06);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(24px, 2.5vw, 32px);
  color: var(--blue-dark);
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.compact-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.compact-metrics .metric {
  min-height: 88px;
  padding: 14px 16px;
  border-top-width: 3px;
  box-shadow: 0 6px 16px rgba(0, 62, 126, 0.045);
}

.compact-metrics .metric strong {
  margin-top: 8px;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.05;
  word-break: break-word;
}

.compact-metrics .metric small {
  margin-top: 6px;
}

.license-category-metric {
  grid-column: span 2;
}

.license-category-chart {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 12px;
}

.license-category-pie {
  width: 82px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 6px solid #ffffff;
  box-shadow: inset 0 0 0 1px rgba(0, 73, 135, 0.12), 0 8px 20px rgba(0, 62, 126, 0.1);
}

.license-category-legend {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.license-category-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.license-category-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.license-category-legend span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.license-category-legend strong {
  margin: 0;
  color: var(--blue-dark);
  font-size: 13px;
}

.split-layout,
.checkout-grid,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-panel-wide {
  min-width: 0;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel,
.table-panel,
.editor-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(0, 62, 126, 0.05);
}

.panel {
  padding: 18px;
}

.panel h3,
.editor-panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-heading h3 {
  margin: 0;
}

.stack,
.activity-feed,
.report-list,
.schema-list,
.user-list,
.mapping-list {
  display: grid;
  gap: 10px;
}

.attention-item,
.activity-item,
.report-item,
.schema-item,
.user-item,
.deployment-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.admin-section-heading {
  margin: 18px 0 10px;
}

.admin-section-heading h3 {
  margin: 0 0 4px;
}

.admin-section-heading p {
  margin: 0;
  color: var(--muted);
}

.user-item.editable-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-item.editable-item > div {
  min-width: 0;
}

.user-item.editable-item .secondary-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
}

.attention-item strong,
.activity-item strong,
.report-item strong,
.schema-item strong,
.user-item strong,
.deployment-item strong {
  display: block;
  margin-bottom: 4px;
}

.attention-item p,
.activity-item p,
.report-item p,
.schema-item p,
.user-item p,
.deployment-item p,
.integration-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.deployment-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-bars {
  display: grid;
  gap: 12px;
}

.stat-row {
  display: grid;
  gap: 5px;
}

.stat-row-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.stat-row-top span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-row small {
  color: var(--muted);
}

.stat-track {
  background: #edf3fa;
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.stat-fill {
  background: var(--blue);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.stat-fill.good {
  background: var(--green);
}

.stat-fill.warn {
  background: var(--gold);
}

.stat-fill.bad {
  background: var(--red);
}

.stat-fill.info {
  background: var(--teal);
}

.summary-list,
.finance-snapshot {
  display: grid;
  gap: 10px;
}

.summary-line,
.finance-snapshot article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  display: grid;
  gap: 3px;
  padding: 10px;
}

.summary-line strong,
.finance-snapshot strong {
  color: var(--blue-dark);
}

.summary-line span,
.summary-line small,
.finance-snapshot span {
  color: var(--muted);
  font-size: 0.86rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented button {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.segmented button.active {
  background: var(--blue-dark);
  color: #fff;
  border-color: var(--blue-dark);
}

.filter-select {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-select select {
  min-width: 180px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  text-transform: none;
  font-weight: 700;
}

.search-input {
  max-width: 360px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.data-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.table-panel {
  overflow: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f7faff;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--blue-soft);
}

tbody tr.selected-row {
  background: #fff6dc;
  box-shadow: inset 4px 0 0 var(--gold);
}

.editor-panel {
  padding: 18px;
  position: sticky;
  top: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label,
.form-grid fieldset {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  text-transform: none;
  font-weight: 500;
}

.form-grid textarea {
  resize: vertical;
}

.form-grid select[multiple] {
  min-height: 94px;
}

.form-grid .inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.form-grid .inline-checkbox input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}

.wide {
  grid-column: 1 / -1;
}

.selected-assets {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px 12px;
}

.selected-assets p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.assignment-fieldset {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.assignment-fieldset legend {
  grid-column: 1 / -1;
}

.assignment-fieldset label {
  min-width: 0;
}

.duplicate-panel {
  border: 1px solid #f4bf45;
  border-radius: 7px;
  background: #fff8df;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.duplicate-panel[hidden] {
  display: none;
}

.duplicate-panel strong {
  color: #7a4b00;
}

.duplicate-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid rgba(122, 75, 0, 0.18);
  padding-top: 10px;
}

.duplicate-match p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.asset-media-fieldset {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.finance-fieldset {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.finance-fieldset legend {
  grid-column: 1 / -1;
}

.finance-fieldset label {
  min-width: 0;
}

.asset-media-fieldset label,
.asset-media-fieldset button {
  grid-column: 1 / -1;
}

.asset-media-fieldset input[type="file"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 8px;
}

.asset-media-fieldset .secondary-button {
  justify-self: start;
  max-width: 260px;
  min-height: 44px;
  white-space: normal;
}

.fieldset-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
}

.current-asset-list {
  display: grid;
  gap: 8px;
}

.current-asset-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.current-asset-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.danger-link {
  color: var(--red);
}

.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.bulk-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 8px 10px;
  margin-bottom: 14px;
}

.bulk-heading,
.bulk-actions {
  display: grid;
  gap: 10px;
}

.bulk-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.bulk-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  justify-self: start;
  min-height: 34px;
  padding: 0;
  text-align: left;
}

.bulk-toggle span {
  font-weight: 900;
}

.bulk-toggle span::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
}

.bulk-panel.is-expanded .bulk-toggle span::before {
  transform: rotate(90deg);
}

.bulk-toggle strong {
  color: var(--muted);
  font-size: 0.86rem;
}

.bulk-heading .button-row {
  gap: 6px;
}

.bulk-heading .secondary-button,
.bulk-heading .text-button {
  min-height: 34px;
  padding: 0 10px;
}

.bulk-actions {
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr) auto;
  align-items: end;
  padding-top: 8px;
}

.bulk-actions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.asset-select {
  width: 18px;
  min-height: 18px;
}

.history-panel {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.history-panel h4 {
  margin: 0;
  font-size: 14px;
}

.asset-media-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.asset-media-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
}

.asset-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 160px));
  gap: 10px;
}

.asset-photo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
  position: relative;
  background: #fff;
}

.asset-photo-card img {
  aspect-ratio: 4 / 3;
  display: block;
  max-height: 120px;
  object-fit: cover;
  width: 100%;
}

.asset-photo-card figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  padding: 7px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-attachment-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.asset-attachment-item {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.asset-attachment-item a {
  color: var(--blue);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-attachment-item span {
  color: var(--muted);
  font-size: 0.78rem;
  grid-column: 1;
}

.media-remove-button {
  align-items: center;
  background: rgba(13, 35, 64, 0.86);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  position: absolute;
  right: 6px;
  top: 6px;
  width: 28px;
}

.media-remove-button.inline {
  background: var(--red);
  grid-column: 2;
  grid-row: 1 / span 2;
  position: static;
}

.history-current,
.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.history-current p,
.history-item p,
.muted-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  background: #eef2f6;
}

.badge.good {
  color: var(--green);
  background: #e8f6f1;
}

.badge.warn {
  color: var(--amber);
  background: #fff3dd;
}

.badge.bad {
  color: var(--red);
  background: #ffeceb;
}

.badge.info {
  color: var(--teal);
  background: #e8f8fa;
}

.accessory-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
}

.accessory-fieldset legend {
  padding: 0 6px;
}

.accessory-fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-transform: none;
  font-size: 14px;
  font-weight: 650;
}

.accessory-fieldset input {
  width: auto;
  min-height: auto;
}

.accessory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 190px);
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.accessory-row select {
  min-height: 40px;
}

.accessory-cost-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px);
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.accessory-cost-row span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.accessory-cost-row input {
  width: 100%;
}

.inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.tag-editor {
  display: grid;
  gap: 10px;
}

.tag-editor-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue-dark);
  padding: 3px 5px 3px 10px;
  font-size: 13px;
  font-weight: 800;
}

.tag-pill button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 44, 84, 0.12);
  color: var(--blue-dark);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.tag-empty {
  color: var(--muted);
  font-size: 13px;
}

.tag-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.tag-library {
  display: grid;
  gap: 18px;
}

.tag-library-group {
  display: grid;
  gap: 10px;
}

.tag-library-group h4 {
  margin: 0;
}

.tag-library-list {
  display: grid;
  gap: 8px;
}

.tag-library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.tag-library-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.integration-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbff;
  padding: 14px;
}

.integration-card strong {
  display: block;
  margin-bottom: 6px;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.backup-actions button {
  flex: 1 1 220px;
}

.rights-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.department-access-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.compact-heading {
  align-items: center;
  margin-bottom: 0;
}

.department-access-matrix {
  display: grid;
  gap: 12px;
}

.department-access-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.4fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.department-access-card p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.department-access-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.department-access-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.department-access-options input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.label-preview {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin: 14px 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.label-preview .label {
  display: block;
  width: 300px;
  min-height: 98px;
  border: 1px solid #111;
  background: #fff;
  color: #000;
  padding: 8px;
  font-family: Arial, sans-serif;
}

.label-preview .asset-label {
  width: 260px;
  min-height: 98px;
  text-align: center;
}

.label-preview .label-title {
  font-size: 18px;
  font-weight: 800;
}

.label-preview .asset-label .label-title {
  font-size: 12px;
}

.label-preview .asset-label .label-meta {
  font-size: 10px;
}

.label-preview .label-meta {
  font-size: 12px;
  margin-top: 3px;
}

.label-preview .barcode {
  height: 26px;
  margin-top: 6px;
}

.barcode-svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: #000;
  shape-rendering: crispEdges;
}

.inline-asset-link {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mapping-list {
  margin: 14px 0;
}

.mapping-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.mapping-header strong {
  color: var(--ink);
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mapping-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mapping-grid select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-actions button {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.45);
  padding: 20px;
  z-index: 30;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(460px, 100%);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal h3 {
  margin: 0;
}

.scanner-modal {
  width: min(560px, 100%);
}

#scannerVideo {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-dark);
  object-fit: cover;
}

#scannerReader {
  width: 100%;
  min-height: 280px;
}

#scannerReader video {
  border-radius: 8px;
}

.collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: 18px;
  font-weight: 800;
  text-align: left;
}

.collapse-toggle::after {
  content: "Show";
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.collapse-toggle[aria-expanded="true"]::after {
  content: "Hide";
}

.collapse-content {
  margin-top: 14px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
  background: var(--blue-dark);
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 40;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.label-sheet {
  display: none;
}

.kiosk-note {
  display: none;
  margin: 0 0 16px;
  color: var(--muted);
}

.kiosk-corners[hidden] {
  display: none;
}

.kiosk-corner {
  position: fixed;
  z-index: 60;
  display: none;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(246, 178, 33, 0.78);
  border-radius: 50%;
  place-items: center;
  background: rgba(0, 62, 126, 0.82);
  color: #fff;
  font-weight: 900;
  pointer-events: none;
}

.kiosk-corner.top-left {
  top: 18px;
  left: 18px;
}

.kiosk-corner.top-right {
  top: 18px;
  right: 18px;
}

.kiosk-corner.bottom-right {
  right: 18px;
  bottom: 18px;
}

.kiosk-corner.bottom-left {
  bottom: 18px;
  left: 18px;
}

.kiosk-mode {
  background: #fff;
}

.kiosk-mode .sidebar,
.kiosk-mode .topbar,
.kiosk-mode .sidebar-backdrop,
.kiosk-mode .checkout-grid > .panel:last-child,
.kiosk-mode #printReturnLabelBtn {
  display: none !important;
}

.kiosk-mode .app-shell {
  grid-template-columns: 1fr;
}

.kiosk-mode .workspace {
  padding: clamp(16px, 3vw, 40px);
}

.kiosk-mode .view {
  display: none;
}

.kiosk-mode #checkout.active-view {
  display: block;
}

.kiosk-mode .checkout-grid {
  grid-template-columns: 1fr;
}

.kiosk-mode .checkout-grid > .panel:first-child {
  max-width: 980px;
  margin: 0 auto;
}

.kiosk-mode .kiosk-note {
  display: block;
}

.kiosk-mode .kiosk-corner {
  display: none;
}

.kiosk-mode .kiosk-hide-field {
  display: none !important;
}

.kiosk-person-matches {
  display: grid;
  gap: 10px;
}

.kiosk-person-matches[hidden],
.kiosk-asset-scan-row {
  display: none;
}

.kiosk-person-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.kiosk-person-choice span {
  color: var(--muted);
  font-weight: 800;
}

.kiosk-person-choice.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 62, 126, 0.12);
}

.checkout-asset-groups {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.checkout-asset-groups h4 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.checkout-asset-groups ul {
  margin: 0;
  padding-left: 18px;
}

.scan-result {
  min-height: 22px;
  color: var(--muted);
}

.kiosk-mode .transaction-form label,
.kiosk-mode .transaction-form legend {
  font-size: 14px;
}

.kiosk-mode .transaction-form input,
.kiosk-mode .transaction-form select,
.kiosk-mode .transaction-form textarea,
.kiosk-mode .transaction-form button {
  min-height: 54px;
  font-size: 18px;
}

.kiosk-mode .kiosk-asset-scan-row {
  display: flex;
}

.kiosk-mode .kiosk-person-choice {
  min-height: 64px;
  font-size: 18px;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    width: min(300px, 86vw);
    padding: 20px 16px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    overflow-y: auto;
    box-shadow: var(--shadow);
  }

  .brand {
    margin-bottom: 24px;
  }

  .nav-list {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
  }

  .mobile-menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(15, 23, 42, 0.45);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .icon-button.menu-button {
    display: inline-grid;
    place-items: center;
  }

  .split-layout,
  .checkout-grid,
  .admin-grid,
  .dashboard-grid,
  .reports-grid,
  .data-layout {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }

  body.mobile-editor-open {
    overflow: hidden;
  }

  .editor-panel.mobile-editor-active {
    position: fixed;
    inset: 10px;
    z-index: 35;
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 58px;
    box-shadow: var(--shadow);
  }

  body.mobile-editor-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 34;
    background: rgba(15, 23, 42, 0.48);
  }

  .editor-panel .mobile-editor-close {
    display: none;
  }

  .editor-panel.mobile-editor-active .mobile-editor-close {
    display: inline-grid;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 12px;
  }

  .topbar,
  .top-actions,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
  }

  .topbar-title {
    grid-template-columns: auto minmax(0, 1fr) auto;
    width: 100%;
  }

  .mobile-top-brand {
    display: block;
    grid-row: 1 / span 2;
    grid-column: 1;
  }

  .topbar-title .eyebrow,
  .topbar-title h2 {
    grid-column: 2;
  }

  .menu-button {
    grid-row: 1 / span 2;
    grid-column: 3;
    align-self: center;
    justify-self: end;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions > button,
  .top-actions > .scan-box {
    width: 100%;
  }

  .bulk-heading,
  .bulk-actions {
    grid-template-columns: 1fr;
  }

  .signed-in {
    max-width: 100%;
    width: 100%;
    white-space: normal;
  }

  .scan-box,
  .search-input {
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .metrics-grid,
  .deployment-board {
    grid-template-columns: 1fr;
  }

  .license-category-metric {
    grid-column: span 1;
  }

  .license-category-chart {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .license-category-pie {
    width: 68px;
  }

  .metric {
    min-height: auto;
    padding: 14px;
  }

  .metric strong {
    font-size: 28px;
  }

  .panel,
  .editor-panel {
    padding: 14px;
  }

  .panel-heading,
  .mapping-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .department-access-card {
    grid-template-columns: 1fr;
  }

  .user-item.editable-item {
    align-items: stretch;
    flex-direction: column;
  }

  .assignment-fieldset,
  .accessory-row,
  .accessory-cost-row,
  .inline-add,
  .tag-entry,
  .tag-library-item,
  .current-asset-item,
  .duplicate-match,
  .mapping-grid,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }

  .backup-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-row button {
    width: 100%;
  }

  .filter-select {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .filter-select select {
    min-width: 0;
    width: 100%;
  }

  table {
    min-width: 620px;
  }

  th,
  td {
    padding: 10px;
  }

  .label-preview .label {
    width: min(300px, 100%);
  }

  .topbar h2 {
    font-size: 25px;
  }
}

@media (max-width: 430px) {
  .login-screen,
  .auth-loading {
    padding: 14px;
  }

  .login-card {
    padding: 18px;
  }

  .workspace {
    padding: 10px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .top-actions .signed-in,
  .top-actions .scan-box,
  .top-actions .primary-button {
    grid-column: 1 / -1;
  }

  .scan-icon-button {
    width: 100%;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
    overflow-y: auto;
  }
}

.facts-grade-report {
  overflow: hidden;
}

.facts-grade-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

.facts-grade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.facts-grade-table th,
.facts-grade-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

.facts-grade-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

@media print {
  @page assetTag {
    size: 2in 0.75in;
    margin: 0;
  }

  @page returnLabel {
    size: 3.4in 1.1in;
    margin: 0;
  }

  body {
    background: #fff;
  }

  .app-shell,
  .toast,
  .modal-backdrop {
    display: none !important;
  }

  .label-sheet {
    display: block;
    color: #000;
    font-family: Arial, sans-serif;
  }

  .asset-label-sheet {
    page: assetTag;
  }

  .return-label-sheet {
    page: returnLabel;
  }

  .label {
    width: 2in;
    height: 0.75in;
    border: 1px solid #000;
    box-sizing: border-box;
    overflow: hidden;
    padding: 0.055in 0.04in 0.035in 0.075in;
    break-inside: avoid;
  }

  .asset-label {
    text-align: center;
  }

  .return-label {
    width: 3.4in;
    min-height: 1.1in;
    height: auto;
    padding: 0.08in;
  }

  .label-title {
    font-size: 7pt;
    font-weight: 800;
    line-height: 1;
  }

  .label-meta {
    font-size: 5.5pt;
    line-height: 1.05;
    margin-top: 0.02in;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .barcode {
    height: 0.24in;
    margin-top: 0.03in;
  }

  .return-label .label-title {
    font-size: 13pt;
  }

  .return-label .label-meta {
    font-size: 8pt;
    margin-top: 0.04in;
  }

  .return-label .barcode {
    height: 0.32in;
    margin-top: 0.06in;
  }
}
