/* Cleaned from components.css: duplicate top-level selector blocks merged; media queries preserved. */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.card__header {
  margin-bottom: var(--space-4);
}

.form-stack {
  display: grid;
  gap: var(--space-4);
}

.form-row {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

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

.checkbox-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: var(--space-2);
  line-height: 1.35;
  width: 100%;
  min-width: 0;
}

.checkbox-row input[type="checkbox"] {
  margin: 3px 0 0 0;
  width: 16px;
  height: 16px;
}

.checkbox-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compact-row {
  margin-bottom: 0;
  align-content: start;
  min-height: 48px;
  min-width: 0;
}

.form-row input,
.form-row select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  min-width: 0;
  box-sizing: border-box;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-3);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

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

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

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

.flash--error {
  border-color: rgba(220, 38, 38, 0.25);
}

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

.separator {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-4) 0;
}

.form-stack--compact {
  gap: var(--space-3);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
}

.kpi {
  text-align: center;
}

.kpi__value {
  font-size: 2rem;
  font-weight: 700;
}

.kpi__label {
  color: var(--text-muted);
  margin-top: 6px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.user-device-history-details {
  display: grid;
  grid-template-columns: minmax(100px, 160px) minmax(0, 1fr);
  gap: 8px 16px;
  margin-top: 12px;
}

.user-device-history-details dt {
  font-weight: 600;
}

.user-device-history-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .user-device-history-details {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .user-device-history-details dd {
    margin-bottom: 8px;
  }
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

.qr-box {
  margin-top: 12px;
  min-height: 190px;
  min-width: 190px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.qr-url {
  margin-top: 10px;
  word-break: break-all;
}

.user-card {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.security-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #e5e7eb;
}

.app-footer__left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.app-footer__right {
  display: flex;
  gap: 16px;
}

.app-footer__right a {
  color: #6b7280;
  text-decoration: none;
}

.app-footer__right a:hover {
  text-decoration: underline;
}

.wallet-config-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  min-width: 0;
}

.section-nav {
  position: sticky;
  top: 24px;
}

.section-nav .card {
  padding: 20px;
}

.section-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-nav-list a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
  color: inherit;
}

.section-nav-list a:hover {
  background: rgba(0, 0, 0, 0.07);
}

.config-main {
  min-width: 0;
}

.config-main .card {
  margin-bottom: 20px;
}

.config-section {
  scroll-margin-top: 24px;
  min-width: 0;
}

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

.section-header h3 {
  margin: 0;
}

.section-kicker {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: 4px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  align-items: start;
  min-width: 0;
}

.section-grid > * {
  min-width: 0;
}

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

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.status-box {
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
}

.status-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.section-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.section-actions .nav-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.anchor-button {
  display: inline-block;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  color: inherit;
}

.anchor-button:hover {
  background: rgba(0, 0, 0, 0.08);
}

.form-note {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: -4px;
  margin-bottom: 8px;
}

.page-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.wallet-config-org-card {
  margin-bottom: 24px;
}

.image-preview-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
}

.image-preview-card--dark {
  background: #111827;
  color: white;
  border-color: #1f2937;
}

.image-preview-title {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.image-preview-card--dark .image-preview-title {
  color: #d1d5db;
}

.logo-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-preview-placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.color-input-row input[type="color"] {
  width: 56px;
  min-width: 56px;
  height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.color-swatch-large {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  min-width: 0;
}

.checkbox-group .checkbox-row {
  align-self: start;
}

.wallet-config-note-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-muted, #f9fafb);
  border: 1px solid var(--border);
  color: var(--text-muted);
  opacity: 1;
  margin: 0;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .wallet-config-layout {
    grid-template-columns: 1fr;
  }

  .section-nav {
    position: static;
  }

  .section-grid,
  .status-strip,
  .wallet-preview-grid,
  .checkbox-group {
    grid-template-columns: 1fr;
  }
}

.user-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  align-items: center;
}

.user-session-card {
  margin-bottom: 20px;
}

.user-dashboard {
  display: grid;
  gap: 20px;
}

.hero-card__content {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  flex-wrap: wrap;
}

.hero-card__title {
  margin-top: 12px;
  font-size: 1.5rem;
}

.status-panel--warning {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.22);
}

