.admin-dashboard {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.admin-dashboard .main-area {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.admin-dashboard .content-shell {
  width: 100%;
  max-width: none;
  height: auto;
  overflow: visible;
}

.admin-dashboard .store-switcher img {
  width: 156px;
  height: 66px;
  object-fit: contain;
  object-position: left center;
}

.admin-login-card,
.admin-upload-panel,
.admin-status-panel,
.admin-password-panel,
.admin-payment-panel,
.admin-invoice-panel,
.qr-panel,
.duplicate-review-panel {
  padding: 24px;
}

.admin-login-card {
  max-width: 520px;
}

.admin-login-card .eyebrow {
  font-weight: 600;
}

.admin-login-card h1 {
  font-weight: 600;
}

.admin-login-card label {
  font-weight: 500;
}

.admin-login-card .admin-primary-button {
  font-weight: 600;
}

.forgot-password-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.forgot-password-panel summary {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--brand-dark);
  background: #eef3f1;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.25;
  list-style: none;
}

.forgot-password-panel summary::-webkit-details-marker {
  display: none;
}

.forgot-password-panel[open] summary {
  background: var(--brand-soft);
}

.forgot-password-form {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfc;
}

.forgot-password-panel:not([open]) .forgot-password-form {
  display: none;
}

.forgot-password-form .admin-help {
  margin-bottom: 2px;
  font-size: 0.92rem;
}

.forgot-password-form .admin-link-button {
  width: 100%;
}

.admin-heading {
  align-items: center;
}

.admin-grid {
  grid-template-columns: minmax(360px, 0.95fr) minmax(430px, 1.05fr);
  align-items: start;
  gap: 24px;
}

.admin-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.admin-form input[type='password'],
.admin-form input[type='file'],
.admin-form input[type='text'],
.admin-form input[type='email'],
.admin-form input[type='url'],
.admin-form input[type='date'],
.admin-form input[type='number'],
.admin-form select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 12px;
  background: white;
  color: var(--ink);
}

.admin-form input[readonly] {
  background: #f3f6f5;
  color: var(--muted);
}

.admin-choice-group {
  display: grid;
  gap: 9px;
  margin: 4px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
}

.admin-choice-group legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-choice-group label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

.admin-choice-group input {
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
}

.security-rules {
  display: grid;
  gap: 8px;
  border: 1px solid #d5e5e1;
  border-radius: 8px;
  padding: 14px;
  background: #f7fbfa;
  color: var(--muted);
  line-height: 1.5;
}

.security-rules strong {
  color: var(--brand-dark);
  font-weight: 600;
}

.security-rules ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.security-rules li {
  transition: color 160ms ease;
}

.security-rules li.is-valid {
  color: #15803d;
}

.security-rules li.is-valid::marker {
  color: #15803d;
}

.password-input-row,
.password-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.password-input-row input {
  flex: 1 1 auto;
}

.password-actions {
  flex-wrap: wrap;
}

.admin-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.admin-primary-button,
.admin-link-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: white;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.admin-method-card .admin-primary-button {
  width: fit-content;
  min-width: 220px;
}

.admin-link-button.is-muted {
  background: #eef3f1;
  color: var(--brand-dark);
}

.admin-link-button.is-danger {
  background: #fff0ed;
  color: #9f321f;
}

.admin-primary-button:disabled,
.admin-link-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-alert {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 13px 15px;
  font-weight: 500;
}

.admin-alert.is-success {
  border: 1px solid #addfd8;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.admin-alert.is-error {
  border: 1px solid #f0b2a7;
  background: var(--coral-soft);
  color: #8f321f;
}

.admin-status-list {
  display: grid;
  gap: 18px;
  margin: 24px 0 0;
}

.admin-status-list div {
  display: grid;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.admin-status-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.admin-status-list dt {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.35;
}

.admin-status-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.45;
}

.admin-chip {
  display: inline-flex;
  margin: 0 6px 6px 0;
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.86rem;
}

