:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #dce4ee;
  --line-strong: #cbd6e2;
  --muted: #667085;
  --text: #182230;
  --brand: #2266d6;
  --brand-strong: #164ca5;
  --accent: #1f9a8a;
  --sidebar: #ffffff;
  --sidebar-soft: #1e293b;
  --success: #127c45;
  --warning: #a15c00;
  --danger: #b42318;
  --ink: #101828;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 48px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
}

body.needs-login .sidebar,
body.needs-login .app-shell,
body.needs-login .modal-backdrop {
  display: none;
}

body:not(.needs-login) .login-screen { display: none; }

button, input, select { font: inherit; }
button { background: var(--brand); border: 1px solid var(--brand); border-radius: 6px; color: #fff; cursor: pointer; font-weight: 700; min-height: 36px; padding: 0 14px; transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease; }
button:hover { background: var(--brand-strong); box-shadow: 0 8px 18px rgba(31, 101, 214, 0.16); }
button.secondary { background: #fff; border-color: var(--line); color: var(--brand-strong); }
button.secondary:hover { background: #f8fbff; border-color: #b7c9e8; }
button.danger { background: #fff; border-color: #ff4d4f; color: #cf1322; }
button.danger:hover { background: #fff1f0; }
button:disabled { background: #f5f5f5; border-color: #d9d9d9; color: #b8b8b8; cursor: not-allowed; }
[hidden] { display: none !important; }
input, select { background: #fff; border: 1px solid #c9d3df; border-radius: 6px; color: var(--ink); height: 36px; min-width: 0; padding: 0 10px; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; width: 100%; }
input:focus, select:focus { border-color: var(--brand); outline: 2px solid rgba(31, 101, 214, 0.18); }
select[multiple] { height: auto; min-height: 112px; padding: 6px 8px; }
code { background: #eef3fb; border-radius: 5px; color: var(--brand-strong); font-family: "SFMono-Regular", Consolas, monospace; padding: 2px 5px; }
.token-code { display: inline-block; line-height: 1.5; max-width: 360px; overflow-wrap: anywhere; white-space: normal; }

/* Login shares the console brand while keeping its own responsive composition. */
.login-screen { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 100vh; min-height: 100svh; background: #fff; }
.login-story { display: flex; flex-direction: column; padding: 44px clamp(36px, 5vw, 88px); background: #174fae; color: #fff; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { border: 1px solid #ffffff40; border-radius: 11px; }
.login-brand strong, .login-mobile-brand strong { font-size: 24px; letter-spacing: -.8px; }
.login-brand > span { padding-left: 14px; border-left: 1px solid #ffffff50; font-size: 12px; color: #d5e3ff; }
.login-story-content { margin: auto 0; padding: 60px 0; }
.login-screen .login-kicker { margin: 0 0 22px; font-size: 11px; font-weight: 600; letter-spacing: 2px; }
.login-story .login-kicker { color: #bfd4fa; }
.login-story h2 { margin: 0; font-size: clamp(34px, 3.5vw, 54px); font-weight: 600; line-height: 1.35; letter-spacing: -1px; }
.login-story-description { margin: 24px 0 38px; font-size: 15px; line-height: 1.9; color: #d5e3ff; }
.login-workflow { list-style: none; padding: 0; margin: 0; }
.login-workflow li { display: flex; align-items: flex-start; gap: 18px; padding: 17px 0; border-top: 1px solid #ffffff25; }
.login-workflow li > span { padding-top: 2px; font-size: 12px; color: #bcd1f6; font-variant-numeric: tabular-nums; }
.login-workflow strong { font-size: 14px; font-weight: 500; }
.login-workflow p { margin: 5px 0 0; font-size: 12px; color: #c8dbfa; }
.login-story-footer { margin: 0; color: #c8dbfa; font-size: 11px; letter-spacing: 1px; }
.login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 72px 40px 96px; }
.login-card { width: min(380px, 100%); display: grid; gap: 24px; }
.login-heading { margin-bottom: 12px; }
.login-heading .login-kicker { color: var(--brand); margin-bottom: 14px; letter-spacing: 1.5px; }
.login-heading h1 { margin: 0 0 14px; font-size: 32px; font-weight: 600; letter-spacing: -1px; }
.login-heading > p:last-child { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.login-screen .login-field { display: grid; gap: 10px; font-size: 13px; font-weight: 500; color: #344054; }
.login-screen input { height: 48px; padding: 0 14px; font-size: 14px; border-color: #d0d7e2; border-radius: 7px; background: #fff; }
.login-screen input::placeholder { color: #858e9e; }
.login-screen input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px #2266d615; }
.login-password { position: relative; display: block; }
.login-password input { padding-right: 66px; }
.login-password button { position: absolute; top: 6px; right: 6px; min-height: 36px; padding: 0 10px; background: transparent; border: 0; font-size: 12px; font-weight: 500; color: #526078; box-shadow: none; }
.login-password button:hover { color: var(--brand); background: #f0f5fc; }
.login-screen button:focus-visible { outline: 3px solid #94b9fa; outline-offset: 3px; }
.login-screen .login-submit { height: 48px; border-radius: 7px; font-size: 14px; font-weight: 600; letter-spacing: 1px; }
.login-screen .login-submit:active { transform: translateY(1px); }
.login-card .login-help { margin: 0; text-align: center; color: #667085; font-size: 12px; line-height: 1.8; }
.login-notice { margin: 0; background: #fff4f2; border: 1px solid #f5c8c2; border-radius: 6px; color: #a12a1f; padding: 11px 13px; font-size: 13px; line-height: 1.6; }
.login-main-footer { position: absolute; bottom: 32px; color: #7c8595; font-size: 11px; }
.login-mobile-brand { display: none; }
@media (max-width: 800px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-main { min-height: 100svh; padding: 110px 28px 90px; }
  .login-mobile-brand { display: flex; gap: 10px; align-items: center; position: absolute; top: 32px; left: 28px; }
  .login-heading h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-screen input, .login-screen button { transition: none; }
}

.sidebar {
  background: var(--sidebar);
  bottom: 0;
  color: #dce6f3;
  display: flex;
  flex-direction: column;
  left: 0;
  position: fixed;
  top: 0;
  width: 264px;
}

.brand {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 12px;
  min-height: 78px;
  padding: 18px 18px 16px;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(31, 154, 138, 0.22);
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #aebdd0;
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 14px 12px;
}

.nav-section {
  display: grid;
  gap: 5px;
}

.nav-section-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: #96a5ba;
  display: flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: space-between;
  letter-spacing: 0;
  min-height: 28px;
  padding: 0 8px;
  text-align: left;
}

.nav-section-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  color: #dce6f3;
}

.nav-section-toggle i {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  display: block;
  height: 7px;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms ease;
  width: 7px;
}

.nav-section.collapsed .nav-section-toggle i {
  transform: rotate(-45deg);
}

.nav-section-links {
  display: grid;
  gap: 5px;
  max-height: 180px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 200ms ease, opacity 160ms ease, transform 160ms ease;
}

.nav-section.collapsed .nav-section-links {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
}

.nav a {
  border-radius: 6px;
  color: #d5deea;
  display: block;
  font-weight: 700;
  padding: 10px 12px 10px 14px;
  position: relative;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav a.active {
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  color: var(--sidebar);
}

.nav a.active::before {
  background: var(--accent);
  border-radius: 999px;
  bottom: 9px;
  content: "";
  left: 6px;
  position: absolute;
  top: 9px;
  width: 3px;
}

.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 16px 18px 18px;
}

.sidebar-foot span {
  color: #aebdd0;
  font-size: 12px;
}

.sidebar-token-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.sidebar-token-actions button {
  min-height: 32px;
  padding: 0 8px;
}

.app-shell {
  margin-left: 264px;
  padding: 28px 32px;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(220, 228, 238, 0.78);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.topbar h1 {
  font-size: 26px;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 2px 0 0;
}

.eyebrow {
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}

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

.topbar-actions span {
  color: var(--muted);
  font-size: 13px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: #8a3b00;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.notice.success {
  background: #ecfdf3;
  border-color: #b7e4c7;
  color: var(--success);
}

.band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.section-head {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 20px;
}

.section-head h2 {
  font-size: 18px;
  letter-spacing: 0;
  margin: 0;
}

.section-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  text-align: left;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.report-summary {
  border-bottom: 1px solid var(--line);
}

.report-split {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.metric {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-right: 1px solid var(--line);
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 18px 20px;
}

.metric:last-child {
  border-right: 0;
}

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

.metric strong {
  color: var(--ink);
  font-size: 28px;
  letter-spacing: 0;
}

.toolbar-form {
  align-items: end;
  background: #fbfdff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  padding: 14px 18px;
}

.toolbar-form.wide {
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
}

.filter-bar {
  align-items: end;
  background: #fbfdff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 1.2fr) minmax(160px, 0.6fr) minmax(180px, 0.7fr) auto;
  padding: 14px 18px;
}

label {
  display: grid;
  gap: 5px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
}

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

.license-table {
  min-width: 1280px;
}

.batch-table {
  min-width: 1180px;
}

.batch-table td {
  overflow-wrap: anywhere;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f7f9fc;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #fbfdff;
}

tbody tr.is-disabled {
  background: #fafafa;
}

tbody tr.is-disabled td {
  color: #6b7280;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.muted {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 3px;
}

.pill {
  white-space: nowrap;
  flex-shrink: 0;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
}

.pill.available,
.pill.finished,
.pill.completed,
.pill.admin {
  background: #ecfdf3;
  border-color: #b7e4c7;
  color: var(--success);
}

.pill.claimed,
.pill.in_use,
.pill.ongoing,
.pill.in-use,
.pill.buyer {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--brand-strong);
}

.pill.problem,
.pill.failed,
.pill.abandoned,
.pill.unavailable {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}

.pill.disabled,
.pill.unverified {
  background: #f5f5f5;
  border-color: #e5e7eb;
  color: #3f3f46;
}

.pill.recognition-recognized,
.pill.recognition-verified {
  background: #ecfdf3;
  border-color: #b7e4c7;
  color: var(--success);
}

.pill.recognition-pending {
  background: #fffbeb;
  border-color: #fde68a;
  color: var(--warning);
}

.pill.recognition-failed {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  inset: 0;
  padding: 24px;
  position: fixed;
  z-index: 50;
}

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

.modal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 88px rgba(15, 23, 42, 0.28);
  justify-self: center;
  max-height: 90vh;
  overflow: auto;
  width: min(760px, 100%);
}

.modal.wide {
  width: min(1080px, 100%);
}

.modal-header {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
}

.modal-header h2 {
  font-size: 18px;
  letter-spacing: 0;
  margin: 2px 0 0;
}

.modal-description {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 6px 0 0;
}

.icon-button {
  align-items: center;
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
  display: inline-flex;
  font-size: 22px;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 36px;
}

.icon-button:hover {
  background: #f8fafc;
  color: var(--ink);
}

.modal-form {
  display: grid;
}

.modal-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px;
}

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

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.field-action-row .compact {
  height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.modal-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  padding: 18px;
}

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

.modal-section h3 {
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
  margin: 0;
}

.modal-section-title {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.modal-section-title p {
  font-size: 12px;
  font-weight: 700;
  margin: 5px 0 0;
}

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

.opening-group-row {
  align-items: end;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 0.7fr) minmax(100px, 0.7fr) auto;
  padding: 12px;
}

.opening-group-row .compact {
  height: 36px;
}

.license-preview {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
  position: relative;
}

.license-preview img {
  display: block;
  max-height: 520px;
  object-fit: contain;
  width: 100%;
}

.upload-preview img {
  max-height: 360px;
}

.license-preview .license-preview-zoom {
  background: rgba(23, 32, 51, 0.78);
  border: 0;
  border-radius: 6px;
  bottom: 20px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 10px;
  position: absolute;
  right: 20px;
  text-decoration: none;
}

.license-preview .license-preview-zoom:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.license-preview-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 10px;
}

.license-preview-actions p {
  flex: 1 1 280px;
  margin: 0;
}

.selection-column {
  padding-left: 14px;
  padding-right: 8px;
  width: 44px;
}

.selection-column input[type="checkbox"] {
  accent-color: var(--brand);
  height: 18px;
  margin: 0;
  padding: 0;
  width: 18px;
}

.batch-progress-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.batch-progress-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 7px;
  padding: 10px 12px;
}

.batch-progress-item.done,
.batch-progress-item.ready,
.batch-progress-item.generated {
  border-color: #a9dfc2;
}

.batch-progress-item.error,
.batch-progress-item.failed {
  background: #fff8f7;
  border-color: #fda29b;
}

.batch-progress-head,
.batch-progress-copy {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.batch-progress-head strong {
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-progress-head span,
.batch-progress-copy {
  color: var(--muted);
  font-size: 12px;
}

.batch-progress-copy {
  align-items: flex-start;
  flex-wrap: wrap;
}

.batch-progress-copy small {
  color: #475467;
}

.progress-track {
  background: #e8eef6;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
  width: 100%;
}

.progress-track > span {
  background: var(--brand);
  display: block;
  height: 100%;
  transition: width 180ms ease;
}

.batch-progress-item.done .progress-track > span,
.batch-progress-item.ready .progress-track > span,
.batch-progress-item.generated .progress-track > span {
  background: var(--success);
}

.batch-progress-item.error .progress-track > span,
.batch-progress-item.failed .progress-track > span {
  background: var(--danger);
}

.license-batch-preview-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  max-height: min(64vh, 760px);
  overflow: auto;
  padding-right: 4px;
}

.license-batch-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.license-batch-card.ready,
.license-batch-card.done {
  border-color: #a9dfc2;
}

.license-batch-card.error {
  background: #fff8f7;
  border-color: #fda29b;
}

.license-batch-card-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.license-batch-card-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.license-batch-card-head strong {
  color: var(--ink);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.license-batch-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.license-batch-card-body {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.28fr);
}

.license-batch-image {
  align-self: stretch;
  min-height: 180px;
}

.license-batch-image img {
  height: 100%;
  max-height: 300px;
  min-height: 180px;
}

.license-batch-image-empty {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  min-height: 156px;
  place-items: center;
}

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

.license-batch-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.license-batch-field.wide {
  grid-column: 1 / -1;
}

.license-batch-field > span {
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.license-batch-field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.license-batch-postal-input {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.license-batch-postal-input .compact {
  min-height: 36px;
  white-space: nowrap;
}

.excel-duplicate-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.excel-duplicate-list li {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.excel-duplicate-list strong {
  color: var(--ink);
}

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

.check-field {
  align-items: center;
  display: flex;
  gap: 10px;
}

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

.check-field input {
  height: 18px;
  margin: 0;
  width: 18px;
}

.check-field span {
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.pill.default {
  background: #eef4ff;
  border-color: #c7d7fe;
  color: var(--brand-strong);
}

.modal-actions {
  background: #fbfdff;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
}

.image-lightbox {
  align-items: center;
  background: rgba(15, 23, 42, 0.84);
  display: grid;
  inset: 0;
  padding: 24px;
  position: fixed;
  z-index: 80;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox-panel {
  display: grid;
  justify-self: center;
  max-height: 96vh;
  place-items: center;
  position: relative;
  width: min(96vw, 1400px);
}

.image-lightbox-panel img {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  max-height: 92vh;
  max-width: 100%;
  object-fit: contain;
}

.image-lightbox-panel .icon-button {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 1;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 920px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .brand {
    min-height: auto;
  }

  .app-shell {
    margin-left: 0;
    padding: 16px;
  }

  .topbar,
  .section-head {
    align-items: start;
    display: grid;
  }

  .topbar-actions {
    justify-content: start;
  }

  .topbar-actions span {
    max-width: none;
    white-space: normal;
  }

  .section-head p {
    text-align: left;
  }

  .summary-grid,
  .toolbar-form,
  .toolbar-form.wide,
  .filter-bar,
  .report-toolbar,
  .modal-grid,
  .section-grid,
  .opening-group-row,
  .license-batch-card-body,
  .license-batch-fields {
    grid-template-columns: 1fr;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

/* Shared operations console theme */
body { font-size: 14px; }
.sidebar { width: 224px; color: var(--text); border-right: 1px solid var(--line); z-index: 20; }
.brand { border-color: var(--line); padding: 22px 20px; }
.brand strong { color: #16243b; font-size: 20px; letter-spacing: -.5px; }
.brand span, .sidebar-foot span { color: var(--muted); }
.brand .brand-mark { background: var(--brand); color: white; box-shadow: none; border-radius: 10px; display: inline-flex; font-size: 20px; margin: 0; }
.nav { gap: 12px; padding: 16px 12px; }
.nav-section-toggle { color: #475467; font-size: 14px; font-weight: 600; min-height: 32px; padding: 0 12px; }
.nav-section-toggle:hover { color: var(--text); background: #f5f7fa; }
.nav a { color: #475467; font-size: 14px; font-weight: 400; line-height: 20px; padding: 8px 14px 8px 22px; }
.nav a:hover { color: var(--brand); background: #f5f8ff; }
.nav a.active { background: #eaf2ff; color: #1859be; box-shadow: none; font-weight: 650; }
.nav a.active::before { background: var(--brand); left: 0; border-radius: 0 3px 3px 0; }
.sidebar-foot { border-color: var(--line); }
.app-shell { margin-left: 224px; padding: 0 28px 28px; }
.topbar { background: white; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; margin: 0 -28px 28px; padding: 20px 28px; gap: 20px; }
.topbar h1 { font-size: 21px; font-weight: 650; margin-top: 6px; }
.topbar .eyebrow { color: var(--muted); font-size: 12px; font-weight: 400; }
.topbar-actions { flex-wrap: wrap; gap: 8px; }
#lastUpdated { display: none; }
.band { box-shadow: none; border-color: #e5e8ee; }
.section-head { padding: 22px 24px; align-items: center; }
.section-head h2 { font-size: 18px; font-weight: 650; }
.section-head p { color: var(--muted); font-size: 13px; }
button { font-weight: 500; box-shadow: none; }
button:hover { box-shadow: none; }
button:focus-visible, a:focus-visible { outline: 3px solid #90baff; outline-offset: 3px; }
th { background: #f8f9fb; color: #667085; font-weight: 500; white-space: nowrap; }
td { line-height: 1.6; }
tbody tr:hover { background: #f8fbff; }
td small { display: block; margin-top: 4px; font-size: 12px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 20px 24px; }
.filter-bar label { display: grid; gap: 7px; min-width: 135px; flex: 1; }
.filter-bar label:first-child { min-width: 240px; flex: 2; }
.filter-bar label span { font-size: 12px; color: #667085; }
.status-explanation { padding: 0 24px 16px; margin: 0; font-size: 12px; }
.batch-table { min-width: 1060px; }
.batch-table td { max-width: 210px; }
#ams table { min-width: 1140px; table-layout: fixed; }
#ams th:nth-child(1) { width: 220px; }
#ams th:nth-child(2) { width: 84px; }
#ams th:nth-child(3) { width: 76px; }
#ams th:nth-child(4) { width: 200px; }
#ams th:nth-child(5) { width: 88px; }
#ams th:nth-child(6) { width: 230px; }
#ams th:nth-child(7) { width: 210px; }
#ams td { overflow-wrap: anywhere; padding: 14px 12px; }
#ams .token-code { white-space: nowrap; overflow: auto; max-width: 100%; font-size: 12px; }
#ams td:last-child .actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#ams td:last-child button { padding: 0 8px; min-height: 32px; white-space: nowrap; }
#ams td:nth-child(6) > span { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.license-table { table-layout: fixed; min-width: 1330px; }
.license-table th:nth-child(1) { width: 40px; }
.license-table th:nth-child(2) { width: 220px; }
.license-table th:nth-child(3) { width: 190px; }
.license-table th:nth-child(4) { width: 140px; }
.license-table th:nth-child(5) { width: 90px; }
.license-table th:nth-child(6), .license-table th:nth-child(7) { width: 84px; }
.license-table th:nth-child(8) { width: 96px; }
.license-table th:nth-child(9) { width: 170px; }
.license-table th:nth-child(10) { width: 190px; }
.license-table td { padding: 14px 12px; }
.license-table td:nth-child(5), .license-table td:nth-child(9) { white-space: nowrap; }
.license-table td:last-child .actions { display: flex; flex-wrap: nowrap; gap: 6px; }
.license-table td:last-child button { padding: 0 9px; min-height: 32px; white-space: nowrap; }
#ams th:last-child, #ams td:last-child, .license-table th:last-child, .license-table td:last-child { position: sticky; right: 0; background: white; box-shadow: -5px 0 8px #10182808; }
.batch-table th:last-child, .batch-table td:last-child { position: sticky; right: 0; background: #fff; box-shadow: -6px 0 10px #10182808; }
#batchFilters label { min-width: 112px; }
#batchFilters label:first-child { min-width: 200px; }
.pagination { padding: 16px 24px; display: flex; gap: 12px; align-items: center; justify-content: flex-end; border-top: 1px solid var(--line); }
.pagination > span:first-child { margin-right: auto; color: var(--muted); }
.pagination label { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.pagination select { width: 70px; }
.pill.available, .pill.approved { background: #ecfdf3; color: #067647; }
.pill.finished, .pill.filled { background: #eff6ff; color: #175cd3; }
.pill.failed { background: #fff1f0; color: #b42318; }
.pill.pending, .pill.skipped, .pill.disabled { background: #f2f4f7; color: #475467; }
.empty { text-align: center; padding: 56px 24px; color: #667085; }
.rule-url { max-width: 320px; overflow-wrap: anywhere; }
.rule-preview output { flex-basis: 100%; color: #344054; padding-top: 8px; }
#operationsDialog { width: min(1100px, calc(100vw - 48px)); max-height: calc(100vh - 64px); padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--text); box-shadow: 0 24px 80px #10182826; }
#operationsDialog::backdrop { background: #10182866; backdrop-filter: blur(2px); }
#operationsDialog[open] { animation: dialog-enter 140ms ease-out; }
#operationsDialog .modal-header { position: sticky; top: 0; background: white; z-index: 1; }
#operationsBody { padding: 24px; }
#operationsBody .modal-form { padding: 0; }
#operationError { color: var(--danger); }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; margin: 0 0 28px; }
.detail-grid > div { border-bottom: 1px solid #eef0f3; padding: 14px 0; }
.detail-grid dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 920px) {
  .sidebar { width: auto; position: static; border-right: 0; }
  .nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sidebar-foot { display: none; }
  .app-shell { margin-left: 0; padding: 0 16px 20px; }
  .topbar { margin: 0 -16px 16px; padding: 20px 16px; }
  .topbar-actions { justify-content: flex-start; }
  .pagination { flex-wrap: wrap; }
  .detail-grid { grid-template-columns: 1fr; }
  #operationsDialog { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  #operationsBody { padding: 16px; }
}
