/* ============================================================
   PULSE ADMIN — admin.css
   Full admin dashboard stylesheet.
   Inter font loaded from Google Fonts in the HTML head.
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

/* ── SKIP LINK ────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -40px; left: 8px;
  background: var(--accent); color: #fff;
  padding: 6px 12px; border-radius: 4px; z-index: 999;
  font-size: 12px; font-weight: 600;
  transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* ── APP SHELL ────────────────────────────────────────────── */
.admin-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════════ */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: var(--z-sidebar);
}

/* Sidebar header */
.admin-sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.admin-sidebar-logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  letter-spacing: -.02em;
}
.admin-sidebar-product {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-sidebar-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.admin-sidebar-sub {
  font-size: 9px;
  color: var(--sidebar-section-lbl);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #DC2626;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 99px;
  width: fit-content;
}

/* Sidebar nav */
.admin-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}
.admin-nav-section {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sidebar-section-lbl);
  padding: 14px 18px 5px;
}
.admin-nav-section:first-child { padding-top: 4px; }

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-left: 2px solid transparent;
  transition: color .12s, background .12s, border-color .12s;
  position: relative;
}
.admin-nav-item:hover {
  color: var(--sidebar-text-hover);
  background: rgba(255,255,255,.06);
}
.admin-nav-item.active {
  color: var(--sidebar-active-text);
  background: var(--sidebar-active-bg);
  border-left-color: var(--accent);
  font-weight: 600;
}
.admin-nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0; opacity: .8;
}
.admin-nav-item.active .admin-nav-icon { opacity: 1; }
.admin-nav-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  background: rgba(220,38,38,.7);
  color: #fff;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 16px;
  text-align: center;
}

/* Sidebar footer */
.admin-sidebar-footer {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.admin-sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.admin-user-avatar {
  width: 28px; height: 28px;
  background: rgba(37,99,235,.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #93C5FD;
  flex-shrink: 0;
}
.admin-user-name  { font-size: 12px; color: rgba(255,255,255,.75); font-weight: 500; }
.admin-user-email { font-size: 10px; color: var(--sidebar-section-lbl); }
.admin-signout-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--sidebar-section-lbl);
  background: none; border: none; cursor: pointer;
  padding: 0; transition: color .12s;
}
.admin-signout-btn:hover { color: rgba(255,255,255,.6); }

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════════ */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Top bar */
.admin-topbar {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-padding);
  flex-shrink: 0;
  gap: 16px;
}
.admin-topbar-left  { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.admin-topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.admin-breadcrumb-sep { opacity: .4; }
.admin-breadcrumb-current { color: var(--text); font-weight: 600; }

/* Global search */
.admin-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  width: 280px;
  transition: border-color .15s;
}
.admin-search:focus-within { border-color: var(--accent); }
.admin-search-icon { color: var(--text-3); flex-shrink: 0; }
.admin-search input {
  border: none; background: none; outline: none;
  font-size: 12px; color: var(--text); width: 100%;
}
.admin-search input::placeholder { color: var(--text-3); }

/* Topbar buttons */
.admin-topbar-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  transition: all .12s;
}
.admin-topbar-btn:hover { border-color: var(--accent); color: var(--accent); }
.admin-topbar-btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.admin-topbar-btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* Page container */
.admin-page-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--page-padding);
  position: relative;
}

/* ══════════════════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════════════════ */
.admin-page-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.admin-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.admin-page-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 3px;
}
.admin-page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   STAT CARDS (top of pages)
══════════════════════════════════════════════════════════════ */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.admin-stat-card:hover { box-shadow: var(--shadow); }
.admin-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 8px;
}
.admin-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}
.admin-stat-sub {
  font-size: 11px;
  color: var(--text-3);
}
.admin-stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}
.admin-stat-trend.up   { color: var(--green); }
.admin-stat-trend.down { color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   DATA TABLES
══════════════════════════════════════════════════════════════ */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.admin-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.admin-card-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}
.admin-card-actions { display: flex; align-items: center; gap: 6px; }

/* Filter bar */
.admin-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.admin-filter-input {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  min-width: 200px;
  flex: 1;
}
.admin-filter-input input {
  border: none; background: none; outline: none;
  font-size: 12px; color: var(--text); width: 100%;
}
.admin-filter-input input::placeholder { color: var(--text-3); }
.admin-filter-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface);
  outline: none;
  cursor: pointer;
}
.admin-filter-select:focus { border-color: var(--accent); }
.admin-filter-chip {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--border);
  background: none; color: var(--text-3); cursor: pointer;
  transition: all .12s;
}
.admin-filter-chip:hover  { border-color: var(--accent); color: var(--accent); }
.admin-filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.admin-filter-spacer { flex: 1; }

