:root {
  color-scheme: light;
  --ink: #14211b;
  --muted: #5e6b63;
  --line: #d8e1da;
  --surface: #ffffff;
  --accent: #0b6b4d;
  --accent-strong: #084a39;
  --danger: #a33a2b;
  --success: #12623d;
  --warning: #8a4f00;
  --warning-bg: #fff7e8;
  --danger-bg: #fff1ee;
  --success-bg: #edf8f1;
  --panel-shadow: 0 14px 38px rgba(20, 33, 27, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #edf1ee;
  color: var(--ink);
}

.portal-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.portal-panel {
  width: min(100%, 420px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(20, 33, 27, 0.12);
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #dbe9df;
  color: var(--accent-strong);
  font-weight: 800;
}

h1 {
  margin: 22px 0 8px;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0;
}

p {
  margin: 0;
}

#lead {
  color: var(--muted);
  line-height: 1.45;
}

.portal-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  padding: 4px;
}

.switcher-button {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
}

.switcher-button.active {
  background: var(--accent);
  color: #fff;
}

.voucher-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

label {
  font-size: 0.9rem;
  font-weight: 700;
}

input,
button,
select,
.primary-link-button {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  font: inherit;
}

input,
select {
  border: 1px solid var(--line);
  padding: 0 14px;
  background: #fbfdfb;
  color: var(--ink);
}