.status-panel--success {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.22);
}

.status-panel p {
  margin-top: 6px;
  color: var(--text-muted);
}

.user-grid-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.action-card {
  display: grid;
  gap: 16px;
}

.action-card__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.action-card__meta {
  display: grid;
  gap: 8px;
}

.action-card__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.wallet-actions {
  margin-top: 16px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.copy-row__input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  min-width: 0;
  box-sizing: border-box;
}

.user-main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
}

.user-page-header {
  margin-bottom: 24px;
}

@media (max-width: 960px) {
  .user-grid-cards {
    grid-template-columns: 1fr;
  }

  .copy-row,
  .password-field {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .app-footer__left,
  .app-footer__right {
    flex-wrap: wrap;
  }

  .action-card__top,
  .hero-card__content {
    flex-direction: column;
  }
}

.badge--secondary {
  background: #eef2ff;
  color: #3730a3;
}

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

.admin-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  align-items: center;
}

.admin-session-card {
  margin-bottom: 20px;
}

.auth-main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
}

.auth-page-header {
  margin-bottom: 24px;
}

.auth-login-grid {
  align-items: stretch;
}

.auth-card {
  min-height: 100%;
}

.helper-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

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

.step-list {
  display: grid;
  gap: 16px;
}

.step-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.step-item__number {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.app-footer {
  margin-top: 40px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.app-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 13px;
  color: #6b7280;
  gap: 16px;
}

.app-footer__left,
.app-footer__right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.app-footer__version {
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .password-field {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .app-footer__left,
  .app-footer__right {
    flex-wrap: wrap;
  }
}

.wallet-config-page-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wallet-config-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.wallet-config-overlay.is-hidden {
  display: none;
}

.wallet-config-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.wallet-config-overlay__dialog {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 32px));
  margin: 48px auto;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  padding: 24px;
}

.wallet-config-overlay__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.wallet-config-overlay__content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.wallet-config-overlay__qr {
  display: flex;
  justify-content: center;
}

.modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .wallet-config-overlay__dialog {
    margin: 20px auto;
    padding: 16px;
  }

  .wallet-config-overlay__content {
    grid-template-columns: 1fr;
  }
}

.color-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

.color-swatch:hover {
    transform: scale(1.08);
    border-color: #9ca3af;
  }

.wallet-logo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.wallet-logo-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-logo-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.wallet-logo-input {
  min-width: 280px;
}

.logo-preview-box {
  height: 110px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface-muted, #f9fafb);
  min-width: 140px;
  min-height: 88px;
}

.image-preview-card--dark .logo-preview-box {
  background: #111827;
  border-color: #374151;
}

.wallet-logo-block > label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.public-page {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.public-qr-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

.public-qr-card {
  width: 100%;
  max-width: 560px;
  padding: 32px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  text-align: center;
}

.public-qr-header {
  margin-bottom: 28px;
}

.public-qr-eyebrow {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4f46e5;
}

.public-qr-header h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.2;
}

.public-qr-header p {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
}

.public-qr-box {
  display: flex;
  justify-content: center;
  margin: 28px 0;
}

.public-qr-box .qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 316px;
  height: 316px;
  padding: 18px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.public-qr-box img {
  display: block;
  width: 280px;
  height: 280px;
}

.public-qr-help {
  margin-top: 24px;
  padding: 20px;
  border-radius: 18px;
  background: #f8fafc;
  text-align: left;
}

.public-qr-help h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.public-qr-help ol {
  margin: 0;
  padding-left: 20px;
  color: #475569;
  line-height: 1.7;
}

.public-qr-note {
  margin: 20px 0 0;
  font-size: 13px;
  color: #64748b;
}

.copy-url-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.copy-url-row .qr-url {
  flex: 1;
  overflow-wrap: anywhere;
}

.copy-url-button {
  flex-shrink: 0;
}

.legal-page {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 20px;
}

.legal-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.legal-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.legal-eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4f46e5;
}

.legal-header h1 {
  margin: 0 0 8px;
  font-size: 36px;
  line-height: 1.15;
}

.legal-date {
  margin: 0;
  color: #64748b;
}

.legal-card h2 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 22px;
}

.legal-card h3 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 18px;
}