.admin-chip.is-muted {
  background: #f3f6f5;
  color: var(--muted);
}

.admin-note-chip {
  display: inline-flex;
  margin: 0 6px 6px 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--gold-soft);
  color: #8a5a0b;
  font-size: 0.82rem;
  font-weight: 500;
}

.duplicate-review-panel {
  display: grid;
  gap: 22px;
}

.duplicate-toolbar,
.duplicate-group-heading,
.duplicate-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.duplicate-toolbar {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.duplicate-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.duplicate-groups {
  display: grid;
  gap: 18px;
}

.duplicate-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdfc;
}

.duplicate-group-heading {
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--brand-soft);
}

.duplicate-group-heading h3 {
  font-size: 1rem;
}

.duplicate-table-wrap {
  overflow: auto;
}

.duplicate-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.duplicate-table th,
.duplicate-table td {
  border-top: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

.duplicate-table th {
  color: var(--ink);
  background: white;
  font-weight: 600;
}

.duplicate-table td {
  color: var(--muted);
}

.duplicate-table td:nth-child(2) {
  color: var(--ink);
  font-weight: 500;
}

.duplicate-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-weight: 500;
}

.company-profile-panel,
.excel-template-panel,
.payment-demo-card,
.admin-payment-panel,
.admin-invoice-panel,
.qr-panel,
.super-admin-panel {
  padding: 24px;
}

.payment-demo-card {
  width: min(100%, 980px);
  padding: 34px 38px 36px;
}

.payment-demo-card .heading-copy {
  max-width: 820px;
  margin-bottom: 38px;
  line-height: 1.55;
}

.payment-demo-card .admin-status-list {
  max-width: 780px;
  margin-top: 0;
}

.payment-demo-card .admin-form {
  max-width: 780px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
}

.payment-demo-card .admin-primary-button,
.payment-demo-card .admin-link-button {
  flex: 0 0 auto;
  min-width: 220px;
  padding-inline: 22px;
}

.payment-demo-card .admin-primary-button {
  margin-top: 0;
}

.qr-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfc;
}

.qr-card img {
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: white;
}

.qr-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.qr-card .admin-help {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.company-profile-card,
.tenant-company {
  display: flex;
  align-items: center;
  gap: 14px;
}

.company-profile-card {
  margin-top: 18px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfc;
}

.company-profile-card img {
  width: 132px;
  height: 96px;
  object-fit: contain;
}

.company-profile-card div,
.tenant-company div {
  display: grid;
  gap: 4px;
}

.company-profile-card strong,
.tenant-company strong {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
}

.company-profile-card span,
.tenant-company span,
.tenant-company small,
.tenant-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.billing-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.84rem;
  font-weight: 600;
}

.billing-badge.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.billing-badge.is-warning {
  background: var(--gold-soft);
  color: #875d10;
}

.billing-badge.is-danger {
  background: var(--coral-soft);
  color: #9f321f;
}

.admin-payment-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 22px;
  margin-top: 22px;
}

.admin-method-card {
  display: grid;
  align-content: start;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #fbfdfc;
  box-shadow: 0 14px 30px rgba(12, 31, 43, 0.06);
}