#voucher-code {
  font-size: 1.4rem;
  letter-spacing: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.primary-link-button {
  display: grid;
  place-items: center;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

.danger-button {
  color: var(--danger);
}

.message {
  min-height: 22px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.35;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  transform: translateY(-8px) scale(0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(20, 33, 27, 0.16);
  padding: 12px 14px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.32;
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.toast.success {
  border-color: rgba(18, 98, 61, 0.25);
  background: #edf8f1;
  color: var(--success);
}

.toast.error {
  border-color: rgba(163, 58, 43, 0.24);
  background: #fff1ee;
  color: var(--danger);
}

.toast.info {
  border-color: #cbdad1;
  background: #f7fbf8;
  color: var(--accent-strong);
}

.meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.meta.warning {
  color: #7c4f00;
}

.usage-status,
.saved-voucher,
.paid-vouchers,
.ticket-receipt {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.section-heading h2,
.saved-voucher h2,
.paid-vouchers h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.section-heading .secondary-button {
  width: auto;
  min-height: 34px;
  margin-top: 0;
  padding: 0 12px;
}

.status-summary {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.status-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.status-actions .secondary-button {
  margin-top: 0;
}

.portal-notifications {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.portal-notification {
  border: 1px solid #cbdad1;
  border-radius: 8px;
  background: #f7fbf8;
  padding: 10px 12px;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.portal-notification.success {
  border-color: rgba(18, 98, 61, 0.25);
  background: #edf8f1;
  color: var(--success);
}

.queue-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.queued-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.queued-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.queued-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.queued-item span {
  min-width: 0;
}

.queued-item .compact-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.78rem;
}

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

.queue-actions {
  margin-top: 12px;
}

.queue-actions .secondary-button,
.button-row .secondary-button {
  margin-top: 0;
}

.payment-packages,
.ticket-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.browser-handoff-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.payment-launcher,
.payment-package {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
}

.payment-launcher button,
.payment-launcher .primary-link-button {
  margin-top: 0;
}

.payment-package strong,
.ticket-card strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
}

.payment-package span,
.payment-package small,
.ticket-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.payment-package-actions {
  display: grid;
  grid-template-columns: auto 64px auto auto;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

.payment-package-actions label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.payment-package-actions input {
  min-height: 34px;
  margin: 0;
  padding: 0 8px;
  text-align: center;
}

.payment-package-actions b {
  color: var(--accent-strong);
  font-size: 0.9rem;
  white-space: nowrap;
}

.payment-package-actions button {
  min-width: 134px;
  min-height: 34px;
  margin-top: 0;
  padding: 0 12px;
  font-size: 0.78rem;
}

.payment-panel {
  max-width: 720px;
}

.payment-mock {
  margin-top: 16px;
}

.pending-payment-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.checkout-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px;
}

.checkout-card a {
  min-width: 0;
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.checkout-card .checkout-status-link {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

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

.ticket-card strong {
  color: var(--accent-strong);
  font-size: 1.8rem;
  letter-spacing: 0;
}

.hidden {
  display: none;
}

.admin-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.admin-header,
.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-header {
  min-height: 74px;
  border-bottom: 1px solid rgba(216, 225, 218, 0.9);
  padding-bottom: 18px;
}

.admin-header h1 {
  margin: 4px 0 0;
}

.admin-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 -8px;
  padding: 12px 8px;
  background: rgba(237, 241, 238, 0.94);
  backdrop-filter: blur(14px);
  overflow-x: auto;
}

.admin-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.admin-nav a:hover,
.admin-nav a:focus-visible {
  border-color: var(--line);
  background: #fff;
  color: var(--accent-strong);
  outline: none;
}

.operations-overview,
.operations-section {
  margin-top: 18px;
}

.operations-overview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--panel-shadow);
  padding: 18px;
}

.overview-heading,
.section-title,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.overview-heading h2,
.section-title h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.overview-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.overview-stat {
  display: grid;
  gap: 6px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 13px;
}

.overview-stat span,
.overview-stat small,
.panel-head a {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
}

.overview-stat strong {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.overview-stat.success {
  border-color: rgba(18, 98, 61, 0.26);
  background: var(--success-bg);
}

.overview-stat.warning {
  border-color: #e4b25d;
  background: var(--warning-bg);
}

.overview-stat.danger {
  border-color: rgba(163, 58, 43, 0.28);
  background: var(--danger-bg);
}

.overview-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 12px;
  margin-top: 12px;
}

.overview-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
}

.panel-head {
  align-items: center;
  margin-bottom: 10px;
}

.panel-head h3 {
  margin: 0;
  font-size: 0.98rem;
}

.panel-head a {
  color: var(--accent);
  text-decoration: none;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.operational-agenda,
.recent-login-list {
  display: grid;
  gap: 8px;
}

.agenda-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
  color: var(--ink);
  text-decoration: none;
}

.agenda-item:hover,
.agenda-item:focus-visible {
  border-color: #9fcfb9;
  outline: none;
}

.agenda-item span,
.recent-login-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agenda-item strong,
.recent-login-row strong {
  font-size: 0.88rem;
}

.agenda-item small,
.recent-login-row small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.agenda-item b {
  border-radius: 7px;
  background: #eef5f0;
  padding: 7px 9px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.agenda-item.warning {
  border-color: #e4b25d;
  background: var(--warning-bg);
}

.agenda-item.danger {
  border-color: rgba(163, 58, 43, 0.28);
  background: var(--danger-bg);
}

.agenda-item.success {
  border-color: rgba(18, 98, 61, 0.22);
  background: var(--success-bg);
}

.recent-login-row {
  border-bottom: 1px solid var(--line);
  padding: 0 0 8px;
}

.recent-login-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.section-title {
  margin-bottom: 12px;
}

.table-heading button {
  width: auto;
  min-height: 36px;
  padding: 0 14px;
}

.table-actions {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.table-actions input,
.table-actions select {
  width: auto;
  min-width: 150px;
  min-height: 36px;
}

.search-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.search-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-field input {
  min-height: 38px;
  padding: 0 12px;
}

.compact-search {
  width: min(260px, 100%);
  margin-bottom: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.export-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.header-select {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.header-select select {
  width: auto;
  min-width: 150px;
  min-height: 34px;
  padding: 0 32px 0 10px;
}

.user-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.compact-button {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
}

.payment-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.payment-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px 12px;
}

.payment-summary-card strong,
.payment-summary-card span {
  display: block;
}

.payment-summary-card strong {
  color: var(--accent-strong);
  font-size: 1.2rem;
}

.payment-summary-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-table-actions {
  margin: 12px 0;
}

.table-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#print-latest-button {
  min-width: 172px;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.tool-panel,
.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--panel-shadow);
  padding: 18px;
}

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

.field-grid label {
  display: grid;
  gap: 6px;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

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

.form-warning {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid #e4b25d;
  border-radius: 8px;
  background: #fff9ed;
  padding: 10px 12px;
  color: #7a4a00;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.create-voucher-preview {
  margin: 16px 0;
}

.create-voucher-preview h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.voucher-print-preview .print-voucher-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 18px;
  color: var(--ink);
  text-align: center;
}

.voucher-print-preview .print-voucher-logo {
  display: block;
  max-width: 150px;
  max-height: 54px;
  margin: 0 auto 14px;
  object-fit: contain;
}

.voucher-print-preview .print-voucher-code {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.voucher-print-preview .print-voucher-type {
  margin-top: 14px;
  font-size: 0.84rem;
  font-weight: 800;
}

.voucher-print-preview .print-voucher-rules {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.voucher-print-preview .print-voucher-price {
  margin-top: 8px;
  font-size: 0.86rem;
  font-weight: 800;
}

.user-form,
.local-user-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  align-items: start;
}

.user-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.local-user-form {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.local-user-form button {
  min-height: 42px;
}

.manager-portal-access {
  grid-column: span 2;
}

.manager-portal-access small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.user-form select[multiple] {
  min-height: 112px;
  padding: 8px 10px;
}

.user-form button {
  min-height: 42px;
  align-self: end;
}

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

.mini-form {
  display: grid;
  grid-template-columns: 1fr 140px 140px;
  gap: 10px;
}

.mini-form button {
  grid-column: 1 / -1;
}

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

.ssid-binding-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ssid-binding-form label input,
.ssid-binding-form label select {
  width: 100%;
}

.ssid-binding-context,
.binding-actions {
  grid-column: 1 / -1;
}

.ssid-binding-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.binding-context-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px;
  min-height: 86px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.binding-context-card span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.binding-context-card strong {
  font-size: 0.88rem;
  line-height: 1.25;
}

.binding-context-card small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.binding-context-card.success {
  border-color: #9fcfb9;
  background: #f2fbf6;
}

.binding-context-card.warning {
  border-color: #e4b25d;
  background: #fff9ed;
}

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

.binding-actions button {
  width: auto;
}

.ssid-binding-list {
  display: grid;
  gap: 12px;
  max-height: 460px;
  overflow-y: auto;
  margin-top: 16px;
}

.controller-site-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
}

.controller-site-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.controller-site-card header div {
  display: grid;
  gap: 3px;
}

.controller-site-card header small,
.controller-portal-strip small,
.ssid-binding-row small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.site-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.site-status.success {
  border-color: #9fcfb9;
  color: #0b6b4d;
  background: #f2fbf6;
}

.site-status.warning {
  border-color: #e4b25d;
  color: #8a4f00;
  background: #fff9ed;
}

.controller-portal-strip {
  display: grid;
  gap: 6px;
}

.controller-portal-strip > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.controller-portal-strip > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.controller-portal-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
}

.controller-portal-badge small {
  margin-left: 4px;
}

.controller-ssid-list {
  display: grid;
  gap: 8px;
}

.ssid-binding-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) repeat(3, minmax(110px, 1fr));
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.ssid-binding-row:hover {
  border-color: #9fcfb9;
  background: #f7fcf9;
}

.ssid-binding-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ssid-binding-row b {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.ssid-binding-row.warning {
  border-color: #e4b25d;
  background: #fff9ed;
}

.ssid-binding-row em {
  color: #8a4f00;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
  grid-column: 1 / -1;
}

.profile-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.profile-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px 12px;
  font-size: 0.86rem;
}

.profile-main {
  display: grid;
  gap: 2px;
}

.profile-main small {
  color: var(--muted);
  font-size: 0.72rem;
}

.integration-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
  margin-top: 12px;
}

.integration-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
}

.integration-card.warning {
  border-color: #e4b25d;
  background: #fff9ed;
}

.integration-card.success {
  border-color: rgba(18, 98, 61, 0.28);
  background: #f1faf4;
}

.integration-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.integration-card-head strong {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.64rem;
}

.integration-card h3 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.2;
}