.legal-card p,
.legal-card li {
  color: #334155;
  line-height: 1.7;
}

.legal-card ul {
  padding-left: 22px;
}

.legal-note {
  margin-top: 24px;
  padding: 16px;
  border-radius: 16px;
  background: #f8fafc;
  color: #475569;
}

@media (max-width: 720px) {
  .legal-card {
    padding: 24px;
  }

  .legal-header h1 {
    font-size: 28px;
  }
}

.inline-form {
  display: inline;
}

.policy-content {
  white-space: pre-wrap;
  font-family: monospace;
  line-height: 1.5;
}

/* -------------------------------------------------------------------------- */
/* Design system refinements - buttons, badges, focus states                  */
/* -------------------------------------------------------------------------- */

.button {
  gap: 8px;
  min-height: 42px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.12s ease;
}

.button:hover {
  text-decoration: none;
}

.button:active {
  transform: translateY(2px) scale(0.98);
}

.button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
  box-shadow: none;
  transform: none;
}

.button--primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.24);
}

.button--primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.32);
}

.button--secondary {
  background: #f8fafc;
  color: var(--text);
  border-color: #dbe3ef;
}

.button--secondary:hover {
  background: #eef2f7;
  border-color: #cbd5e1;
}

.button--warning {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.22);
}

.button--warning:hover {
  background: #d97706;
  border-color: #d97706;
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.28);
}

.button--danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.20);
}

.button--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.26);
}

.button--ghost {
  background: transparent;
  border-color: transparent;
  color: #2563eb;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}

.button--ghost:hover {
  background: transparent;
  border-color: transparent;
  color: #1d4ed8;
  text-decoration: underline;
}

.button--soft-primary {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.button--soft-primary:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
}

.badge--success {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.18);
}

.badge--danger {
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.18);
}

.badge--primary {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.18);
}

.badge--secondary,
.badge--muted {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.status-panel {
  min-width: 260px;
  max-width: 360px;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.status-panel--primary {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.20);
}

.status-panel--danger {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.20);
}

.card--highlight {
  border-color: rgba(37, 99, 235, 0.18);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 34%),
    var(--surface);
}

.wallet-actions .button,
.action-card__actions .button,
.page-actions .button {
  white-space: nowrap;
}

.text-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .button {
    width: 100%;
  }

  .inline-form .button,
  .button--ghost {
    width: auto;
  }
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(5, 150, 105, 0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.kpi-grid--pro {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi--danger {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.04);
}

.card__header--row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.metric-row:last-child {
  border-bottom: 0;
}

.action-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.action-list span.text-muted {
  display: block;
  margin-top: 4px;
}

.list--compact {
  display: grid;
  gap: var(--space-2);
}

.list-item--pro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

@media (max-width: 1180px) {
  .kpi-grid--pro {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-health,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .kpi-grid--pro {
    grid-template-columns: 1fr;
  }

  .health-score {
    align-items: flex-start;
    flex-direction: column;
  }
}

.action-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

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

  .action-list__item {
    align-items: flex-start;
    flex-direction: column;
  }
}

.text-danger {
  color: rgb(220, 38, 38);
  font-weight: 600;
}

.text-warning {
  color: rgb(217, 119, 6);
  font-weight: 600;
}

.badge--warning {
  background: rgba(217, 119, 6, 0.12);
  color: rgb(217, 119, 6);
  border-color: rgba(217, 119, 6, 0.20);
}

.form-section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 24px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.form-section-title span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
}

.form-section-title h3 {
  margin: 0 0 4px;
}

.issuer-visibility-box {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.switch-row {
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

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

.issuer-card-preview {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1.586 / 1;
  border-radius: 22px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #5A00FE;
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  position: relative;
}

.issuer-card-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.16),
    rgba(255,255,255,0.02) 45%,
    rgba(0,0,0,0.22)
  );
  pointer-events: none;
}

.issuer-card-preview > * {
  position: relative;
  z-index: 1;
}

.issuer-card-preview__logo {
  width: 56px;
  height: 56px;
  display: none;
  align-self: flex-end;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.18);
  flex: 0 0 auto;
}

.issuer-card-preview strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 8px;
  max-width: 85%;
}

