/* pages/admin.css — Admin Dashboard (AC-2: synced with FE-1B/2/3 design) */

/* ═══ STATS GRID ════════════════════════════════════════════ */
.adm-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px;
}
@media (max-width: 900px) { .adm-stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .adm-stats-grid { grid-template-columns: 1fr; } }

.adm-stat-card {
  display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px;
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  transition: all 0.18s ease;
}
.adm-stat-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-1px);
}
.adm-stat-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md); flex-shrink: 0;
  background: var(--surface-sunken); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
}
.adm-stat-icon svg { width: 18px; height: 18px; color: #2563EB; }
.adm-stat-body { flex: 1; min-width: 0; }
.adm-stat-label { font-size: 11px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.adm-stat-value { font-size: 24px; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono, monospace); line-height: 1.2; }
.adm-stat-footnote { font-size: 11px; color: var(--text-disabled); margin-top: 2px; }

/* ═══ TOOLBAR ═══════════════════════════════════════════════ */
.adm-toolbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.adm-toolbar .btn svg { width: 14px; height: 14px; }
.adm-user-count {
  margin-left: auto; font-size: 12px; color: var(--text-disabled); font-weight: 500;
}

/* ═══ TABLE ═════════════════════════════════════════════════ */
.adm-table-wrap {
  overflow-x: auto; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); background: var(--surface-card);
  box-shadow: var(--shadow-xs);
}
.adm-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.adm-table thead th {
  text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600;
  color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle); background: var(--surface-sunken);
  white-space: nowrap;
}
.adm-table tbody td {
  padding: 10px 14px; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary); vertical-align: middle;
}
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-table tbody tr:hover { background: rgba(37,99,235,0.02); }

.adm-cell-email { font-weight: 500; white-space: nowrap; }
.adm-cell-meta { color: var(--text-tertiary); white-space: nowrap; }
.adm-cell-cost { font-family: var(--font-mono, monospace); font-weight: 600; white-space: nowrap; }
.adm-empty { text-align: center; color: var(--text-disabled); padding: 40px 14px !important; }

/* ─── Plan badge ────────────────────────────────────────── */
.adm-plan-badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
.adm-plan-admin { background: rgba(139,92,246,0.1); color: #7c3aed; }
.adm-plan-free  { background: var(--surface-sunken); color: var(--text-tertiary); }

/* ─── Row disabled (locked user) ────────────────────────── */
.adm-row-disabled { opacity: 0.5; }
.adm-row-disabled:hover { opacity: 0.65; }

/* ─── Toggle button ─────────────────────────────────────── */
.adm-btn-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-default); background: var(--surface-card);
  cursor: pointer; transition: all 0.15s; color: var(--text-tertiary);
}
.adm-btn-toggle:hover:not(:disabled) {
  border-color: #dc2626; color: #dc2626; background: rgba(220,38,38,0.04);
}
.adm-btn-toggle.adm-btn-unlock:hover:not(:disabled) {
  border-color: #16a34a; color: #16a34a; background: rgba(22,163,74,0.04);
}
.adm-btn-toggle:disabled { opacity: 0.3; cursor: not-allowed; }
.adm-btn-toggle svg { width: 14px; height: 14px; }

/* ═══ MODAL ═════════════════════════════════════════════════ */
.adm-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.35); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.adm-modal {
  width: 420px; max-width: 92vw; padding: 24px;
  background: var(--surface-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border-subtle);
}
.adm-modal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
}
.adm-modal-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.adm-modal-close {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer; color: var(--text-disabled);
  border-radius: var(--radius-sm); transition: all 0.15s;
}
.adm-modal-close:hover { background: var(--surface-sunken); color: var(--text-primary); }
.adm-modal-close svg { width: 16px; height: 16px; }
.adm-modal-actions { display: flex; gap: 8px; margin-top: 18px; }

/* ─── Form inputs (reuse tokens) ────────────────────────── */
.form-input {
  width: 100%; padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--surface-base); color: var(--text-primary); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.mb-12 { margin-bottom: 12px; }