/* Table */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.admin-table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color .1s;
}
.admin-table th:hover { color: var(--text-2); }
.admin-table th.sort-asc::after  { content: ' ↑'; opacity: .6; }
.admin-table th.sort-desc::after { content: ' ↓'; opacity: .6; }
.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-sunken); }
.admin-table td.admin-td-primary { color: var(--text); font-weight: 600; }
.admin-table td.admin-td-mono { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* Table row actions */
.admin-row-actions {
  display: flex; align-items: center; gap: 4px;
  opacity: 0; transition: opacity .12s;
}
.admin-table tr:hover .admin-row-actions { opacity: 1; }
.admin-row-btn {
  font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  transition: all .1s;
}
.admin-row-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.admin-row-btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* Table pagination */
.admin-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}
.admin-pagination { display: flex; align-items: center; gap: 4px; }
.admin-page-btn {
  width: 28px; height: 28px;
  border-radius: 4px; border: 1px solid var(--border);
  background: none; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all .1s;
}
.admin-page-btn:hover { border-color: var(--accent); color: var(--accent); }
.admin-page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* ══════════════════════════════════════════════════════════════
   STATUS BADGES
══════════════════════════════════════════════════════════════ */
.admin-badge-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
.admin-badge-status::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.admin-badge-active    { color: var(--status-active);    background: var(--status-active-bg); }
.admin-badge-trialing  { color: var(--status-trial);     background: var(--status-trial-bg); }
.admin-badge-past-due  { color: var(--status-pastdue);   background: var(--status-pastdue-bg); }
.admin-badge-canceled  { color: var(--status-canceled);  background: var(--status-canceled-bg); }
.admin-badge-suspended { color: var(--status-suspended); background: var(--status-suspended-bg); }
.admin-badge-archived  { color: var(--status-archived);  background: var(--status-archived-bg); }

.admin-badge-plan {
  display: inline-flex;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .04em;
}
.admin-badge-starter { background: var(--slate-light);  color: var(--slate); }
.admin-badge-growth  { background: var(--blue-light);   color: var(--blue); }
.admin-badge-agency  { background: var(--purple-light); color: var(--purple); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.admin-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; font-family: var(--font-sans);
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  cursor: pointer; transition: all .12s; white-space: nowrap;
}
.admin-btn:hover { border-color: var(--text-3); color: var(--text); }
.admin-btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.admin-btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.admin-btn-danger  { background: var(--red); color: #fff; border-color: var(--red); }
.admin-btn-danger:hover  { background: #B91C1C; border-color: #B91C1C; color: #fff; }
.admin-btn-ghost   { background: none; border-color: transparent; }
.admin-btn-ghost:hover { background: var(--surface-sunken); border-color: var(--border); }
.admin-btn-sm { font-size: 11px; padding: 5px 10px; }
.admin-btn-icon { width: 30px; height: 30px; padding: 0; justify-content: center; }

/* ══════════════════════════════════════════════════════════════
   FORM INPUTS
══════════════════════════════════════════════════════════════ */
.admin-input {
  font-size: 13px; font-family: var(--font-sans);
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  width: 100%;
  transition: border-color .15s;
}
.admin-input:focus { border-color: var(--accent); outline: none; }
.admin-input::placeholder { color: var(--text-3); }
.admin-input:read-only { background: var(--surface-sunken); opacity: .7; cursor: not-allowed; }
.admin-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.admin-label {
  display: block;
  font-size: 11px; font-weight: 600; color: var(--text-2);
  margin-bottom: 5px;
}
.admin-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.admin-field:last-child { margin-bottom: 0; }
.admin-field-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.admin-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-field-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ══════════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════════ */
.admin-modal-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(15,28,46,.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
.admin-modal-overlay.open { opacity: 1; pointer-events: all; }
.admin-modal-overlay.open .admin-modal { transform: translateY(0) scale(1); opacity: 1; }

.admin-modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  max-height: 88vh; width: 520px; max-width: 96vw;
  transform: translateY(10px) scale(.98);
  opacity: 0;
  transition: transform .22s cubic-bezier(.22,1,.36,1), opacity .18s ease;
}
.admin-modal-lg { width: 720px; }
.admin-modal-xl { width: 900px; }

.admin-modal-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
.admin-modal-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.admin-modal-close {
  margin-left: auto; width: 26px; height: 26px;
  border-radius: 6px; border: 1px solid var(--border);
  background: none; color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s; flex-shrink: 0;
}
.admin-modal-close:hover { background: var(--surface-sunken); color: var(--text); }

.admin-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}
.admin-modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Confirm destroy modal (type firm name) */
.admin-confirm-input-wrap {
  margin-top: 12px;
}
.admin-confirm-firm-name {
  font-family: var(--font-mono);
  background: var(--surface-sunken);
  padding: 4px 8px; border-radius: 4px;
  font-size: 12px; color: var(--text);
}

/* ══════════════════════════════════════════════════════════════
   DETAIL PANELS (right-side slide-in or inline sections)
══════════════════════════════════════════════════════════════ */
.admin-detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.admin-detail-section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-sunken);
}
.admin-detail-section-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: .06em;
}
.admin-detail-section-body { padding: 14px 16px; }