.issuer-card-preview p {
  margin-top: 70px;
  opacity: 0.9;
  max-width: 85%;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.event-list__meta {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-word;
}

/* 1er tiers */
.wallet-preview-top {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 2e tiers */
.wallet-preview-middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.wallet-preview-middle h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.wallet-preview-middle p {
  margin: 0;
  opacity: 0.85;
}

.color-grid {
  display: flex;
  grid-template-columns: repeat(8, 28px);
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  box-shadow: var(--shadow-sm);
}

.color-swatch.is-selected {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12);
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.color-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-picker-input {
  width: 46px;
  height: 38px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.color-text-input {
  flex: 1;
}

/* LIGHT */
.wallet-phone-preview--light .wallet-phone-screen {
  background: #FFFFFF;
  color: #111827; /* TEXTE NOIR */
}

/* DARK */
.wallet-phone-preview--dark .wallet-phone-screen {
  background: #000000;
  color: #FFFFFF;
}

/* bloc texte */
.wallet-preview-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* TITLE */
.wallet-preview-text h3 {
  margin: 0 0 15px;
  font-size: 1.3rem;
  font-weight: 600;
}

/* TAGLINE */
.wallet-preview-text p {
  margin: 0;
  opacity: 0.75;
}

.wallet-preview-grid {
  display: flex;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.wallet-preview-label {
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-muted);
}

.wallet-phone-preview {
  width: 240px;
  border-radius: 30px;
  padding: 12px;
  background: #111827;
  box-shadow: var(--shadow-sm);
}

.wallet-phone-screen {
  border-radius: 24px;
  height: 420px;
  background: #4F46E5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wallet-phone-preview--light .wallet-phone-screen {
  background: #ffffff;
  color: #111827;
}

.wallet-phone-preview--dark .wallet-phone-screen {
  background: #000000;
  color: #ffffff;
}

.wallet-preview-top {
  height: 30%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 50px;
}

.wallet-preview-top img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
}

.wallet-preview-center {
  height: 70%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 50px;
  text-align: center;
}

.wallet-preview-text {
  max-width: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wallet-preview-text h3 {
  margin: 0 0 15px;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
}

.wallet-preview-text p {
  margin: 0;
  opacity: 0.75;
  line-height: 1.4;
}

.wallet-setup-card {
  margin-top: 20px;
  margin-bottom: 20px;
}

.wallet-setup-card .card__header {
  margin-bottom: 14px;
}

.wallet-setup-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.wallet-setup-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
}

.wallet-setup-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.wallet-setup-item strong {
  display: block;
  margin-bottom: 4px;
}

.wallet-setup-item--success {
  background: rgba(5, 150, 105, 0.06);
  border-color: rgba(5, 150, 105, 0.25);
}

.wallet-setup-item--success .wallet-setup-icon {
  background: rgba(5, 150, 105, 0.15);
  color: #059669;
}

.wallet-setup-item--warning {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.25);
}

.wallet-setup-item--warning .wallet-setup-icon {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
}

.wallet-setup-item--danger {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.25);
}

.wallet-setup-item--danger .wallet-setup-icon {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
}

@media (max-width: 1024px) {
  .wallet-setup-list {
    grid-template-columns: 1fr;
  }
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: var(--space-4);
  position: fixed;
  top: 20px;
  right: 20px;
  width: min(360px, calc(100vw - 32px));
  z-index: 1000;
}

.flash {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  animation: flashIn 0.25s ease;
}

