/* Admin uses the shared Stripe dashboard shell */
@import url("/dashboard/styles.css");

/* —— Admin login —— */
.admin-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 46%) 1fr;
  background: var(--bg);
}

/* Brand side */
.admin-auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 36px clamp(28px, 4vw, 56px) 32px;
  color: #fff;
  background:
    radial-gradient(80% 55% at 100% 0%, rgba(255, 255, 255, 0.12), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(0, 212, 170, 0.14), transparent 65%),
    linear-gradient(155deg, #4a3fdc 0%, #3127b0 50%, #1f1673 100%);
  overflow: hidden;
  isolation: isolate;
}
.ab-top { display: flex; align-items: center; gap: 10px; }
.ab-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  background: linear-gradient(135deg, #7a73ff, #635bff);
  box-shadow: 0 6px 18px rgba(99, 91, 255, 0.45);
}
.ab-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.ab-tag {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.ab-copy { max-width: 440px; }
.ab-eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a5a0ff;
}
.ab-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.1vw, 38px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.ab-lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}
.ab-features {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.ab-features li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ab-ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #c8c4ff;
  background: rgba(99, 91, 255, 0.2);
}
.ab-features strong { display: block; font-size: 14px; font-weight: 600; }
.ab-features span:not(.ab-ico) {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}
.ab-foot { display: grid; gap: 10px; }
.ab-foot p { margin: 0; font-size: 12px; color: rgba(255, 255, 255, 0.42); }
.ab-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}
.ab-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8792a2;
}
.ab-status.is-ok .ab-dot { background: #3ddc97; box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.18); }
.ab-status.is-down .ab-dot { background: #ff6b81; box-shadow: 0 0 0 4px rgba(255, 107, 129, 0.18); }

/* Form side */
.admin-auth-panel {
  display: flex;
  flex-direction: column;
  padding: 24px clamp(20px, 4vw, 48px);
}
.admin-auth-top { display: flex; justify-content: flex-end; font-size: 13px; }
.admin-auth-top a,
.admin-auth-legal a {
  color: var(--mute);
  font-weight: 500;
  text-decoration: none;
}
.admin-auth-top a:hover,
.admin-auth-legal a:hover { color: var(--purple); }
.admin-auth-card {
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 8px 0;
}
.admin-auth-card h2 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
}
.admin-auth-card .lead {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--mute);
}
.auth-form { display: grid; gap: 18px; }
.auth-field { display: grid; gap: 7px; }
.auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.auth-field .optional { margin-left: 4px; font-weight: 400; color: var(--mute); }
.auth-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid #d5dbe3;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(10, 37, 64, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input::placeholder { color: #a3acb9; }
.auth-field input:hover { border-color: #b8c1cc; }
.auth-field input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.14);
}
.auth-field input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(223, 27, 65, 0.1);
}
.input-reveal { position: relative; }
.input-reveal input { padding-right: 50px; font-family: var(--font); }
.input-reveal input[type="text"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.reveal-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
}
.reveal-btn:hover { color: var(--text); background: #f1f4f8; }
.reveal-btn:focus-visible { outline: 2px solid var(--purple); outline-offset: 1px; }
.reveal-btn .eye-closed { display: none; }
.reveal-btn[aria-pressed="true"] .eye-open { display: none; }
.reveal-btn[aria-pressed="true"] .eye-closed { display: block; }
.field-note { margin: 0; font-size: 12px; color: #b76e00; }
.field-hint { margin: -2px 0 2px; font-size: 13px; color: var(--mute); }
.otp-input {
  max-width: 200px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-size: 18px !important;
  letter-spacing: 0.45em;
}
.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff0f2;
  border: 1px solid #ffd3da;
  color: #b4123a;
  font-size: 13px;
  line-height: 1.45;
}
.auth-submit {
  width: 100%;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  font-size: 15px;
}
.auth-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}
.auth-submit.is-loading .auth-spinner { display: inline-block; }
.auth-submit.is-loading { pointer-events: none; opacity: 0.85; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-help {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-size: 13px;
  color: var(--body);
}
.auth-help summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--mute);
  list-style: none;
}
.auth-help summary::-webkit-details-marker { display: none; }
.auth-help summary::before { content: "+ "; color: var(--purple); font-weight: 700; }
.auth-help[open] summary::before { content: "– "; }
.auth-help p { margin: 10px 0 0; line-height: 1.55; }
.auth-help code {
  font-size: 12px;
  background: #eef2f7;
  padding: 0.1em 0.4em;
  border-radius: 4px;
}
.admin-auth-legal { margin: 0; text-align: center; font-size: 12px; }

@media (max-width: 900px) {
  .admin-auth { grid-template-columns: 1fr; }
  .admin-auth-brand { gap: 20px; padding: 24px 20px; }
  .ab-copy h1 { font-size: 24px; }
  .ab-lead { font-size: 14px; }
  .ab-features,
  .ab-foot p { display: none; }
  .admin-auth-panel { padding: 16px 16px 28px; }
  .ab-status { border-radius: 12px; }
  .admin-auth-card { margin: 24px auto; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-spinner { animation-duration: 2.4s; }
}

/* KYC queue + dossier */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.nav-link .nav-badge { flex-shrink: 0; }
.status-pill.submitted {
  background: #fff4e5;
  color: #b76e00;
}
.kyc-modal-card {
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 22px 22px 18px;
}
.kyc-dossier-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.kyc-section {
  margin: 0 0 16px;
  padding: 14px 14px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbff;
}
.kyc-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.kyc-grid {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.kyc-kv dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8792a2;
}
.kyc-kv dd {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}
.kyc-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .kyc-grid { grid-template-columns: 1fr; }
  .kyc-modal-actions .btn { width: 100%; }
}

@media (max-width: 860px) {
  .admin-auth-card { padding: 24px 18px 22px; }
  .admin-auth-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Condition / alert rows (live rail checks, "À traiter") */
.activation-conditions .cond {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activation-conditions .cond:last-child { border-bottom: 0; }
.activation-conditions .cond strong { flex: none; }
.activation-conditions .cond span { color: var(--mute); text-align: right; }
.activation-conditions .cond.ok span { color: var(--ok); }
.activation-conditions .cond.ko span { color: var(--danger); }

#admin-volume-chart { width: 100%; height: 180px; display: block; }
.chart-legend .lg-out { background: #e5484d; }
.dir-in { color: var(--ok); font-weight: 600; }
.dir-out { color: #c2410c; font-weight: 600; }

#activity-body td { white-space: nowrap; }
