:root {
  --color-bg: #edf2f7;
  --color-surface: #ffffff;
  --color-surface-muted: #f5f6fb;
  --color-border: #dde3f0;
  --color-muted: #6b7280;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-accent: #0ea5e9;
  --color-danger: #dc2626;
  --color-success: #16a34a;
  --color-sidebar: #101828;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 60%)
      fixed,
    var(--color-bg);
  color: #0f172a;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

body.sidebar-open {
  overflow: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

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

.portal-shell {
  min-height: 100vh;
  background: var(--color-bg);
  display: flex;
}

.sidebar {
  width: 260px;
  background: var(--color-sidebar);
  color: #f8fafc;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: fixed;
  inset: 0 auto 0 0;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1200;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-symbol {
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.brand-label {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}

.brand-merchant {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 0.8rem;
  color: #e5e7eb;
  font-weight: 500;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-link span {
  flex: 1;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(14, 165, 233, 0.35));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.9rem;
  color: rgba(248, 250, 252, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-footer .language-switcher {
  margin: 0.35rem 0 0.2rem;
}

.language-switcher select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-size: 0.85rem;
}

.sidebar-user {
  margin: 0;
  font-weight: 600;
}

.sidebar-email {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.65);
}

.text-link {
  color: var(--color-accent);
  font-weight: 600;
}

.table-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

.cell-primary {
  font-weight: 600;
  color: #0f172a;
}

.cell-subtle {
  display: block;
  margin-top: 0.2rem;
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.table-subline {
  margin-top: 0.25rem;
  font-size: 1rem;
  color: var(--color-muted);
}

.table-subline-all {
  color: var(--color-muted);
  font-weight: 400;
}

.legend-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--color-surface-muted);
}

.legend-item-all {
  color: #475569;
  font-weight: 600;
}

.legend-item-limited {
  color: #475569;
  font-weight: 600;
}

.row-highlight td {
  background: rgba(37, 99, 235, 0.12);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1100;
}

body.sidebar-open .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
}

.app-surface {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin-left: 0;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 1.15rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-meta {
  flex: 1;
}

.top-bar-meta h1 {
  margin: 0;
  font-size: 1.2rem;
}

.top-bar-info {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
  text-align: right;
  font-size: 0.95rem;
}

.top-bar-lang {
  display: inline-flex;
  gap: 0.35rem;
  margin-left: 0.4rem;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: #fff;
  text-decoration: none;
}

.lang-pill.active {
  border-color: rgba(37, 99, 235, 0.4);
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
}

.top-bar-data {
  font-weight: 600;
}

.top-bar-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary-dark);
  background: rgba(37, 99, 235, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.mobile-nav-toggle {
  width: 44px;
  height: 44px;
  border-radius: 0.9rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
}

.mobile-nav-toggle span {
  width: 18px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
}

.content {
  flex: 1;
  padding: 1.5rem;
}

.content-inner {
  width: min(100%, 70rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.content-inner-wide {
  width: min(100%, 96rem);
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.section-heading h3 {
  margin: 0;
}

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

.section-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.section-actions-wide {
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.section-actions-wide .cards-search {
  margin: 0;
}

.section-actions-wide .cards-search input,
.section-actions-wide .cards-search select {
  height: 42px;
}

.section-actions-wide .btn {
  height: 42px;
  display: inline-flex;
  align-items: center;
}

.section-actions-wide .btn-equal {
  min-width: 160px;
  justify-content: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--color-surface);
  border-radius: 1.2rem;
  padding: 1.15rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.stat-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.stat-card p {
  margin: 0.75rem 0 0;
  font-size: 1.6rem;
  font-weight: 600;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.table-scroll.no-scroll {
  overflow-x: hidden;
}

.table-scroll.no-scroll .responsive-table {
  min-width: 0;
  table-layout: auto;
}

.table-scroll.no-scroll .responsive-table th,
.table-scroll.no-scroll .responsive-table td {
  white-space: normal;
}

.billing-customers-wide .content-inner {
  width: min(100%, 96rem);
}

.billing-customers-wide .stat-card {
  max-width: 100%;
}

.responsive-table tbody tr:nth-child(even) {
  background: var(--color-surface-muted);
}

.responsive-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: 1rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  min-width: 640px;
}

.responsive-table th,
.responsive-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.responsive-table th {
  background: var(--color-surface-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.responsive-table tr:last-child td {
  border-bottom: none;
}

.cards-table th,
.cards-table td {
  font-size: 0.88rem;
  line-height: 1.35;
  vertical-align: top;
}

.cards-table {
  min-width: 980px;
}

.cards-table .cell-primary {
  display: block;
  font-weight: 600;
  color: #0f172a;
}

.cards-table .cell-subtle {
  font-size: 0.8rem;
}

.cards-table tbody tr:nth-child(odd) {
  background: #fbfcff;
}

.cards-table tbody tr:nth-child(even) {
  background: #f6f8fd;
}

.cards-table tbody tr:hover {
  background: #dde8ff;
}

.cards-table tbody tr:hover td {
  background: #dde8ff;
}

.cards-table tbody tr:hover td:first-child {
  box-shadow: inset 4px 0 0 #2563eb;
}

.cards-table .status-pill {
  display: inline-flex;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
}

.cards-table td .status-pill {
  margin-bottom: 0.35rem;
}

.cards-table .status-danger {
  background: rgba(220, 38, 38, 0.16);
  color: #b91c1c;
}

.card-row-blocked {
  opacity: 0.75;
}

.card-row-blocked td {
  background: #fff6f6;
}

.cards-table .inline-select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.6rem;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 0.82rem;
  font-family: inherit;
}

.cards-table .status-select.status-active {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
}

.cards-table .status-select.status-blocked {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
}

.cards-table .status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.35rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.cards-table .status-icon-on {
  background: rgba(22, 163, 74, 0.16);
  color: #15803d;
}

.cards-table .status-icon-off {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}

.cards-table .facturatie-inline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cards-table .facturatie-inline .inline-select {
  margin-top: 0;
}

.cards-table .icon-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.cards-table .icon-toggle-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.6);
  outline-offset: 2px;
  border-radius: 999px;
}

.cards-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}

.cards-search input {
  min-width: 240px;
  max-width: 360px;
  padding: 0.6rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.cards-search select {
  min-width: 220px;
  padding: 0.6rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
  background: var(--color-surface);
}

.table-sort {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
}

.table-sort:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.6);
  outline-offset: 2px;
  border-radius: 6px;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.type-pill-company {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.type-pill-private {
  background: rgba(148, 163, 184, 0.25);
  color: #475569;
}

.channel-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}

.btn-hidden {
  display: none;
}

.report-table .report-row td:first-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-toggle {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: #475569;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.report-details-row td {
  background: #f8fafc;
}

.report-details {
  padding: 0.75rem 0.5rem;
  display: grid;
  gap: 0.75rem;
}

.report-card-block {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 0.75rem;
}

.report-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.report-card-total {
  margin-left: auto;
  font-weight: 600;
  color: #0f172a;
}

.inner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.inner-table th,
.inner-table td {
  border-top: 1px solid var(--color-border);
  padding: 0.35rem 0.4rem;
  text-align: left;
}

.inner-table th:nth-child(2),
.inner-table th:nth-child(3),
.inner-table td:nth-child(2),
.inner-table td:nth-child(3) {
  text-align: right;
}

.adjustments-table-wrapper {
  margin-top: 1rem;
}

.adjustments-table .cell-primary {
  font-weight: 600;
  color: #0f172a;
}

.adjustments-table .cell-subtle {
  display: block;
  margin-top: 0.2rem;
  color: var(--color-muted);
  font-size: 0.8rem;
}

.adjustments-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.delta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.delta-up {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.delta-down {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.empty-state {
  padding: 1rem;
  background: var(--color-surface);
  border-radius: 0.9rem;
  border: 1px dashed var(--color-border);
  color: var(--color-muted);
}

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

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

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

.cell-subtle {
  display: block;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.2rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--color-success);
}

.status-danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--color-danger);
}

.status-info {
  background: rgba(14, 165, 233, 0.15);
  color: #0369a1;
}

.status-muted {
  background: rgba(107, 114, 128, 0.15);
  color: var(--color-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.9rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.1s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  background: #4b5563;
}

.btn-danger {
  background: var(--color-danger);
}

.btn-small {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 999px;
}

.btn-sm {
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
}

.btn-compact {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}

.btn-inline {
  width: auto;
}

.back-link {
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid var(--color-border);
  font-size: 1rem;
  background: #fff;
}

.input-suffix-wrap {
  position: relative;
  width: 100%;
}

.input-suffix-wrap .input-percent-field {
  width: 100%;
  padding-right: 4.8rem;
}

.input-suffix-text {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--color-muted);
  pointer-events: none;
}

.inline-suffix-field {
  position: relative;
  width: 100%;
}

.inline-suffix-field .input-percent-field {
  width: 100%;
  padding-right: 5rem;
}

.inline-suffix-measure {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  white-space: pre;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1;
  padding: 0;
}

.inline-suffix-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--color-muted);
  pointer-events: none;
}

.input-percent-field::-webkit-outer-spin-button,
.input-percent-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-percent-field {
  -moz-appearance: textfield;
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
  background: var(--color-surface-muted);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  justify-items: stretch;
}

.form-grid .form-group {
  margin-bottom: 0;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.form-section {
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.25rem;
}

.form-section-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.form-section .form-grid {
  margin-bottom: 0;
}

.form-row {
  display: grid;
  gap: 1rem;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.form-row-3 {
  grid-template-columns: minmax(16rem, 1fr) auto minmax(16rem, 1fr);
  align-items: end;
}

.form-row-4 {
  grid-template-columns: minmax(16rem, 1fr) minmax(16rem, 1fr) auto minmax(16rem, 1fr);
  align-items: end;
}

.checkbox-center {
  align-items: center;
  align-self: center;
}

.checkbox-center .checkbox-row {
  margin-top: -0.2rem;
}

.checkbox-row.checkbox-inline {
  align-items: center;
}

.checkbox-row.checkbox-inline .checkbox-input {
  margin-top: 0;
}

.form-label-inline {
  font-weight: 600;
  margin-right: 0.75rem;
}

.admin-checkboxes {
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.admin-checkboxes .form-label-inline {
  display: inline-block;
  margin-bottom: 0.6rem;
  color: #0f172a;
}

.admin-checkboxes .checkbox-stack {
  max-width: 240px;
  gap: 0.65rem;
}

.admin-checkboxes .checkbox-row {
  display: grid;
  grid-template-columns: 1.2rem 1fr;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
}

.admin-checkboxes .checkbox-input {
  margin-top: 0;
}

.admin-checkboxes .checkbox-label {
  font-weight: 600;
  line-height: 1.2;
}

.card-edit-layout {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.card-header-compact {
  padding: 1rem 1.2rem;
}

.card-header-main {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card-header-title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card-token {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-ref {
  font-size: 0.95rem;
  color: var(--color-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--color-surface-muted);
}

.card-header-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.card-header-actions {
  margin-top: 0.6rem;
}

.card-edit-section {
  background: var(--color-surface);
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.card-edit-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  color: #111827;
}

.section-divider {
  height: 1px;
  border-top: 1px dotted var(--color-border);
  background: transparent;
  margin: 1rem 0;
}

.checkbox-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem;
}

.terminal-search {
  width: 100%;
  max-width: 420px;
  padding: 0.6rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
  margin: 0.4rem 0 0.8rem;
  background: var(--color-surface);
}

.terminal-grid .terminal-option {
  align-items: flex-start;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 600;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
}

.checkbox-inline {
  align-items: center;
}

.form-grid .checkbox-row.checkbox-inline {
  justify-self: start;
}

.checkbox-field {
  align-items: flex-start;
}

.checkbox-field label {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.checkbox-field .checkbox-row {
  margin-top: 2.5rem;
}

.checkbox-field .checkbox-label {
  font-weight: 600;
}

.form-grid .checkbox-row {
  justify-self: start;
}

.form-grid .form-group.full-width {
  align-items: flex-start;
  justify-self: stretch;
  width: 100%;
}

.form-grid .form-group.full-width .checkbox-row {
  width: 100%;
  align-self: flex-start;
  justify-content: flex-start;
  margin-left: 0;
  padding-left: 0;
}

.form-grid .form-group.full-width .checkbox-row span {
  text-align: left;
}

.checkbox-row .form-hint {
  display: block;
  font-weight: 400;
  margin-top: 0.2rem;
}

.checkbox-label {
  display: block;
}

.checkbox-input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.1rem;
}

.topup-card {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

.topup-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.topup-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.topup-section h3 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.topup-options {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.topup-options-scroll {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.topup-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.9rem 1.1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--color-border);
  background: #eef5fb;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.topup-option:hover {
  border-color: rgba(29, 78, 216, 0.45);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12);
}

.topup-option-input:checked + .topup-option-body {
  color: #0f172a;
}

.topup-option-input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--color-primary);
}

.topup-option-body {
  display: flex;
  font-weight: 600;
}

.topup-option-currency {
  font-size: 0.75rem;
  color: var(--color-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topup-option-amount {
  font-size: 1.15rem;
  color: #0f172a;
}

.topup-custom label {
  font-weight: 600;
}

.topup-custom input {
  border-radius: 0.8rem;
  max-width: 320px;
}

.topup-actions {
  display: flex;
  justify-content: flex-start;
}

.topup-payment {
  margin-top: 1.5rem;
}

.topup-iframe {
  width: 100%;
  min-height: 720px;
  height: 70vh;
  border: 0;
  border-radius: 0.9rem;
  background: #fff;
}

@media (max-width: 720px) {
  .topup-custom input {
    max-width: 100%;
  }

  .topup-iframe {
    height: 78vh;
  }
}

.select-compact {
  max-width: 360px;
}

.access-terminal-group .terminal-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.terminal-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: var(--color-surface-muted);
  border-radius: 0.8rem;
}

.terminal-option input {
  width: auto;
  margin: 0;
}

.billing-tabs {
  display: flex;
  gap: 0.8rem;
  margin: 1rem 0 1.5rem;
}

.billing-tab {
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-weight: 600;
  color: #0f172a;
}

.billing-tab.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-soft);
}

.inline-form {
  display: inline;
}

.billing-logo-preview {
  margin-bottom: 0.5rem;
}

.billing-logo-preview img {
  max-width: 240px;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: 0.8rem;
  padding: 0.4rem;
  background: #fff;
}

.card-detail-panel {
  margin-bottom: 1.25rem;
}

.flash {
  padding: 0.85rem 1rem;
  border-radius: 0.8rem;
}

.flash-success {
  background: rgba(16, 185, 129, 0.15);
  color: #0f5132;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-system {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  margin-left: 0.35rem;
}

.flash-error {
  background: rgba(239, 68, 68, 0.12);
  color: #981b1b;
}

.login-wrapper {
  max-width: 24rem;
  margin: 4rem auto;
  background: var(--color-surface);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}

.login-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.login-wrapper h1 {
  margin-top: 0;
}

.login-wrapper .btn {
  width: 100%;
}

.login-wrapper .language-switcher select {
  padding: 0.4rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 0.85rem;
}

.table-scroll::-webkit-scrollbar {
  height: 6px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.2);
  border-radius: 999px;
}

@media (max-width: 767px) {
  .portal-shell {
    flex-direction: column;
  }

  .top-bar {
    flex-wrap: wrap;
    padding: 0.6rem 0.9rem;
    align-items: center;
    gap: 0.5rem;
  }

  .mobile-nav-toggle {
    order: 1;
  }

  .top-bar-info {
    order: 2;
    margin-left: auto;
  }

  .top-bar-meta {
    order: 3;
    width: 100%;
  }

  .responsive-table {
    min-width: 100%;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tr {
    margin-bottom: 1rem;
    border-radius: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
  }

  .responsive-table td {
    padding: 0.4rem 0;
    border-bottom: none;
  }

  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-muted);
    display: block;
    margin-bottom: 0.2rem;
  }
}

@media (min-width: 768px) {
  .sidebar {
    position: fixed;
    transform: none;
    height: 100vh;
    box-shadow: var(--shadow-soft);
  }

  .sidebar-overlay {
    display: none;
  }

  .app-surface {
    margin-left: 260px;
  }

  .mobile-nav-toggle {
    display: none;
  }
}

@media (min-width: 1200px) {
  .content {
    padding: 2.5rem 3rem;
  }

  .top-bar-meta h1 {
    font-size: 1.5rem;
  }
}