.flash--success {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.flash--error,
.flash--danger {
  background: #fef3f2;
  color: #b42318;
  border-color: #fecdca;
}

.flash--warning {
  background: #fffaeb;
  color: #b54708;
  border-color: #fedf89;
}

.flash--info {
  background: #eff8ff;
  color: #175cd3;
  border-color: #b2ddff;
}

.flash__icon {
  font-weight: 700;
}

.flash__message {
  flex: 1;
}

.flash__close {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.flash.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes flashIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.qr-expiration {
  margin: 16px 0 20px;
}

.qr-expiration__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.qr-expiration__bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.qr-expiration__progress {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #3b82f6,
    #60a5fa
  );
  transition:
    width 1s linear,
    background 0.4s ease;
}

.qr-expiration__progress--warning {
  background: linear-gradient(
    90deg,
    #f59e0b,
    #fbbf24
  );
}

.qr-expiration__progress--danger {
  background: linear-gradient(
    90deg,
    #ef4444,
    #f87171
  );
}

.qr-expired-box {
  text-align: center;
  padding: 24px;
}

.qr-expired-box h3 {
  margin-bottom: 8px;
}

.wallet-store-section {
  margin: 20px 0 24px;
  text-align: center;
}

.wallet-store-section__title {
  margin-bottom: 14px;
  font-weight: 600;
}

.wallet-store-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.wallet-store-link {
  width: 180px;
  height: 60px;
  min-width: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  text-decoration: none;

  transition: transform 0.18s ease;
}

.wallet-store-link:hover {
  transform: translateY(-2px);
}

.wallet-store-link img {
  max-height: 54px;
  max-width: 180px;

  width: auto;
  height: auto;

  display: block;
}

.public-wallet-open--mobile {
  display: none;
}

@media (max-width: 768px) {
  .public-qr-box--desktop {
    display: none;
  }

  .public-wallet-open--mobile {
    display: block;
    margin: 24px 0;
  }
}

.wallet-setup-mobile {
  display: none;
}

@media (max-width: 768px) {
  .wallet-setup-desktop {
    display: none;
  }

  .wallet-setup-mobile {
    display: block;
    margin: 24px 0;
  }
}

/* -------------------------------------------------------------------------- */
/* Dashboard                                                                  */
/* -------------------------------------------------------------------------- */

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.dashboard-hero h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

.dashboard-eyebrow {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  margin: 0 0 var(--space-2);
}

.dashboard-hero__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-section {
  margin-top: var(--space-5);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  align-items: start;
}

.card__header--split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

.kpi-grid--dashboard {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi--pro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.kpi__icon {
  width: 42px;
  height: 42px;
  display: flex;
  place-items: center;
  background: var(--surface-muted);
  border-radius: 999px;
  margin-bottom: var(--space-3);
  margin: 0 auto var(--space-3);
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.kpi--success {
  border-color: rgba(5, 150, 105, 0.24);
  background: linear-gradient(180deg, rgba(5, 150, 105, 0.08), #ffffff 46%);
}

.kpi--warning {
  border-color: rgba(217, 119, 6, 0.28);
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.10), #ffffff 46%);
}

.kpi--muted {
  background: var(--surface);
}

.dashboard-health {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.health-score,
.health-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.health-score {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.health-score__value {
  min-width: 92px;
  height: 92px;
  display: flex;
  place-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 1.55rem;
  font-weight: 800;
  align-items: center;
  justify-content: center;
}

.health-score h3,
.health-item strong {
  margin: 0;
}

.health-item {
  display: grid;
  gap: var(--space-2);
}

.health-item span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.health-item strong {
  display: block;
  font-size: 1.7rem;
  margin: 8px 0;
}

.progress {
  width: 100%;
  height: 10px;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
  margin-top: var(--space-3);
}

.progress__bar {
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.action-list,
.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-3);
}

.action-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.action-list__item span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.action-list__item .button--warning {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.action-list__item--success {
  border-color: rgba(5, 150, 105, 0.24);
  background: rgba(5, 150, 105, 0.06);
}

.action-list__item--warning {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.06);
}

.action-list__item--danger {
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.05);
}

.readiness-list {
  display: grid;
  gap: var(--space-3);
}

.readiness-item {
  display: grid;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  grid-template-columns: 36px minmax(0, 1fr);
}

.readiness-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.readiness-item__icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
}

.readiness-item__icon--success {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success);
}

.readiness-item__icon--warning {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
}

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

.pipeline {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pipeline__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.pipeline__item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-bottom: var(--space-2);
}

.pipeline__item strong {
  font-size: 1.6rem;
  display: block;
}

.pipeline__item--success {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.24);
}

.pipeline__item--warning {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.24);
}

.pipeline__item--danger {
  background: rgba(220, 38, 38, 0.07);
  border-color: rgba(220, 38, 38, 0.24);
}

.event-list__item {
  display: grid;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  grid-template-columns: 40px minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}

.event-list__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.event-list__icon {
  width: 36px;
  height: 36px;
  display: flex;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-muted);
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.event-list__content {
  min-width: 0;
}