.admin-method-card.is-stripe {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.admin-method-card.is-bank {
  background: linear-gradient(180deg, #ffffff 0%, #fbf9f2 100%);
}

.stripe-card-checkout-form {
  margin: 0;
}

.admin-method-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.payment-logo-icon {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: white;
}

.payment-logo-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stripe-icon {
  background: linear-gradient(135deg, #635bff, #12b8ff);
}

.bank-icon {
  background: linear-gradient(135deg, #275d5f, #c5922f);
}

.admin-method-card h3 {
  margin: 2px 0 7px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.stats-shell {
  display: grid;
  gap: 22px;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stats-metric {
  min-height: 138px;
  display: grid;
  align-content: space-between;
  padding: 24px;
}

.stats-metric span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
}

.stats-metric strong {
  color: var(--ink);
  font-size: clamp(2.15rem, 4vw, 3.4rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
}

.stats-metric strong.is-date {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.2;
}

.stats-panel {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.stats-panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.stats-panel-heading h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
}

.stats-panel-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.stats-list {
  display: grid;
  gap: 14px;
}

.stats-list.is-compact {
  max-width: 980px;
}

.stats-row {
  display: grid;
  grid-template-columns: minmax(190px, 300px) minmax(160px, 1fr) minmax(46px, auto);
  align-items: center;
  gap: 18px;
}

.stats-label {
  min-width: 0;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stats-bar-track {
  height: 26px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: #eef4f1;
}

.stats-bar-fill {
  height: 100%;
  min-width: 0;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f8f2f, #75a84c);
  transition: width 240ms ease;
}

.stats-row.tone-1 .stats-bar-fill {
  background: linear-gradient(90deg, #3c78a2, #5e97ba);
}

.stats-row.tone-2 .stats-bar-fill {
  background: linear-gradient(90deg, #b7791f, #d9a13d);
}

.stats-row.tone-3 .stats-bar-fill {
  background: linear-gradient(90deg, #2f766e, #52a39a);
}

.stats-row.tone-4 .stats-bar-fill {
  background: linear-gradient(90deg, #8a4f7d, #b978a6);
}

.stats-row.tone-5 .stats-bar-fill {
  background: linear-gradient(90deg, #a24e35, #d0775c);
}

.stats-count {
  color: var(--muted);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
}

.admin-method-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-method-status {
  width: fit-content;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff4e6;
  color: #9a5c0b;
  font-size: 0.84rem;
  font-weight: 600;
}

.bank-highlight {
  display: grid;
  gap: 6px;
  border: 1px solid #d7e3df;
  border-radius: 8px;
  padding: 14px 16px;
  background: white;
}

.bank-highlight small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bank-highlight strong {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-bank-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.admin-bank-details div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.admin-bank-details dt {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.admin-bank-details dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-weight: 500;
}

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

.admin-bank-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.admin-method-card .admin-bank-details-button,
.bank-details-pill {
  justify-self: start;
  width: auto;
  min-width: 190px;
  max-width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #c9d3d0;
  border-radius: 999px;
  padding: 12px 24px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(12, 31, 43, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.admin-method-card .admin-bank-details-button:hover,
.admin-method-card .admin-bank-details-button:focus-visible,
.bank-details-pill:hover,
.bank-details-pill:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 14px 30px rgba(23, 111, 102, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.admin-method-card .admin-bank-details-button svg,
.bank-details-pill svg {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 90;
  display: none !important;
  place-items: center !important;
  padding: 22px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(7px);
}

.admin-modal-backdrop.is-open {
  display: grid !important;
}

.admin-modal-card {
  width: min(680px, 100%) !important;
  max-height: min(760px, 92vh);
  overflow: hidden;
  border: 1px solid rgba(221, 231, 228, 0.92);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(12, 31, 43, 0.24);
}

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

.admin-modal-head h2 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
  font-weight: 500;
}

.admin-modal-body {
  display: grid;
  gap: 16px;
  overflow: auto;
  max-height: calc(min(760px, 92vh) - 106px);
  padding: 24px 26px 26px;
}

.admin-invoice-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-invoice-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.admin-wide-field,
.admin-form-footer {
  grid-column: 1 / -1;
}

.admin-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
}

.excel-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 18px 0;
}

.excel-rules span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfc;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
}

.excel-template-panel {
  grid-column: 1 / -1;
}

.excel-guide-title .admin-help {
  margin-top: 8px;
  max-width: 900px;
}

.excel-guide-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.excel-step-card,
.excel-rule-card,
.excel-symbol-guide div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.excel-step-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.excel-step-card span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.excel-step-card strong,
.excel-rule-card strong,
.excel-symbol-guide strong {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
}

.excel-step-card p,
.excel-rule-card span,
.excel-symbol-guide span {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.excel-column-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.excel-rule-card {
  display: grid;
  gap: 7px;
  padding: 15px;
  border-top: 4px solid var(--brand);
}

.excel-rule-card small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.excel-rule-card.is-product {
  border-top-color: var(--brand);
}

.excel-rule-card.is-allergen {
  border-top-color: #c9573a;
}

.excel-rule-card.is-description {
  border-top-color: #c5932d;
}

.excel-rule-card.is-ingredients {
  border-top-color: #4a7f91;
}

.excel-symbol-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.excel-symbol-guide div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.excel-symbol-guide strong {
  min-width: 70px;
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  text-align: center;
}

.company-profile-panel .admin-primary-button {
  margin-top: 18px;
}

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

.tenant-table-wrap {
  overflow: auto;
}

.tenant-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
}

.tenant-table th,
.tenant-table td {
  border-top: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
}

.tenant-table th {
  color: var(--ink);
  font-weight: 600;
}

.tenant-company img {
  width: 116px;
  height: 82px;
  object-fit: contain;
}

.tenant-initial {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 1.05rem;
  font-weight: 600;
  flex: 0 0 auto;
}

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

.portal-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  align-items: start;
  gap: 24px;
}

.portal-clients-panel,
.portal-editor-panel,
.portal-setup-card {
  padding: 24px;
}

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

.portal-app-badges,
.portal-table-actions,
.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-table-actions form {
  margin: 0;
}

.portal-form {
  margin-top: 18px;
}

.portal-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.portal-form label > span {
  line-height: 1.35;
}

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

.portal-dashboard .sidebar-brand {
  background: #fff;
  min-height: 178px;
  padding: 12px 10px;
}

.portal-dashboard .sidebar-brand img {
  width: 278px;
  max-height: 164px;
  object-position: center;
}

.portal-dashboard .store-switcher img {
  width: 158px;
  height: 76px;
  object-fit: contain;
}

.portal-dashboard .portal-topbar {
  justify-content: flex-end;
}

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

.portal-logo-field {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
}

.portal-logo-field small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.portal-file-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.portal-selected-file {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.portal-section-title {
  margin-top: 12px;
}

.portal-section-title h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 600;
}

.portal-app-list {
  display: grid;
  gap: 10px;
}

.portal-app-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 132px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfc;
  color: var(--ink);
}

.portal-app-list input[type='checkbox'] {
  width: 18px;
  height: 18px;
  min-height: auto;
}

.portal-actions {
  margin-top: 8px;
}

.portal-users-page {
  padding: 24px;
}

.portal-users-grid {
  display: grid;
  gap: 16px;
}

.portal-users-client-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.portal-users-client-head,
.portal-user-item,
.portal-user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-users-client-head {
  justify-content: space-between;
}

.portal-user-list {
  display: grid;
  gap: 8px;
}

.portal-user-item {
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fbfa;
}

.portal-user-item div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-user-item strong,
.portal-user-item span,
.portal-user-item small {
  overflow-wrap: anywhere;
}

.portal-user-item span,
.portal-user-item small {
  color: var(--muted);
}

.portal-user-inline-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.portal-user-inline-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.portal-setup-list {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.portal-setup-list code {
  color: var(--ink);
}

.portal-dashboard {
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.portal-dashboard h1,
.portal-dashboard h2,
.portal-dashboard h3,
.portal-dashboard strong {
  font-weight: 600;
}

.portal-dashboard p,
.portal-dashboard span,
.portal-dashboard small,
.portal-dashboard td,
.portal-dashboard dd,
.portal-dashboard li,
.portal-dashboard input,
.portal-dashboard select,
.portal-dashboard button {
  font-weight: 400;
}

.portal-dashboard .eyebrow,
.portal-dashboard .admin-primary-button,
.portal-dashboard .admin-link-button,
.portal-dashboard .billing-badge,
.portal-dashboard .admin-chip,
.portal-dashboard .tenant-company strong,
.portal-dashboard .portal-table th,
.portal-dashboard label > span {
  font-weight: 500;
}

.portal-checkbox-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
}

.portal-checkbox-line input {
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
}

.duplicate-check input {
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
}

.admin-dashboard {
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}

.admin-dashboard h1,
.admin-dashboard h2,
.admin-dashboard h3,
.admin-dashboard strong {
  font-weight: 600;
  letter-spacing: 0;
}

.admin-dashboard .eyebrow {
  font-weight: 600;
  letter-spacing: 0.08em;
}

.admin-dashboard .heading-copy,
.admin-dashboard .admin-help,
.admin-dashboard p,
.admin-dashboard span,
.admin-dashboard dd,
.admin-dashboard li {
  font-weight: 400;
}

.admin-form label,
.admin-choice-group label,
.duplicate-check {
  font-weight: 500;
}

.admin-primary-button,
.admin-link-button,
.admin-login-card .admin-primary-button,
.billing-badge {
  font-weight: 500;
}

.admin-alert {
  font-weight: 400;
}

.password-expiry-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(8px);
}

.password-expiry-dialog {
  width: min(100%, 500px);
  border: 1px solid rgba(221, 231, 228, 0.92);
  border-radius: 14px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 70px rgba(12, 31, 43, 0.22);
}

.password-expiry-dialog h2 {
  margin: 6px 0 12px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.2;
}

.password-expiry-dialog p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.password-expiry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.password-expiry-actions .admin-primary-button,
.password-expiry-actions .admin-link-button {
  min-width: 150px;
}

@media (max-width: 980px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .excel-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-payment-methods,
  .excel-guide-steps,
  .excel-column-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-user-inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-summary-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: minmax(150px, 240px) minmax(140px, 1fr) minmax(42px, auto);
  }
}

@media (max-width: 620px) {
  .admin-login-card,
  .admin-upload-panel,
  .admin-status-panel,
  .admin-password-panel,
  .admin-payment-panel,
  .admin-invoice-panel,
  .qr-panel,
  .duplicate-review-panel {
    padding: 16px;
  }

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

  .qr-card img {
    width: 150px;
    height: 150px;
  }

  .payment-demo-card {
    padding: 20px 16px;
  }

  .payment-demo-card .admin-form {
    display: grid;
  }

  .payment-demo-card .admin-primary-button,
  .payment-demo-card .admin-link-button {
    width: 100%;
    min-width: 0;
  }

  .excel-rules {
    grid-template-columns: 1fr;
  }

  .admin-payment-methods,
  .admin-invoice-form,
  .excel-guide-steps,
  .excel-column-map,
  .excel-symbol-guide {
    grid-template-columns: 1fr;
  }

  .admin-bank-details div {
    grid-template-columns: 1fr;
  }

  .admin-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-form-grid,
  .portal-app-list label,
  .portal-user-inline-form,
  .portal-file-line {
    grid-template-columns: 1fr;
  }

  .portal-logo-field {
    grid-template-columns: 1fr;
  }

  .portal-users-client-head,
  .portal-user-item,
  .portal-user-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-selected-file {
    width: 100%;
    white-space: normal;
  }

  .duplicate-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .duplicate-actions {
    justify-content: flex-start;
  }

  .password-expiry-backdrop {
    align-items: end;
    padding: 12px;
  }

  .password-expiry-dialog {
    padding: 22px;
    border-radius: 12px;
  }

  .password-expiry-actions {
    display: grid;
  }

  .admin-dashboard .topbar-actions {
    gap: 8px;
  }

  .admin-link-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.84rem;
  }

  .stats-panel,
  .stats-metric {
    padding: 18px;
  }

  .stats-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-row {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
  }

  .stats-bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 22px;
  }

  .stats-count {
    align-self: start;
  }
}