.admin-kv-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0; border-bottom: .5px solid var(--border);
  gap: 16px;
}
.admin-kv-row:last-child { border-bottom: none; }
.admin-kv-label { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.admin-kv-value { font-size: 12px; color: var(--text); font-weight: 500; text-align: right; }
.admin-kv-value.mono { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }

/* ══════════════════════════════════════════════════════════════
   IMPERSONATE BANNER
══════════════════════════════════════════════════════════════ */
.admin-impersonate-bar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 9999;
  background: #D97706;
  color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 8px 20px;
  font-size: 12px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.admin-impersonate-bar button {
  font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: 4px;
  background: rgba(255,255,255,.25); border: 1px solid rgba(255,255,255,.4);
  color: #fff; cursor: pointer; transition: background .12s;
}
.admin-impersonate-bar button:hover { background: rgba(255,255,255,.35); }

/* ══════════════════════════════════════════════════════════════
   EMPTY STATES
══════════════════════════════════════════════════════════════ */
.admin-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 24px; text-align: center;
}
.admin-empty-icon { font-size: 40px; margin-bottom: 14px; opacity: .4; }
.admin-empty-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.admin-empty-sub   { font-size: 13px; color: var(--text-3); max-width: 320px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════
   TOASTS
══════════════════════════════════════════════════════════════ */
.admin-toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.admin-toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  min-width: 280px; max-width: 380px;
  animation: toastIn .22s cubic-bezier(.22,1,.36,1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.admin-toast-title { font-size: 13px; font-weight: 600; color: var(--text); }
.admin-toast-sub   { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   LOADING
══════════════════════════════════════════════════════════════ */
.admin-loader {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 200px; gap: 14px;
}
.admin-spinner {
  width: 24px; height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════
   TABS (for detail pages with multiple sections)
══════════════════════════════════════════════════════════════ */
.admin-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.admin-tab {
  font-size: 12px; font-weight: 500;
  padding: 10px 16px;
  border: none; background: none;
  color: var(--text-3); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s;
}
.admin-tab:hover  { color: var(--text-2); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   ACTIVITY FEED
══════════════════════════════════════════════════════════════ */
.admin-activity-item {
  display: flex; gap: 12px;
  padding: 10px 0;
  border-bottom: .5px solid var(--border);
}
.admin-activity-item:last-child { border-bottom: none; }
.admin-activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 4px;
}
.admin-activity-text { font-size: 12px; color: var(--text-2); line-height: 1.5; flex: 1; }
.admin-activity-text strong { color: var(--text); }
.admin-activity-time { font-size: 11px; color: var(--text-3); flex-shrink: 0; margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   DANGER ZONE
══════════════════════════════════════════════════════════════ */
.admin-danger-zone {
  border: 1px solid rgba(220,38,38,.25);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: rgba(220,38,38,.02);
}
.admin-danger-zone-title {
  font-size: 12px; font-weight: 700;
  color: var(--red); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: .06em;
}
.admin-danger-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: .5px solid var(--border);
}
.admin-danger-row:last-child { border-bottom: none; padding-bottom: 0; }
.admin-danger-label { font-size: 12px; font-weight: 600; color: var(--text); }
.admin-danger-sub   { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   WIZARD STEPS
══════════════════════════════════════════════════════════════ */
.admin-wizard-steps {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 28px;
}
.admin-wizard-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--text-3);
}
.admin-wizard-step.active  { color: var(--accent); font-weight: 700; }
.admin-wizard-step.done    { color: var(--green); }
.admin-wizard-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-sunken); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-3);
  flex-shrink: 0; transition: all .15s;
}
.admin-wizard-step.active .admin-wizard-step-num {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.admin-wizard-step.done .admin-wizard-step-num {
  background: var(--green); border-color: var(--green); color: #fff;
}
.admin-wizard-connector {
  flex: 1; height: 1px; background: var(--border); margin: 0 8px; min-width: 20px;
}

/* ══════════════════════════════════════════════════════════════
   SHEET SYNC CONFIG — column mapper
══════════════════════════════════════════════════════════════ */
.sync-map-row {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: .5px solid var(--border);
}
.sync-map-row:last-child { border-bottom: none; }
.sync-map-target {
  font-size: 12px; font-weight: 500; color: var(--text);
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.sync-map-arrow { text-align: center; color: var(--text-3); font-size: 14px; }
.sync-map-source {
  font-size: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text);
  transition: border-color .15s;
}
.sync-map-source:focus { border-color: var(--accent); outline: none; }
.sync-map-source::placeholder { color: var(--text-3); }

.sync-version-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 6px;
  cursor: pointer; transition: border-color .12s;
}
.sync-version-row:hover { border-color: var(--accent); }
.sync-version-row.active { border-color: var(--accent); background: var(--accent-light); }
.sync-version-name { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; }
.sync-version-date { font-size: 10px; color: var(--text-3); }