.button--small {
  padding: 8px 12px;
  font-size: 0.88rem;
  white-space: nowrap;
  min-height: 34px;
}

@media (max-width: 1180px) {
  .kpi-grid--dashboard,
  .pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-health {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 720px) {
  .dashboard-hero,
  .card__header--split,
  .action-list__item {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-hero__actions {
    justify-content: flex-start;
  }

  .kpi-grid--dashboard,
  .pipeline {
    grid-template-columns: 1fr;
  }

  .health-score {
    align-items: flex-start;
  }
}

.health-score__help {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  max-width: 28rem;
}

.dashboard-info {
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-secondary);
}

.dashboard-info__title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.dashboard-info__list {
  margin: 0;
  padding-left: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
}

.audit-metadata {
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
  font-size: 12px;
  line-height: 1.4;
  overflow-x: auto;
  overflow-y: auto;
  max-width: 520px;
  max-height: 260px;
  white-space: pre-wrap;
}

.audit-metadata code {
  color: inherit;
}

details summary {
  cursor: pointer;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table th:last-child,
.table td:last-child {
  width: 240px;
}

.audit-table {
  min-width: 860px;
}

.audit-table th:last-child,
.audit-table td:last-child {
  width: auto;
}

.audit-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.audit-action {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
}

.audit-date {
  display: block;
  white-space: nowrap;
}

.audit-table .badge {
  max-width: 100%;
  white-space: normal;
}

.audit-table .audit-metadata {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.api-scopes-cell {
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.api-scope-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 260px;
}

.api-scope-badge {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-size: 0.78rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.api-scope-option {
  align-items: flex-start;
}

.api-scope-description {
  display: block;
  margin-top: 4px;
  line-height: 1.5;
}

.organization-list {
  display: grid;
  gap: 16px;
}

.organization-admin-card {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 16px;
  padding: 18px;
  background: var(--surface-color, #fff);
}

.organization-admin-card__main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.organization-admin-card__main h3 {
  margin: 0 0 4px;
}

.organization-admin-card__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.organization-quota-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.quota-box {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
  background: #f9fafb;
}

.quota-box span {
  display: block;
  color: #6b7280;
  font-size: 0.85rem;
}

.quota-box strong {
  display: block;
  margin-top: 4px;
  font-size: 1.4rem;
}

.organization-admin-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.quota-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.quota-form label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: #6b7280;
}

.quota-form input {
  width: 90px;
}

.member-card__identity strong,
.member-card__identity span {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .member-card__main {
    flex-direction: column;
  }

  .member-card__badges,
  .member-card__actions,
  .member-actions {
    justify-content: flex-start;
  }

  .members-search-grid {
    grid-template-columns: 1fr;
  }
}

.members-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.member-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 18px;
  padding: 16px;
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow-sm);
}

.member-card__main {
  display: grid;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.member-card__identity {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.member-card__identity strong {
  font-size: 1rem;
  line-height: 1.25;
}

.member-card__identity span {
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.member-card__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.member-card__actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.member-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 36px;
  justify-content: flex-start;
}

.member-actions form {
  margin: 0;
}

.member-actions .button {
  width: auto;
  min-width: auto;
  height: 32px;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.members-search-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

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

  .members-search-grid {
    grid-template-columns: 1fr;
  }

  .member-actions .button {
    width: auto;
  }
}

.distribution-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.distribution-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 18px;
  padding: 16px;
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow-sm);
}

.distribution-card__main {
  display: grid;
  gap: 12px;
}

.distribution-card__identity {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.distribution-card__identity strong,
.distribution-card__identity span {
  overflow-wrap: anywhere;
}

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

.distribution-card__problem {
  font-size: 0.9rem;
}

.distribution-card__actions {
  margin-top: 16px;
}

.distribution-search-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

@media (max-width: 760px) {
  .distribution-list,
  .distribution-search-grid {
    grid-template-columns: 1fr;
  }
}

.wallet-active-panel{
    display:flex;
    flex-direction:column;
    gap:24px;
}

.wallet-active-panel__status{
    display:flex;
    gap:16px;
    align-items:center;

    padding:22px;

    background:#ecfdf5;
    border:1px solid #bbf7d0;

    border-radius:18px;
}

.wallet-active-panel__icon{
    width:56px;
    height:56px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:50%;

    font-size:28px;
    font-weight:bold;

    background:#16a34a;
    color:white;

    flex-shrink:0;
}

.wallet-active-panel__status h3{
    margin:0;
    font-size:1.3rem;
}

.wallet-active-panel__help{
    padding:16px;

    border-radius:14px;

    background:#fafafa;
    border:1px solid #e5e7eb;
}


.form-row .color-input-row input[type="color"].color-picker-input {
  width: 46px;
  min-width: 46px;
  height: 38px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
}

.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 3px;
}

.color-picker-input::-webkit-color-swatch {
  border: 0;
  border-radius: 7px;
}

.color-picker-input::-moz-color-swatch {
  border: 0;
  border-radius: 7px;
}


/* -------------------------------------------------------------------------- */
/* Key Storage Types                                                          */
/* -------------------------------------------------------------------------- */

.key-storage-page {
  min-width: 0;
}

.key-storage-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.key-storage-header h2 {
  margin: 0 0 6px;
}

.key-storage-summary {
  flex: 0 0 auto;
}

.key-storage-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted, #f8fafc);
}

.key-storage-search {
  flex: 1;
  min-width: 240px;
}

.key-storage-search input {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: #ffffff;
  font: inherit;
}

.key-storage-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.key-storage-filter.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.key-storage-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.key-storage-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  background: var(--surface);
}

