* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f1117; color: #e2e8f0; min-height: 100vh; }
a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 900px; margin: 0 auto; padding: 24px 16px; }
.container-sm { max-width: 480px; margin: 60px auto; padding: 24px 16px; }

/* Nav */
.nav { background: #1a1d27; border-bottom: 1px solid #2d3148; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-weight: 700; font-size: 1.1rem; color: #fff; }
.nav-links { display: flex; gap: 16px; align-items: center; font-size: 0.9rem; }
.nav-links a { color: #94a3b8; }
.nav-links a:hover { color: #fff; text-decoration: none; }

/* Card */
.card { background: #1a1d27; border: 1px solid #2d3148; border-radius: 10px; padding: 24px; margin-bottom: 16px; }
.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; color: #fff; }

/* Auth forms */
.auth-card { background: #1a1d27; border: 1px solid #2d3148; border-radius: 12px; padding: 32px; }
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; color: #fff; }
.auth-sub { color: #64748b; margin-bottom: 24px; font-size: 0.9rem; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; color: #94a3b8; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; background: #0f1117; border: 1px solid #2d3148; color: #e2e8f0;
  padding: 10px 12px; border-radius: 6px; font-size: 0.9rem; outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: #3b82f6; }
.form-group textarea { resize: vertical; min-height: 80px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 6px; font-size: 0.9rem; font-weight: 500; cursor: pointer; border: none; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary { background: #3b82f6; color: #fff; }
.btn-success { background: #22c55e; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-ghost { background: transparent; border: 1px solid #2d3148; color: #94a3b8; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: #7f1d1d33; border: 1px solid #b91c1c; color: #fca5a5; }
.alert-success { background: #14532d33; border: 1px solid #16a34a; color: #86efac; }

/* Progress bar */
.progress-wrap { background: #2d3148; border-radius: 20px; height: 8px; margin-bottom: 24px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #3b82f6, #60a5fa); border-radius: 20px; transition: width 0.4s; }
.progress-label { font-size: 0.8rem; color: #64748b; margin-bottom: 8px; }

/* Step list */
.step-item { display: flex; align-items: flex-start; gap: 16px; padding: 16px; background: #1a1d27; border: 1px solid #2d3148; border-radius: 10px; margin-bottom: 10px; cursor: pointer; transition: border-color 0.15s; }
.step-item:hover { border-color: #3b82f6; text-decoration: none; }
.step-item.locked { opacity: 0.5; cursor: default; }
.step-item.locked:hover { border-color: #2d3148; }
.step-item.active { border-color: #3b82f6; }
.step-item.pending { border-color: #f59e0b; }
.step-item.approved { border-color: #22c55e; }
.step-item.rejected { border-color: #ef4444; }

.step-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.step-icon.locked { background: #2d3148; color: #64748b; }
.step-icon.active { background: #1e3a5f; color: #60a5fa; }
.step-icon.pending { background: #451a03; color: #fbbf24; }
.step-icon.approved { background: #14532d; color: #4ade80; }
.step-icon.rejected { background: #7f1d1d; color: #f87171; }

.step-body { flex: 1; }
.step-title { font-weight: 600; color: #e2e8f0; margin-bottom: 4px; }
.step-status { font-size: 0.8rem; color: #64748b; }
.step-status.active { color: #60a5fa; }
.step-status.pending { color: #fbbf24; }
.step-status.approved { color: #4ade80; }
.step-status.rejected { color: #f87171; }

/* File upload */
.upload-area { border: 2px dashed #2d3148; border-radius: 8px; padding: 24px; text-align: center; cursor: pointer; transition: border-color 0.15s; }
.upload-area:hover { border-color: #3b82f6; }
.upload-area input { display: none; }
.upload-hint { color: #64748b; font-size: 0.85rem; margin-top: 8px; }

/* Proof thumbnails */
.proof-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.proof-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid #2d3148; cursor: pointer; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; font-size: 0.8rem; color: #64748b; border-bottom: 1px solid #2d3148; }
td { padding: 12px; font-size: 0.9rem; border-bottom: 1px solid #1e2133; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #1e2133; }

/* Badge */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-pending { background: #451a0333; color: #fbbf24; border: 1px solid #92400e; }
.badge-approved { background: #14532d33; color: #4ade80; border: 1px solid #166534; }
.badge-locked { background: #1e293b; color: #64748b; border: 1px solid #334155; }
.badge-active { background: #1e3a5f33; color: #60a5fa; border: 1px solid #1e40af; }
.badge-rejected { background: #7f1d1d33; color: #f87171; border: 1px solid #991b1b; }

/* Page header */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; color: #fff; }
.page-header p { color: #64748b; margin-top: 4px; font-size: 0.9rem; }

/* Admin step row */
.admin-step-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #1a1d27; border: 1px solid #2d3148; border-radius: 8px; margin-bottom: 8px; }
.admin-step-row .step-num { font-size: 0.8rem; color: #64748b; width: 24px; }
.admin-step-row .step-name { flex: 1; font-weight: 500; }

/* Rejection form */
.reject-form { display: none; margin-top: 8px; }
.reject-form.open { display: block; }

/* Step images gallery */
.step-images { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }
.step-images a { display: block; }
.step-images img { max-width: 100%; width: 180px; height: auto; border-radius: 6px; border: 1px solid #2d3148; }

@media (max-width: 600px) {
  .container { padding: 16px 12px; max-width: 100% !important; }
  .card { padding: 16px; }
  .auth-card { padding: 24px 16px; }
  .nav { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
  .nav-brand { font-size: 1rem; }
  .nav-links { flex-wrap: wrap; gap: 10px; font-size: 0.85rem; }
  h1 { font-size: 1.2rem !important; }
  .btn { width: 100%; }
  .btn-sm { width: auto; }
  .step-images img { width: calc(50% - 5px); }
  .proof-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .form-group input, .form-group textarea { font-size: 16px !important; /* prevent ios zoom on focus */ }
}

/* Step-level external link (admin-configured per step) */
.step-link-card { margin: 14px 0 0; }
.step-link { display: inline-block; font-weight: 600; }
.step-link::after { content: ' ↗'; font-size: 0.9em; opacity: 0.75; margin-left: 2px; }

/* Image lightbox (click any .zoomable img to fullscreen, back button to dismiss) */
.lightbox { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.94); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox-img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.lightbox-back { position: absolute; top: 16px; left: 16px; background: rgba(15, 23, 42, 0.9); color: #fff; border: 1px solid #334155; padding: 10px 16px; border-radius: 8px; font-size: 0.95rem; cursor: pointer; font-weight: 600; }
.lightbox-back:hover { background: rgba(30, 41, 59, 0.95); }
@media (max-width: 600px) {
  .lightbox { padding: 12px; }
  .lightbox-back { top: 10px; left: 10px; padding: 12px 18px; font-size: 1rem; }
}

/* Horizontal-scroll wrapper for wide tables on narrow screens */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Admin clients table — mobile: hide email + joined columns (email shows inline under name), let key cols fit */
@media (max-width: 600px) {
  .admin-clients-table .col-email,
  .admin-clients-table .col-joined { display: none; }
  .admin-clients-table .row-email-mobile { display: block !important; }
  .admin-clients-table th,
  .admin-clients-table td { padding: 10px 8px; font-size: 0.85rem; }
  .admin-clients-table .badge { white-space: nowrap; }
}

/* Verification link — nav badge + client card */
.nav-verif { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.nav-badge {
  background: #f59e0b;
  color: #1a1d27;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1.2;
  min-width: 18px;
  text-align: center;
}
.verif-card { border-color: #4b3b1e; }
.verif-pending { color: #fbbf24; }
.verif-admin-card { border-color: #4b3b1e; }

/* Sweeps credentials card (client step view) */
.creds-card { border-color: #1e3a5f; background: #141e2f; }
.creds-grid { display: flex; flex-direction: column; gap: 10px; }
.creds-row { display: flex; align-items: center; gap: 10px; }
.creds-label { width: 80px; color: #94a3b8; font-size: 0.8rem; flex-shrink: 0; }
.creds-val { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.creds-text { color: #e2e8f0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; background: #0f1117; padding: 5px 9px; border-radius: 5px; border: 1px solid #2d3148; word-break: break-all; }
.creds-copy { background: #1e40af; color: #fff; border: none; border-radius: 5px; padding: 5px 10px; font-size: 0.75rem; cursor: pointer; font-weight: 600; }
.creds-copy:hover { background: #1d4ed8; }
@media (max-width: 520px) {
  .creds-row { flex-direction: column; align-items: flex-start; }
  .creds-label { width: auto; }
}

/* Password field with show/hide toggle */
.pw-wrap { position: relative; display: flex; align-items: stretch; gap: 8px; }
.pw-wrap input { flex: 1; }
.pw-toggle { background: #1e40af; color: #fff; border: none; border-radius: 6px; padding: 0 14px; font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pw-toggle:hover { background: #1d4ed8; }