/* ══════════════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════════════ */
.text-green  { color: var(--green) !important; }
.text-red    { color: var(--red) !important; }
.text-amber  { color: var(--amber) !important; }
.text-blue   { color: var(--blue) !important; }
.text-muted  { color: var(--text-3) !important; }
.text-bold   { font-weight: 700; }
.text-mono   { font-family: var(--font-mono); font-size: .9em; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }

/* ── Firms page extras ────────────────────────────────────── */
.firms-result-count {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Firm detail extras ───────────────────────────────────── */
.fd-panel { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

.fd-firm-avatar {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; flex-shrink: 0;
  border: 2px solid;
}
.fd-spec-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500; color: var(--text-2);
  background: var(--surface-sunken); border: 1px solid var(--border);
  border-radius: 99px; padding: 3px 10px;
  margin: 0 4px 4px 0;
}

/* ── Sheet sync — two-type tab UI ────────────────────────── */
.sheet-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.sheet-type-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  font-family: var(--font-sans);
}
.sheet-type-tab:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.sheet-type-tab.active {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.sheet-type-icon { font-size: 24px; flex-shrink: 0; }
.sheet-type-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.sheet-type-sub {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
}
.sheet-type-tab.active .sheet-type-label { color: var(--accent); }
.sheet-type-tab.active .sheet-type-sub   { color: var(--accent); opacity: .7; }

.fd-sheet-type-panel { animation: fadeIn .15s ease; }

/* Column map header */
.sync-map-header {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  gap: 8px;
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.sync-map-header-cell {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
}

/* Group label between mapping rows */
.sync-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  padding: 12px 0 4px;
  border-bottom: 1px solid var(--accent-border);
  margin-bottom: 2px;
}

/* ── Add Firm Wizard ──────────────────────────────────────── */
.wz-pa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 8px;
}
.wz-pa-card {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer; font-size: 12px; font-weight: 500;
  color: var(--text-2); transition: all .12s;
}
.wz-pa-card:hover { border-color: var(--accent); color: var(--text); }
.wz-pa-card.checked { border-color: var(--accent); background: var(--accent-light); color: var(--accent); font-weight: 600; }
.wz-pa-card input[type="checkbox"] { accent-color: var(--accent); flex-shrink: 0; }

.wz-plan-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px; border: 2px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  cursor: pointer; transition: all .15s;
}
.wz-plan-card:hover { border-color: var(--accent); }
.wz-plan-card.checked { border-color: var(--accent); background: var(--accent-light); }
.wz-plan-card input[type="radio"] { display: none; }
.wz-plan-label  { font-size: 14px; font-weight: 700; color: var(--text); }
.wz-plan-price  { font-size: 20px; font-weight: 800; color: var(--accent); }
.wz-plan-features { font-size: 11px; color: var(--text-3); line-height: 1.5; }

/* ── Benchmarks inline edit ───────────────────────────────── */
.bm-cell:hover { background: var(--surface-sunken); }

/* ── Triage cards (feature requests + bug reports) ─────────── */
.triage-card {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.triage-card:last-child { border-bottom: none; }
.triage-card:hover { background: var(--surface-sunken); }
.triage-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 12px;
}
.triage-card-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.triage-card-note {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
  font-style: italic;
}

/* ── Announcements list ──────────────────────────────────────── */
.ann-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.ann-item:last-child { border-bottom: none; }
.ann-item:hover { background: var(--surface-sunken); }
.ann-item-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 12px;
}