.key-storage-table th {
  padding: 11px 12px;
  background: var(--surface-muted, #f8fafc);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.key-storage-table td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.key-storage-row:last-child td {
  border-bottom: 0;
}

.key-storage-row:hover td {
  background: rgba(37, 99, 235, 0.025);
}

.key-storage-device {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.key-storage-device strong {
  color: var(--text);
  font-size: 0.92rem;
}

.key-storage-device span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.key-storage-value {
  white-space: nowrap;
}

.key-storage-actions-column {
  text-align: right !important;
}

.key-storage-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.key-storage-actions .button {
  width: auto;
}

.key-storage-detail-row td,
.key-storage-revoke-row td {
  padding: 0;
  background: #f8fafc;
}

.key-storage-details {
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr)
    minmax(260px, 2fr)
    minmax(160px, 1fr)
    minmax(180px, 1fr);
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.key-storage-detail-block {
  min-width: 0;
}

.key-storage-detail-block > span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.key-storage-detail-block a,
.key-storage-detail-block code,
.key-storage-detail-block strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.key-storage-detail-block code {
  display: block;
  padding: 6px 8px;
  border-radius: 7px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.78rem;
}

.key-storage-revoke-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.5fr);
  gap: 24px;
  align-items: end;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(220, 38, 38, 0.035);
}

.key-storage-revoke-panel strong {
  color: #b91c1c;
}

.key-storage-revoke-panel p {
  margin: 5px 0 0;
}

.key-storage-revoke-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.key-storage-revoke-form .form-row {
  margin: 0;
}

.key-storage-revoke-form .button {
  width: auto;
}

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

@media (max-width: 1100px) {
  .key-storage-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .key-storage-revoke-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .key-storage-header,
  .key-storage-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .key-storage-filters {
    justify-content: flex-start;
  }

  .key-storage-table-wrap {
    overflow: visible;
    border: 0;
  }

  .key-storage-table,
  .key-storage-table tbody {
    display: block;
  }

  .key-storage-table thead {
    display: none;
  }

  .key-storage-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
  }

  .key-storage-row td {
    display: block;
    border-bottom: 1px solid var(--border);
    min-width: 0;
  }

  .key-storage-row td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.035em;
  }

  .key-storage-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .key-storage-detail-row,
  .key-storage-revoke-row {
    display: block;
    margin: -12px 0 12px;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
  }

  .key-storage-detail-row td,
  .key-storage-revoke-row td {
    display: block;
  }

  .key-storage-details {
    grid-template-columns: 1fr;
  }

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

  .key-storage-revoke-form .button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .key-storage-row {
    grid-template-columns: 1fr;
  }

  .key-storage-actions {
    grid-column: auto;
    flex-wrap: wrap;
  }

  .key-storage-actions .button {
    flex: 1;
  }
}