.integration-card p,
.integration-card small,
.integration-card li {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.integration-card small {
  font-weight: 800;
}

.integration-card ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 16px;
}

.integration-checklist {
  display: grid;
  gap: 5px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.integration-checklist li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  padding: 7px 8px;
}

.integration-checklist li.needed {
  border-color: rgba(174, 91, 0, 0.28);
  background: #fffaf1;
}

.integration-checklist li.ready {
  border-color: rgba(18, 98, 61, 0.18);
}

.integration-checklist span,
.integration-checklist strong {
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.integration-checklist strong {
  color: var(--muted);
}

.integration-checklist small {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.tool-panel h2,
.table-panel h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
}

.batch-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.batch-heading h2 {
  margin-bottom: 4px;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.batch-browser {
  display: grid;
  gap: 14px;
}

.batch-list-wrap,
.batch-detail {
  min-width: 0;
}

.batch-list-header {
  display: grid;
  grid-template-columns: 1fr 126px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 0 8px 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.batch-list {
  display: grid;
  max-height: 184px;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
}

.batch-list.empty {
  display: block;
  border-bottom: 0;
  padding: 10px 0;
}

.batch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 8px;
  text-align: left;
}

.batch-row:hover,
.batch-row.selected {
  background: #f2f7f4;
}

.batch-row strong,
.batch-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-row strong {
  font-size: 0.9rem;
}

.batch-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.batch-count {
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.batch-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px 12px;
}

.batch-summary strong,
.batch-summary span {
  display: block;
}

.batch-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.compact-table-scroll {
  max-height: 320px;
  margin-top: 10px;
}

.compact-table {
  font-size: 0.78rem;
}

.compact-table th,
.compact-table td {
  padding: 8px 7px;
}

.audit-table tr.audit-warn td {
  background: var(--warning-bg);
}

.audit-table tr.audit-error td {
  background: var(--danger-bg);
}

.code-cell {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  font-weight: 800;
}

.digital-code {
  display: inline-flex;
  align-items: center;
  gap: 0.08em;
  line-height: 1;
  vertical-align: middle;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.digital-code-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.digital-digit-svg {
  display: inline-block;
  width: 0.62em;
  height: 1.06em;
  flex: 0 0 auto;
  overflow: visible;
}

.digital-svg-segment {
  fill: currentColor;
  opacity: 0.13;
}

.digital-svg-segment.is-active {
  opacity: 1;
}

.digital-digit {
  position: relative;
  display: inline-block;
  width: 0.62em;
  height: 1.06em;
  flex: 0 0 auto;
}

.digital-segment {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.13;
}

.segment-a,
.segment-d,
.segment-g {
  left: 0.12em;
  right: 0.12em;
  height: 0.1em;
}

.segment-a {
  top: 0;
}

.segment-g {
  top: 0.48em;
}

.segment-d {
  bottom: 0;
}

.segment-b,
.segment-c,
.segment-e,
.segment-f {
  width: 0.1em;
  height: 0.42em;
}

.segment-b,
.segment-c {
  right: 0;
}

.segment-e,
.segment-f {
  left: 0;
}

.segment-b,
.segment-f {
  top: 0.08em;
}

.segment-c,
.segment-e {
  bottom: 0.08em;
}

.digit-0 .segment-a,
.digit-0 .segment-b,
.digit-0 .segment-c,
.digit-0 .segment-d,
.digit-0 .segment-e,
.digit-0 .segment-f,
.digit-1 .segment-b,
.digit-1 .segment-c,
.digit-2 .segment-a,
.digit-2 .segment-b,
.digit-2 .segment-d,
.digit-2 .segment-e,
.digit-2 .segment-g,
.digit-3 .segment-a,
.digit-3 .segment-b,
.digit-3 .segment-c,
.digit-3 .segment-d,
.digit-3 .segment-g,
.digit-4 .segment-b,
.digit-4 .segment-c,
.digit-4 .segment-f,
.digit-4 .segment-g,
.digit-5 .segment-a,
.digit-5 .segment-c,
.digit-5 .segment-d,
.digit-5 .segment-f,
.digit-5 .segment-g,
.digit-6 .segment-a,
.digit-6 .segment-c,
.digit-6 .segment-d,
.digit-6 .segment-e,
.digit-6 .segment-f,
.digit-6 .segment-g,
.digit-7 .segment-a,
.digit-7 .segment-b,
.digit-7 .segment-c,
.digit-8 .segment-a,
.digit-8 .segment-b,
.digit-8 .segment-c,
.digit-8 .segment-d,
.digit-8 .segment-e,
.digit-8 .segment-f,
.digit-8 .segment-g,
.digit-9 .segment-a,
.digit-9 .segment-b,
.digit-9 .segment-c,
.digit-9 .segment-d,
.digit-9 .segment-f,
.digit-9 .segment-g {
  opacity: 1;
}

.voucher-logo-panel label {
  display: grid;
  gap: 8px;
}

.voucher-logo-preview-wrap {
  display: grid;
  min-height: 84px;
  margin: 12px 0;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.voucher-logo-preview {
  max-width: min(100%, 220px);
  max-height: 72px;
  object-fit: contain;
}

.print-area {
  display: none;
}

.table-panel {
  margin-top: 16px;
}

.table-scroll {
  overflow-x: auto;
}

.login-chart {
  width: 100%;
  height: 260px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

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

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

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

.empty,
.empty-cell {
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 33, 27, 0.46);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(100%, 380px);
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(20, 33, 27, 0.2);
}

.modal-panel h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

#mode-lead {
  color: var(--muted);
  line-height: 1.4;
}

.mode-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 980px) {
  .overview-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-panels,
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .portal-shell {
    align-items: stretch;
    padding: 14px;
  }

  .portal-panel {
    align-self: center;
    padding: 22px;
  }

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

  .queue-actions,
  .button-row,
  .payment-package,
  .payment-package-actions,
  .checkout-card {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    padding: 14px;
  }

  .admin-header,
  .table-heading,
  .batch-heading,
  .overview-heading,
  .section-title,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-status-grid,
  .overview-panels,
  .payment-summary-grid {
    grid-template-columns: 1fr;
  }

  .overview-stat {
    min-height: 98px;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .compact-button {
    width: 100%;
  }

  .tool-grid,
  .field-grid,
  .user-form,
  .ssid-binding-form,
  .ssid-binding-context,
  .ssid-binding-row,
  .integration-status-grid,
  .mini-form {
    grid-template-columns: 1fr;
  }

  .field-span,
  .manager-portal-access {
    grid-column: auto;
  }

}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  html,
  body {
    width: 297mm;
    min-height: 210mm;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  body {
    background: #fff;
  }

  .admin-shell,
  .portal-shell,
  .modal {
    display: none !important;
  }

  body.print-payment-receipt .portal-shell {
    display: flex !important;
    width: 100%;
    min-height: auto;
    padding: 8mm;
  }

  body.print-payment-receipt .portal-panel {
    box-shadow: none;
    width: 100%;
  }

  body.print-payment-receipt .button-row,
  body.print-payment-receipt #payment-message,
  body.print-payment-receipt .brand-mark {
    display: none !important;
  }

  .print-area {
    display: block;
    width: 297mm;
    margin: 0;
    padding: 0;
  }

  .print-batch-title {
    display: none;
  }

  .print-voucher-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 21mm;
    gap: 0;
    width: 297mm;
    margin: 0;
  }

  .print-voucher-card {
    display: grid;
    align-content: center;
    justify-items: center;
    height: 21mm;
    min-height: 0;
    break-inside: avoid;
    overflow: hidden;
    border: 0 solid #222;
    border-right-width: 0.25mm;
    border-bottom-width: 0.25mm;
    border-radius: 0;
    padding: 1.3mm 1.6mm;
    text-align: center;
    color: #111;
  }

  .print-voucher-logo {
    display: block;
    max-width: 19mm;
    max-height: 5mm;
    margin: 0 auto 0.6mm;
    object-fit: contain;
  }

  .print-voucher-code {
    font-size: 13.5pt;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
  }

  .print-voucher-code .digital-code {
    justify-content: center;
  }

  .print-voucher-code .digital-svg-segment {
    opacity: 0;
  }

  .print-voucher-code .digital-svg-segment.is-active {
    opacity: 1;
  }

  .print-voucher-type {
    margin-top: 0.9mm;
    font-size: 5.8pt;
    font-weight: 800;
    line-height: 1.05;
  }

  .print-voucher-rules {
    margin-top: 0.45mm;
    font-size: 5.1pt;
    line-height: 1.12;
  }

  .print-voucher-price {
    margin-top: 0.45mm;
    font-size: 5.4pt;
    font-weight: 800;
    line-height: 1;
  }
}
